Problem building OneAgent plugin

Hello,

I’m trying to write a OneAgent plugin. What I’ve done:

  • installed python 3.5
  • pip 9.0.3
  • unzip /usr/local/data/agents/1.151.314.20180920-141612/agent/plugin-sdk/plugin-sdk-1.151.314.20180920-141612.zip
  • installed sdk : pip install oneagent_sdk-1.151.314.20180920.141612-py3-none-any.whl
  • tried to build the plugin (as root)
    • cd examples/demo_oneagent_plugin
    • /opt/rh/rh-python35/root/usr/bin/oneagent_build_plugin --no_upload

The result :

/opt/rh/rh-python35/root/usr/bin/oneagent_build_plugin --no_upload<br>Arguments=Namespace(no_cert_ver=False, no_restart=False, no_upload=True, source_dir='/tmp/plugin-sdk/examples/demo_oneagent_plugin', target_dir=None, verbose=False)<br>Starting oneagent_build_plugin<br>Checking plugin metadata: /tmp/plugin-sdk/examples/demo_oneagent_plugin/plugin.json<br>Validating plugin.json against schema<br>Plugin data: Plugin name=custom.python.demo_plugin, version=1.2<br>Cleaning up previous build information<br>running bdist_wheel<br>running build<br>running build_py<br>creating build<br>creating build/lib<br>copying /tmp/plugin-sdk/examples/demo_oneagent_plugin/demo_plugin.py -> build/lib<br>installing to build/bdist.linux-x86_64/wheel<br>running install<br>running install_lib<br>creating build/bdist.linux-x86_64<br>creating build/bdist.linux-x86_64/wheel<br>copying build/lib/demo_plugin.py -> build/bdist.linux-x86_64/wheel<br>running install_egg_info<br>running egg_info<br>creating /tmp/plugin-sdk/examples/demo_oneagent_plugin/demo_plugin.egg-info<br>writing /tmp/plugin-sdk/examples/demo_oneagent_plugin/demo_plugin.egg-info/PKG-INFO<br>writing top-level names to /tmp/plugin-sdk/examples/demo_oneagent_plugin/demo_plugin.egg-info/top_level.txt<br>writing dependency_links to /tmp/plugin-sdk/examples/demo_oneagent_plugin/demo_plugin.egg-info/dependency_links.txt<br>writing requirements to /tmp/plugin-sdk/examples/demo_oneagent_plugin/demo_plugin.egg-info/requires.txt<br>writing manifest file '/tmp/plugin-sdk/examples/demo_oneagent_plugin/demo_plugin.egg-info/SOURCES.txt'<br>reading manifest file '/tmp/plugin-sdk/examples/demo_oneagent_plugin/demo_plugin.egg-info/SOURCES.txt'<br>writing manifest file '/tmp/plugin-sdk/examples/demo_oneagent_plugin/demo_plugin.egg-info/SOURCES.txt'<br>Copying /tmp/plugin-sdk/examples/demo_oneagent_plugin/demo_plugin.egg-info to build/bdist.linux-x86_64/wheel/demo_plugin-1.2-py3.5.egg-info<br>running install_scripts<br>creating build/bdist.linux-x86_64/wheel/demo_plugin-1.2.dist-info/WHEEL<br>creating 'dist/demo_plugin-1.2-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it<br>adding 'demo_plugin.py'<br>adding 'demo_plugin-1.2.dist-info/METADATA'<br>adding 'demo_plugin-1.2.dist-info/WHEEL'<br>adding 'demo_plugin-1.2.dist-info/top_level.txt'<br>adding 'demo_plugin-1.2.dist-info/RECORD'<br>removing build/bdist.linux-x86_64/wheel<br>Leaving directory /tmp/tmpereehe53<br>Created distribution of the plugin: [('bdist_wheel', '3.5', 'dist/demo_plugin-1.2-py3-none-any.whl')]<br>Installing plugin to temporary location<br>Requirement 'dist/demo_plugin-1.2-py3-none-any.whl' looks like a filename, but the file does not exist<br>Processing ./dist/demo_plugin-1.2-py3-none-any.whl<br>Exception:<br>Traceback (most recent call last):<br>  File "/opt/rh/rh-python35/root/usr/lib/python3.5/site-packages/pip/basecommand.py", line 215, in main<br>    status = self.run(options, args)<br>  File "/opt/rh/rh-python35/root/usr/lib/python3.5/site-packages/pip/commands/install.py", line 335, in run<br>    wb.build(autobuilding=True)<br>  File "/opt/rh/rh-python35/root/usr/lib/python3.5/site-packages/pip/wheel.py", line 749, in build<br>    self.requirement_set.prepare_files(self.finder)<br>  File "/opt/rh/rh-python35/root/usr/lib/python3.5/site-packages/pip/req/req_set.py", line 380, in prepare_files<br>    ignore_dependencies=self.ignore_dependencies))<br>  File "/opt/rh/rh-python35/root/usr/lib/python3.5/site-packages/pip/req/req_set.py", line 620, in _prepare_file<br>    session=self.session, hashes=hashes)<br>  File "/opt/rh/rh-python35/root/usr/lib/python3.5/site-packages/pip/download.py", line 809, in unpack_url<br>    unpack_file_url(link, location, download_dir, hashes=hashes)<br>  File "/opt/rh/rh-python35/root/usr/lib/python3.5/site-packages/pip/download.py", line 715, in unpack_file_url<br>    unpack_file(from_path, location, content_type, link)<br>  File "/opt/rh/rh-python35/root/usr/lib/python3.5/site-packages/pip/utils/__init__.py", line 599, in unpack_file<br>    flatten=not filename.endswith('.whl')<br>  File "/opt/rh/rh-python35/root/usr/lib/python3.5/site-packages/pip/utils/__init__.py", line 482, in unzip_file<br>    zipfp = open(filename, 'rb')<br>FileNotFoundError: [Errno 2] No such file or directory: '/tmp/plugin-sdk/examples/demo_oneagent_plugin/dist/demo_plugin-1.2-py3-none-any.whl'<br>You are using pip version 9.0.3, however version 18.1 is available.<br>You should consider upgrading via the 'pip install --upgrade pip' command.<br>Error occured: Failed to install the plugin into temporary location<br><br><br><br>

Have I done something wrong?

JP

The issue is known and has already beeen adressed since 155. Additional question - did you use build_plugin command on this particular machine before? Did it work as expected?

This is the first time I use the build_plugin command on this machine.

I’ll let you know the results of my tests when I’ll get the 155 (is it already out ?).

Regards,

JP

Not at the moment. It’s should be available at the beginning of the November.

Hi @Radoslaw J., is there yet a date in November to this 155 version?

about 6th of November

Hi, @Radoslaw S. I hope you are fine. Was the 155 released? I facing the same FileNotFoundIssue after pip downgrade to 9.0.3

Regards,

Pablo Silva