24 Oct 2024 10:57 AM
Hello,
I encountered some troubles to move a custom python extension V2 from a sandbox tenant to a production tenant (the previous dev env doesn't exist anymore).
Actions done :
1- I created a new vscode project and I created a new python extension from an existing extension on sandbox tenant :
2- I edited the setup.py and I add required dependencies :
By comparison with the dependencies included on the extension.zip (on sandbox version) :
3-
When I build the extension through the UI, the following error appears related to the dependancy pycryptodomex :
When I use the command line dt-sdk build the extension is build with success :
Building and signing extension from . to None
Stage 1 - Download and build dependencies
Cleaning extension\lib
Downloading dependencies to extension\lib
Running: C:\Users\Aurélien\AppData\Local\Programs\Python\Python310\python.exe -m pip wheel -w extension/lib .
Processing c:\users\aurélien\documents\github\CLIENT\dynatrace-extension-cisco-wlc-v2
Preparing metadata (setup.py) ... done
Collecting dt-extensions-sdk (from ciscocontrollerwifi==0.0.25)
Using cached dt_extensions_sdk-1.2.14-py3-none-any.whl.metadata (2.7 kB)
Collecting requests>=2.6.0 (from ciscocontrollerwifi==0.0.25)
Using cached requests-2.32.3-py3-none-any.whl.metadata (4.6 kB)
Collecting pysnmp==4.4.12 (from ciscocontrollerwifi==0.0.25)
Using cached pysnmp-4.4.12-py2.py3-none-any.whl.metadata (1.8 kB)
Collecting snmp (from ciscocontrollerwifi==0.0.25)
Using cached snmp-0.8.0-py3-none-any.whl
Collecting pyasn1>=0.4.8 (from ciscocontrollerwifi==0.0.25)
Using cached pyasn1-0.6.1-py3-none-any.whl.metadata (8.4 kB)
Collecting pycryptodomex==3.20.0 (from ciscocontrollerwifi==0.0.25)
Using cached pycryptodomex-3.20.0-cp35-abi3-win_amd64.whl.metadata (3.4 kB)
Collecting pysmi (from pysnmp==4.4.12->ciscocontrollerwifi==0.0.25)
Using cached pysmi-1.5.5-py3-none-any.whl.metadata (3.2 kB)
Collecting charset-normalizer<4,>=2 (from requests>=2.6.0->ciscocontrollerwifi==0.0.25)
Using cached charset_normalizer-3.4.0-cp310-cp310-win_amd64.whl.metadata (34 kB)
Collecting idna<4,>=2.5 (from requests>=2.6.0->ciscocontrollerwifi==0.0.25)
Using cached idna-3.10-py3-none-any.whl.metadata (10 kB)
Collecting urllib3<3,>=1.21.1 (from requests>=2.6.0->ciscocontrollerwifi==0.0.25)
Using cached urllib3-2.2.3-py3-none-any.whl.metadata (6.5 kB)
Collecting certifi>=2017.4.17 (from requests>=2.6.0->ciscocontrollerwifi==0.0.25)
Using cached certifi-2024.8.30-py3-none-any.whl.metadata (2.2 kB)
Collecting pycryptodome>=3.4 (from snmp->ciscocontrollerwifi==0.0.25)
Using cached pycryptodome-3.21.0-cp36-abi3-win_amd64.whl.metadata (3.4 kB)
Collecting Jinja2<4.0.0,>=3.1.3 (from pysmi->pysnmp==4.4.12->ciscocontrollerwifi==0.0.25)
Using cached jinja2-3.1.4-py3-none-any.whl.metadata (2.6 kB)
Collecting ply<4.0,>=3.11 (from pysmi->pysnmp==4.4.12->ciscocontrollerwifi==0.0.25)
Using cached ply-3.11-py2.py3-none-any.whl.metadata (844 bytes)
Collecting MarkupSafe>=2.0 (from Jinja2<4.0.0,>=3.1.3->pysmi->pysnmp==4.4.12->ciscocontrollerwifi==0.0.25)
Using cached MarkupSafe-3.0.2-cp310-cp310-win_amd64.whl.metadata (4.1 kB)
Using cached pycryptodomex-3.20.0-cp35-abi3-win_amd64.whl (1.8 MB)
Using cached pysnmp-4.4.12-py2.py3-none-any.whl (296 kB)
Using cached pyasn1-0.6.1-py3-none-any.whl (83 kB)
Using cached requests-2.32.3-py3-none-any.whl (64 kB)
Using cached dt_extensions_sdk-1.2.14-py3-none-any.whl (47 kB)
Using cached certifi-2024.8.30-py3-none-any.whl (167 kB)
Using cached charset_normalizer-3.4.0-cp310-cp310-win_amd64.whl (102 kB)
Using cached idna-3.10-py3-none-any.whl (70 kB)
Using cached pycryptodome-3.21.0-cp36-abi3-win_amd64.whl (1.8 MB)
Using cached urllib3-2.2.3-py3-none-any.whl (126 kB)
Using cached pysmi-1.5.5-py3-none-any.whl (84 kB)
Using cached jinja2-3.1.4-py3-none-any.whl (133 kB)
Using cached ply-3.11-py2.py3-none-any.whl (49 kB)
Using cached MarkupSafe-3.0.2-cp310-cp310-win_amd64.whl (15 kB)
Saved c:\users\aurélien\documents\github\CLIENT\dynatrace-extension-cisco-wlc-v2\extension\lib\pycryptodomex-3.20.0-cp35-abi3-win_amd64.whl
Saved c:\users\aurélien\documents\github\CLIENT\dynatrace-extension-cisco-wlc-v2\extension\lib\pysnmp-4.4.12-py2.py3-none-any.whl
Saved c:\users\aurélien\documents\github\CLIENT\dynatrace-extension-cisco-wlc-v2\extension\lib\pyasn1-0.6.1-py3-none-any.whl
Saved c:\users\aurélien\documents\github\CLIENT\dynatrace-extension-cisco-wlc-v2\extension\lib\requests-2.32.3-py3-none-any.whl
Saved c:\users\aurélien\documents\github\CLIENT\dynatrace-extension-cisco-wlc-v2\extension\lib\dt_extensions_sdk-1.2.14-py3-none-any.whl
Saved c:\users\aurélien\documents\github\CLIENT\dynatrace-extension-cisco-wlc-v2\extension\lib\snmp-0.8.0-py3-none-any.whl
Saved c:\users\aurélien\documents\github\CLIENT\dynatrace-extension-cisco-wlc-v2\extension\lib\certifi-2024.8.30-py3-none-any.whl
Saved c:\users\aurélien\documents\github\CLIENT\dynatrace-extension-cisco-wlc-v2\extension\lib\charset_normalizer-3.4.0-cp310-cp310-win_amd64.whl
Saved c:\users\aurélien\documents\github\CLIENT\dynatrace-extension-cisco-wlc-v2\extension\lib\idna-3.10-py3-none-any.whl
Saved c:\users\aurélien\documents\github\CLIENT\dynatrace-extension-cisco-wlc-v2\extension\lib\pycryptodome-3.21.0-cp36-abi3-win_amd64.whl
Saved c:\users\aurélien\documents\github\CLIENT\dynatrace-extension-cisco-wlc-v2\extension\lib\urllib3-2.2.3-py3-none-any.whl
Saved c:\users\aurélien\documents\github\CLIENT\dynatrace-extension-cisco-wlc-v2\extension\lib\pysmi-1.5.5-py3-none-any.whl
Saved c:\users\aurélien\documents\github\CLIENT\dynatrace-extension-cisco-wlc-v2\extension\lib\jinja2-3.1.4-py3-none-any.whl
Saved c:\users\aurélien\documents\github\CLIENT\dynatrace-extension-cisco-wlc-v2\extension\lib\ply-3.11-py2.py3-none-any.whl
Saved c:\users\aurélien\documents\github\CLIENT\dynatrace-extension-cisco-wlc-v2\extension\lib\markupsafe-3.0.2-cp310-cp310-win_amd64.whl
Building wheels for collected packages: ciscocontrollerwifi
Building wheel for ciscocontrollerwifi (setup.py) ... done
Created wheel for ciscocontrollerwifi: filename=ciscocontrollerwifi-0.0.25-py3-none-any.whl size=6673 sha256=3bce758b15fbef94389812434a199d18917998b4edd78e909374d5299ebc66ff
Stored in directory: c:\users\aurélien\appdata\local\pip\cache\wheels\df\88\e0\715727277aabd7de4b4bdb20102ea463a5fc1e4bad67622d5e
Successfully built ciscocontrollerwifi
Installed dependencies to extension\lib
Stage 2 - Create the extension zip file
Running: dt ext assemble --source extension --output dist\extension.zip --force
Building dist\extension.zip from extension
Adding file: extension\activationSchema.json as activationSchema.json
Adding file: extension\extension.yaml as extension.yaml
Adding file: extension\lib\certifi-2024.8.30-py3-none-any.whl as lib\certifi-2024.8.30-py3-none-any.whl
Adding file: extension\lib\charset_normalizer-3.4.0-cp310-cp310-win_amd64.whl as lib\charset_normalizer-3.4.0-cp310-cp310-win_amd64.whl
Adding file: extension\lib\ciscocontrollerwifi-0.0.25-py3-none-any.whl as lib\ciscocontrollerwifi-0.0.25-py3-none-any.whl
Adding file: extension\lib\dt_extensions_sdk-1.2.14-py3-none-any.whl as lib\dt_extensions_sdk-1.2.14-py3-none-any.whl
Adding file: extension\lib\idna-3.10-py3-none-any.whl as lib\idna-3.10-py3-none-any.whl
Adding file: extension\lib\jinja2-3.1.4-py3-none-any.whl as lib\jinja2-3.1.4-py3-none-any.whl
Adding file: extension\lib\MarkupSafe-3.0.2-cp310-cp310-win_amd64.whl as lib\MarkupSafe-3.0.2-cp310-cp310-win_amd64.whl
Adding file: extension\lib\ply-3.11-py2.py3-none-any.whl as lib\ply-3.11-py2.py3-none-any.whl
Adding file: extension\lib\pyasn1-0.6.1-py3-none-any.whl as lib\pyasn1-0.6.1-py3-none-any.whl
Adding file: extension\lib\pycryptodome-3.21.0-cp36-abi3-win_amd64.whl as lib\pycryptodome-3.21.0-cp36-abi3-win_amd64.whl
Adding file: extension\lib\pycryptodomex-3.20.0-cp35-abi3-win_amd64.whl as lib\pycryptodomex-3.20.0-cp35-abi3-win_amd64.whl
Adding file: extension\lib\pysmi-1.5.5-py3-none-any.whl as lib\pysmi-1.5.5-py3-none-any.whl
Adding file: extension\lib\pysnmp-4.4.12-py2.py3-none-any.whl as lib\pysnmp-4.4.12-py2.py3-none-any.whl
Adding file: extension\lib\requests-2.32.3-py3-none-any.whl as lib\requests-2.32.3-py3-none-any.whl
Adding file: extension\lib\snmp-0.8.0-py3-none-any.whl as lib\snmp-0.8.0-py3-none-any.whl
Adding file: extension\lib\urllib3-2.2.3-py3-none-any.whl as lib\urllib3-2.2.3-py3-none-any.whl
Built the extension zip file to dist\extension.zip
Stage 3 - Sign the extension
Signing file dist\extension.zip to dist\custom_ciscocontrollerwifi-0.0.25.zip with certificate C:\Users\Aurélien\.dynatrace\certificates\developer.pem
Running: dt ext sign --src dist\extension.zip --output dist\custom_ciscocontrollerwifi-0.0.25.zip --key C:\Users\Aurélien\.dynatrace\certificates\developer.pem --force
Warning: skipping file permission check
Warning: overwritting dist\custom_ciscocontrollerwifi-0.0.25.zip
Created signed extension file dist\custom_ciscocontrollerwifi-0.0.25.zip
Stage 4 - Delete dist\extension.zip
But when I try to upload the extension file :
It's a really strange behaviour because the certificate path is correct to developer.pem.
Vscode env, sandbox AG and Prod AG use Windows systems.
Thank you.
Regards Aurélien.
Solved! Go to Solution.
24 Oct 2024 12:40 PM
Hello @AurelienGravier
Kindly check https://docs.dynatrace.com/docs/shortlink/sign-extension
BR,
Peter
24 Oct 2024 01:27 PM
When generating certificates from the SDK, it will generate a developer cert and a CA cert. (developer.pem/ca.pem)
By default you will find them under here:
c:\Users\{username}\AppData\Roaming\Code\User\workspaceStorage\{randomid}\DynatracePlatformExtensions.dynatrace-extensions\certificates\
Please try to upload the ca.pem to the credential vault first, before trying to upload the extension.
Note: you will find the complete path for the certificates from the setting pallet in visual code.
25 Oct 2024 03:09 PM
Hello guys,
Thank you for your help, the ca.pem was missing in the dynatrace vault prod environment 🙄.