I have installed python version 3.8 from https://www.python.org/downloads/release/python-3810/
I made all steps in this link https://www.dynatrace.com/support/help/extend-dynatrace/extensions/oneagent-extensions/oneagent-exte... until the build step. When running build command I get this error:
C:\...\oneagent-demo-ext\examples\demo_oneagent_plugin>plugin_sdk build_plugin --no_upload
Arguments=Namespace(deployment_dir=None, no_cert_ver=False, no_upload=True, plugin_dir='C:\\...\\oneagent-demo-ext\\examples\\demo_oneagent_plugin', server=None, token=None, token_file=None, verbose=False)
Checking plugin metadata: C:\...\oneagent-demo-ext\examples\demo_oneagent_plugin\plugin.json
Validating plugin.json against schema
Error occured: <urlopen error [WinError 2] The system cannot find the file specified: 'name.json'>
Any ideas of what is causing this error?
Solved! Go to Solution.
Depending on which version of the SDK you are using, you may see a Traceback message that references a problem in the jsonschema package. This is a dependency of plugin_sdk. There was a change made in version 4.10.0 of jsonschema that seems to have broken several tools that depend on it.
For now, the best course of action is downgrade your version of jsonschema to <=4.9.1. Run the command:
pip install jsonschema==4.9.1
After the downgrade is complete, try running the build command again. Here's an example of the error, the downgrade and a rerun of the build command:
FileNotFoundError: [Errno 2] No such file or directory: 'xxx/plugin_deployment/xxx/plugin.json' ❯ pip install jsonschema==4.9.1 Collecting jsonschema==4.9.1 Using cached jsonschema-4.9.1-py3-none-any.whl (79 kB) Requirement already satisfied: attrs>=17.4.0 in ./venv/lib/python3.11/site-packages (from jsonschema==4.9.1) (22.1.0) Requirement already satisfied: pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 in ./venv/lib/python3.11/site-packages (from jsonschema==4.9.1) (0.18.1) Installing collected packages: jsonschema Attempting uninstall: jsonschema Found existing installation: jsonschema 4.10.0 Uninstalling jsonschema-4.10.0: Successfully uninstalled jsonschema-4.10.0 Successfully installed jsonschema-4.9.1 ❯ ./build_and_simulate.sh File: /etc/init.d/dynatracefunctions not found - Remote Plugin Module is detected Arguments=Namespace(plugin_dir='xxx/', deployment_dir='xxx/plugin_deployment', verbose=False, no_upload=True, no_cert_ver=False, server=None, token=None, token_file=None) Starting oneagent_build_plugin Checking plugin metadata: /Users/xxx/dev/xxx/plugin.json Validating plugin.json against schema Plugin data: Plugin name=xxx, version=0.1.1 Cleaning up previous build information
Hope that helps!
Thank you for your answer.
I will try your solution, but in the meantime i made some progress.
As strange as it my seams, I've created an empty json file 'name.json' that was causing the exception. Then it threw another exception that it was missing a file name 'units.json'. I also created this file, and finally it threw an exception that a file 'properties.json' was missing. I made a copy of 'plugin.json' and renamed it to 'properties.json'.
After this changes i was able to run de simulator , build the extension and uploaded to Dynatrace compiled with the latest version of python 3.10.6.