Docker non-root / execd / python script permission error

Hi,

Since docker image telegraf:1.20.3 I am struggling with permission within a [execd] python script. I included python within the Dockerfile. Python is working within the newly generated container. But the script (to grab SolarEdge API) is generating some files. The script [telegraf log] returned PermissionError: [Errno 13] Permission denied: ‘/etc/telegraf/installinfo’. installinfo is the generated file.

I read this blog post. But where should I do the usermod or/and chown?

Any help is really appreciated.

Regards,
Bert

Hi!

Here is what I would check when creating your docker image:

  1. Verify that the file itself has the executable bit enabled (e.g. chmod +x /etc/telegraf/installinfo)
  2. Make sure the script is owned by the telegraf user (e.g. chown telegraf /etc/telegraf/installinfo)

Those two things should enable you to call the file in your inputs.exec section of your config.

Let us know if that helps!

Hi,

Thank you for your fast response.

The file installinfo is generated by the main Phyton script and is used for caching. I have no clue how to fix it. But I made a working image with Telegraf 1.19.2

Regards,
Bert