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

EF2: "Permission denied:" when deploying python extension on Windows ActiveGate

AntonioSousa
DynaMight Guru
DynaMight Guru

I have developed an EF2 extension that has to be deployed on a Windows server. It is giving a "Permission denied:" error in the logs, when it is being deployed:

 

 

 

2024-10-29 20:56:21.774 UTC [000018b8] warning [native] Failed to prepare extension environment:
 	id: f_7462894110209093396
 	datasource: python:3.10
 	time elapsed: 1.44s
 	command: "C:\ProgramData\dynatrace\remotepluginmodule\agent\runtime\extensions\python_venvs\custom_abc_0.0.2\Scripts\python.exe" -m pip install --no-warn-script-location --no-cache-dir --no-index -f C:\ProgramData\dynatrace\remotepluginmodule\agent\runtime\extensions\cache\custom_abc\0.0.2/lib abc
 	error: Traceback (most recent call last):
   File "C:\Program Files\dynatrace\remotepluginmodule\agent\res\dsruntime\python3.10\lib\runpy.py", line 196, in _run_module_as_main
     return _run_code(code, main_globals, None,
   File "C:\Program Files\dynatrace\remotepluginmodule\agent\res\dsruntime\python3.10\lib\runpy.py", line 86, in _run_code
     exec(code, run_globals)
   File "C:\Program Files\dynatrace\remotepluginmodule\agent\res\dsruntime\python3.10\lib\site-packages\pip\__main__.py", line 22, in <module>
     from pip._internal.cli.main import main as _main
   File "C:\Program Files\dynatrace\remotepluginmodule\agent\res\dsruntime\python3.10\lib\site-packages\pip\_internal\__init__.py", line 3, in <module>
     from pip._internal.utils import _log
   File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
   File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
   File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
   File "<frozen importlib._bootstrap_external>", line 879, in exec_module
   File "<frozen importlib._bootstrap_external>", line 1016, in get_code
   File "<frozen importlib._bootstrap_external>", line 1073, in get_data
 PermissionError: [Errno 13] Permission denied: 'C:\\Program Files\\dynatrace\\remotepluginmodule\\agent\\res\\dsruntime\\python3.10\\lib\\site-packages\\pip\\_internal\\utils\\__init__.py'
 
2024-10-29 20:56:21.774 UTC [000018b8] warning [native] std ouput from ""C:\Program Files\dynatrace\remotepluginmodule\agent\res\dsruntime\python3.10\bin\python.exe" -m venv C:\ProgramData\dynatrace\remotepluginmodule\agent\runtime\extensions\python_venvs\custom_abc_0.0.2 --system-site-packages --without-pip" command:
 
 std ouput from ""C:\ProgramData\dynatrace\remotepluginmodule\agent\runtime\extensions\python_venvs\custom_abc_0.0.2\Scripts\python.exe" -m pip install --no-warn-script-location --no-cache-dir --no-index -f C:\ProgramData\dynatrace\remotepluginmodule\agent\runtime\extensions\cache\custom_abc\0.0.2/lib abc" command:
 
2024-10-29 20:56:21.775 UTC [000018b8] info    [native] Rejected fastcheck for task f_7462894110209093396 - 

 

 

 

It's not a certificate issue, as another modified WMI extension is working OK in the server. It is the first python extension though.

Another interesting thing is that the __init__.py referenced is a 0 byte python file. It doesn't seem to have any permission issues though. The environment is a restricted environment, with no Internet connectivity.

Has anyone got any issue similar to this, developing custom extensions in Windows AGs?

Antonio Sousa
2 REPLIES 2

MostafaHussein
Advisor

- I've faced the same issue when activating venv while testing locally, and it worked well when I deactivated venv.

- other thing, this may because of you've dependencies is already installed in your development environment but not included in setup.py under `install_requires` or `extra_requires` as the following figure

MostafaHussein_0-1730239672205.png

- regarding __init__.py it makes python treats the current directory as package and it was important for defining the namespace of the .py files included in the same directory (before version 3.3) as the namespace of each class take the same name of the current directory of the __init__.py, Since python version 3.3 it's automatically build namespaces and this file became optional.

 

Certified Dynatrace Professional | Certified Dynatrace Services - Observability | Dynatrace Partner yourcompass.ca

@MostafaHussein,

It doesn't seem to be related to my extension. It's complaining about the __init__.py file that comes inside pip, inside the python distributed with AG:

 

C:\Program Files\dynatrace\remotepluginmodule\agent\res\dsruntime\python3.10\lib\site-packages\pip\_internal\utils\__init__.py

 

 

In the meantime, I tried the trick of putting in a "#" in the file, so it isn't 0 bytes, but that didn't help either.

Antonio Sousa

Featured Posts