cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Build_plugin gives "permission denied: 'top_level.txt'" when not executed as root

Hey Community,

 

I guess this is more a python thingy but I only have this recently when moving to the latest sdk and Python3.8.

Problem is that building a plugin fails with message: Error occured: [Errno 13] Permission denied: 'top_level.txt'

(I will include the entire log with verbose)

 

I have checked the entire system for top_level.txt files and the permissions on them and they are all ok. I guess that the build process has this file open at the moment it wants to do something with it.
Running it with root (sudo) seems to work, but then all downloaded modules have the wrong privileges which is even more anoying.

 

I know this is a very specific one, but I hope to find some help or some tricks.

 

Thanks.

7 REPLIES 7

See attached log.

Julius_Loman
DynaMight Legend
DynaMight Legend

Hi @Bert_VanderHeyd ,

it looks like an issue with python virtual environment. How do you have it installed? Maybe you could try it with the default system-wide python.

Julius

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

I am using venv to be able to switch to 3.8. When I build with 3.6 (system wide python) I get exactly the same error.

I'd try run strace on the plugin_sdk build_plugin and see where and why it fails:

strace -f -o /tmp/build_plugin.txt plugin_sdk build_plugin

Can you share the output here?

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

Here you go. 

Looks like it has to do with the removal of a temp directory.
rmdir("/tmp/tmppc7q0iw_")

The reason was very simple... I was running the build from within the directory containing the sources. Just moving one dir up did the trick.

AntonioSousa
DynaMight Guru
DynaMight Guru

Had a very similar issue with the file "METADATA" instead of "top_level.txt".

In my case, it was that in the directory /opt/dynatrace/remotepluginmodule/plugin_deployment
the directory for the extension was owned by root.

Deleting that directory and building again had no issue.

Antonio Sousa

Featured Posts