<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Python plugin can't load os library in Extensions</title>
    <link>https://community.dynatrace.com/t5/Extensions/Python-plugin-can-t-load-os-library/m-p/127263#M1373</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I figured out, extension modules have to be placed under the plugin directory, the plugin environment doesn't recognise anything outsidde, e.g environ variables, CLASSPATH, PATH, DL_LIBRARY_PATH...&lt;/P&gt;&lt;P&gt;After copying the .so library to plugin folder, it is able to find it and move forward. Now I'm facing the next issue, it hangs while trying to start JVM or attach current thread to running JVM.&lt;/P&gt;</description>
    <pubDate>Fri, 14 Feb 2020 06:47:21 GMT</pubDate>
    <dc:creator>laura_lu</dc:creator>
    <dc:date>2020-02-14T06:47:21Z</dc:date>
    <item>
      <title>Python plugin can't load os library</title>
      <link>https://community.dynatrace.com/t5/Extensions/Python-plugin-can-t-load-os-library/m-p/127260#M1370</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm building a python plugin to connect remote azure db from ubuntu docker container, I'm using a python module py2jdbc as a bridge between python and java, during initialisation, this module searches for jvm library libjvm.so then pass the full lib path to ctypes CDLL method to attach jvm.&lt;/P&gt;&lt;P&gt;The problem I'm facing is as shown in below log, the libjvm.so exists but the plugin just can't find it.&lt;/P&gt;&lt;P&gt;Log:&lt;/P&gt;&lt;P&gt;File "/opt/dynatrace/oneagent/agent/conf/runtime/engine_unpacked/ruxit/plugin_state_machine.py", line 301, in _execute_next_task&lt;/P&gt;&lt;P&gt;self._query_plugin()&lt;/P&gt;&lt;P&gt;File "/opt/dynatrace/oneagent/agent/conf/runtime/engine_unpacked/ruxit/plugin_state_machine.py", line 607, in _query_plugin&lt;/P&gt;&lt;P&gt;self._plugin_run_data.plugin_instance._query_internal(**self._plugin_run_data.plugin_args)&lt;/P&gt;&lt;P&gt;File "/opt/dynatrace/oneagent/agent/conf/runtime/engine_unpacked/ruxit/api/base_plugin.py", line 354, in _query_internal&lt;/P&gt;&lt;P&gt;return self.query(**kwargs)&lt;/P&gt;&lt;P&gt;File "/opt/dynatrace/oneagent/plugin_deployment/custom.python.azure_db99_plugin/azure_db99_plugin.py", line 25, in query&lt;/P&gt;&lt;P&gt;import py2jdbc&lt;/P&gt;&lt;P&gt;File "/opt/dynatrace/oneagent/plugin_deployment/custom.python.azure_db99_plugin/py2jdbc/__init__.py", line 2, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;from py2jdbc.dbi import (&lt;/P&gt;&lt;P&gt;File "/opt/dynatrace/oneagent/plugin_deployment/custom.python.azure_db99_plugin/py2jdbc/dbi.py", line 6, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;from py2jdbc.wrap import get_env&lt;/P&gt;&lt;P&gt;File "/opt/dynatrace/oneagent/plugin_deployment/custom.python.azure_db99_plugin/py2jdbc/wrap.py", line 4, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;import py2jdbc.jni&lt;/P&gt;&lt;P&gt;File "/opt/dynatrace/oneagent/plugin_deployment/custom.python.azure_db99_plugin/py2jdbc/jni.py", line 2619, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;libjvm = CDLL('/usr/java/sapjvm_8/jre/lib/amd64/server/libjvm.so')&lt;/P&gt;&lt;P&gt;File "/opt/dynatrace/oneagent/agent/plugin/python3.6/ctypes/__init__.py", line 349, in __init__&lt;/P&gt;&lt;P&gt;self._handle = _dlopen(self._name, mode)&lt;/P&gt;&lt;P&gt;OSError: /usr/java/sapjvm_8/jre/lib/amd64/server/libjvm.so: cannot open shared object file: No such file or directory&lt;/P&gt;&lt;P&gt;),&lt;/P&gt;&lt;P&gt;Above file indeed exist:&lt;/P&gt;&lt;P&gt;# ls -ltr /usr/java/sapjvm_8/jre/lib/amd64/server/libjvm.so&lt;/P&gt;&lt;P&gt;-rwxr-xr-x 1 root root 28025240 Jul 23 2019 /usr/java/sapjvm_8/jre/lib/amd64/server/libjvm.so&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;As a comparison, I tested in a self installed python3.6 env also in a ubuntu container, it works. I wonder if this is a problem with the oneagent built-in python env?&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Laura&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 08:22:17 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Python-plugin-can-t-load-os-library/m-p/127260#M1370</guid>
      <dc:creator>laura_lu</dc:creator>
      <dc:date>2020-02-12T08:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Python plugin can't load os library</title>
      <link>https://community.dynatrace.com/t5/Extensions/Python-plugin-can-t-load-os-library/m-p/127261#M1371</link>
      <description>&lt;P&gt;Does dtuser (which is used to execute plugins) have access to the directory/file?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 08:55:17 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Python-plugin-can-t-load-os-library/m-p/127261#M1371</guid>
      <dc:creator>Mike_L</dc:creator>
      <dc:date>2020-02-12T08:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: Python plugin can't load os library</title>
      <link>https://community.dynatrace.com/t5/Extensions/Python-plugin-can-t-load-os-library/m-p/127262#M1372</link>
      <description>&lt;P&gt;As Michael said, if your plugin is trying to reach this library, and you're sure that this file exists in filesystem, then next question will be about permissions for dtuser. You may need to add dtuser to proper group on OS level to make it work. &lt;/P&gt;&lt;P&gt;Sebastian &lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 11:49:41 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Python-plugin-can-t-load-os-library/m-p/127262#M1372</guid>
      <dc:creator>skrystosik</dc:creator>
      <dc:date>2020-02-12T11:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: Python plugin can't load os library</title>
      <link>https://community.dynatrace.com/t5/Extensions/Python-plugin-can-t-load-os-library/m-p/127263#M1373</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I figured out, extension modules have to be placed under the plugin directory, the plugin environment doesn't recognise anything outsidde, e.g environ variables, CLASSPATH, PATH, DL_LIBRARY_PATH...&lt;/P&gt;&lt;P&gt;After copying the .so library to plugin folder, it is able to find it and move forward. Now I'm facing the next issue, it hangs while trying to start JVM or attach current thread to running JVM.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Feb 2020 06:47:21 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/Python-plugin-can-t-load-os-library/m-p/127263#M1373</guid>
      <dc:creator>laura_lu</dc:creator>
      <dc:date>2020-02-14T06:47:21Z</dc:date>
    </item>
  </channel>
</rss>

