<?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: RemotePlugin Python 3.8 included Runtime limitation in Extensions</title>
    <link>https://community.dynatrace.com/t5/Extensions/RemotePlugin-Python-3-8-included-Runtime-limitation/m-p/189336#M2278</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/3364"&gt;@Julius_Loman&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;yes I'm now overwriting two platform methods in my own plugin code. I will make this a good practice in case my plugins include some third party library that eventually would use those:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;'''
overwriting platform functions that are used by a 3rd party library
but fail on embedded python
'''
platform.platform = lambda: "Dynatrace Active Gate Plugin"
platform.python_version = lambda: "3.8.0 (embedded)"&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 28 Jun 2022 08:50:53 GMT</pubDate>
    <dc:creator>r_weber</dc:creator>
    <dc:date>2022-06-28T08:50:53Z</dc:date>
    <item>
      <title>RemotePlugin Python 3.8 included Runtime limitation</title>
      <link>https://community.dynatrace.com/t5/Extensions/RemotePlugin-Python-3-8-included-Runtime-limitation/m-p/189235#M2268</link>
      <description>&lt;P&gt;Hello Plugin Developers!,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've recently developed a plugin (AG 1.0) that depends on another 3rd party library (pyexasol). When executing this plugin on a Linux AG with NO system-wide python installation the plugin will fail with this error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;2022-06-23 13:45:04.009 UTC ERROR   [Python][14869391503175389801][][140106916681472][ThreadPoolExecutor-0_12] - [query] Traceback (most recent call last):
  File "/opt/dynatrace/remotepluginmodule/plugin_deployment/custom.remote.python.exasol/dynatrace_activegate_exasol_plugin.py", line 66, in query
    db = pyexasol.connect(dsn=self.connectionstring, user=self.username, password=self.password, encryption=True, fetch_dict=True, websocket_sslopt={'cert_reqs': ssl.CERT_NONE})
  File "/opt/dynatrace/remotepluginmodule/plugin_deployment/custom.remote.python.exasol/pyexasol/__init__.py", line 68, in connect
    return ExaConnection(**kwargs)
  File "/opt/dynatrace/remotepluginmodule/plugin_deployment/custom.remote.python.exasol/pyexasol/connection.py", line 186, in __init__
    self._login()
  File "/opt/dynatrace/remotepluginmodule/plugin_deployment/custom.remote.python.exasol/pyexasol/connection.py", line 601, in _login
    'clientOs': platform.platform(),
  File "/opt/dynatrace/remotepluginmodule/agent/plugin/python3.8/platform.py", line 1206, in platform
    libcname, libcversion = libc_ver(sys.executable)
  File "/opt/dynatrace/remotepluginmodule/agent/plugin/python3.8/platform.py", line 193, in libc_ver
    with open(executable, 'rb') as f:
IsADirectoryError: [Errno 21] Is a directory: '/opt/dynatrace/remotepluginmodule/agent/lib64'&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basically what happens is that the external library at some point calls &lt;STRONG&gt;sys.executable&lt;/STRONG&gt; to get the python interpreter binary path (for whatever reason) and some python meta-information.&lt;/P&gt;
&lt;P&gt;In case there is no python installed it seems that this call returns a path to the remoteplugin library directory and then fails with with IsADirectoryError when trying to determine the libc version.&lt;BR /&gt;&lt;BR /&gt;My guess is that this has to do how the runtime is called/embedded within the remotepluginmodule. Does anyone with some knowledge around the embedded python is doing this know why this would happen and how this could be prevented?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 05:27:30 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/RemotePlugin-Python-3-8-included-Runtime-limitation/m-p/189235#M2268</guid>
      <dc:creator>r_weber</dc:creator>
      <dc:date>2022-06-28T05:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: RemotePlugin Python 3.8 included Runtime limitation</title>
      <link>https://community.dynatrace.com/t5/Extensions/RemotePlugin-Python-3-8-included-Runtime-limitation/m-p/189238#M2269</link>
      <description>&lt;P&gt;Based on your stacktrace it fails in the call:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;platform.platform()&lt;/LI-CODE&gt;&lt;P&gt;and that should provide you with the platform info.&lt;BR /&gt;&lt;BR /&gt;Basically,&amp;nbsp;I think you can&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;overwrite the platform.platform() method before initializing the pyexasol library to return some dummy string and perhaps nobody notices, since the method does not work either (easy / should work immediately)&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;remove that call in the pyexasol library (you will need to fork it - not ideal solution)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;open a support ticket&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/SPAN&gt;&amp;nbsp;(not sure about the outcome)&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Mon, 27 Jun 2022 12:17:26 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/RemotePlugin-Python-3-8-included-Runtime-limitation/m-p/189238#M2269</guid>
      <dc:creator>Julius_Loman</dc:creator>
      <dc:date>2022-06-27T12:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: RemotePlugin Python 3.8 included Runtime limitation</title>
      <link>https://community.dynatrace.com/t5/Extensions/RemotePlugin-Python-3-8-included-Runtime-limitation/m-p/189297#M2270</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/3364"&gt;@Julius_Loman&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Overwriting the platform.platform() method is a good idea and simple enough in the plugin code.&lt;BR /&gt;Though I'm still eager to understand how the python interpreter is loaded by the AG so that this call is actually not possible/fails. If python can be loaded/executed that way, then it should be also safe to use something like platform.platform() or sys.executable. IMO thats something that python itself should take care of or the one (Dynatrace) that embeds python?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 21:43:36 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/RemotePlugin-Python-3-8-included-Runtime-limitation/m-p/189297#M2270</guid>
      <dc:creator>r_weber</dc:creator>
      <dc:date>2022-06-27T21:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: RemotePlugin Python 3.8 included Runtime limitation</title>
      <link>https://community.dynatrace.com/t5/Extensions/RemotePlugin-Python-3-8-included-Runtime-limitation/m-p/189309#M2271</link>
      <description>&lt;P&gt;The python interpreter is just embedded in the &lt;SPAN&gt;oneagentremoteplugin binary.&amp;nbsp;I'm not familiar with the details, but this looks like a bug in the python interpreter itself when running embedded (or bug with the version Dynatrace is using).&lt;BR /&gt;&lt;BR /&gt;Please report back if the workaround with overwriting the method worked for you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2022 06:18:58 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/RemotePlugin-Python-3-8-included-Runtime-limitation/m-p/189309#M2271</guid>
      <dc:creator>Julius_Loman</dc:creator>
      <dc:date>2022-06-28T06:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: RemotePlugin Python 3.8 included Runtime limitation</title>
      <link>https://community.dynatrace.com/t5/Extensions/RemotePlugin-Python-3-8-included-Runtime-limitation/m-p/189336#M2278</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/3364"&gt;@Julius_Loman&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;yes I'm now overwriting two platform methods in my own plugin code. I will make this a good practice in case my plugins include some third party library that eventually would use those:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;'''
overwriting platform functions that are used by a 3rd party library
but fail on embedded python
'''
platform.platform = lambda: "Dynatrace Active Gate Plugin"
platform.python_version = lambda: "3.8.0 (embedded)"&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 28 Jun 2022 08:50:53 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/RemotePlugin-Python-3-8-included-Runtime-limitation/m-p/189336#M2278</guid>
      <dc:creator>r_weber</dc:creator>
      <dc:date>2022-06-28T08:50:53Z</dc:date>
    </item>
  </channel>
</rss>

