<?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: Logbak for python class in HPE Morpheus Enterprise Software</title>
    <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/logbak-for-python-class/m-p/7248829#M2003</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;
I understand the error ; this is not my problem.&lt;BR /&gt;
My problem is that i can’t see stderr nor stdout in morpheus-ui logs, and it used to work.&lt;/P&gt;
&lt;P&gt;I wanted to dump intermediate value, for example.&lt;/P&gt;</description>
    <pubDate>Fri, 14 Jun 2024 14:14:53 GMT</pubDate>
    <dc:creator />
    <dc:date>2024-06-14T14:14:53Z</dc:date>
    <item>
      <title>Logbak for python class</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/logbak-for-python-class/m-p/7248826#M2000</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
I am debugging a python script, that runs in the configuration phase of provisionning workflow. I simply want to see the standard error output in the logs.&lt;BR /&gt;
i set these loggers :&lt;/P&gt;
&lt;PRE style="background : #f0f1f2;"&gt;&lt;CODE class="lang-auto"&gt; 36     &amp;lt;logger name="com.morpheus.instance.CatalogUpdateSerice" level="ERROR"/&amp;gt;
 37     &amp;lt;logger name="com.morpheus.task.TaskService" level="DEBUG"/&amp;gt;
 38     &amp;lt;logger name="com.morpheus.task.PythonTaskService" level="DEBUG"/&amp;gt;
 39     &amp;lt;logger name="com.morpheus.task.LocalScriptTaskService" level="DEBUG"/&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but it does’nt shom me what i want. (i don’t have the error output of my script.&lt;/P&gt;
&lt;P&gt;what logger should i set to DEBUG ? i’m running 7.0.2&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 19:36:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/logbak-for-python-class/m-p/7248826#M2000</guid>
      <dc:creator />
      <dc:date>2024-06-13T19:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Logbak for python class</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/logbak-for-python-class/m-p/7248827#M2001</link>
      <description>&lt;P&gt;As Tyler mentioned, we’re using stdout to resubmit the spec data back to Morpheus during the configuration phase.  I’ve found that raising a Python exception and then exiting with a non-zero value will stop the configuration phase in it’s tracks and provide an error message to the user, which can be very helpful.&lt;/P&gt;
&lt;P&gt;In the case of debugging, I just tested outputting strings to stderr and it didn’t seem to have an effect on the spec that was output after that.  It even showed up in the Morpheus logs.  The stdout spec did not show up in the logs, and I believe that’s by design.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 15:21:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/logbak-for-python-class/m-p/7248827#M2001</guid>
      <dc:creator />
      <dc:date>2024-06-14T15:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: Logbak for python class</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/logbak-for-python-class/m-p/7248828#M2002</link>
      <description>&lt;P&gt;In that case, it’s nearly impossible to debug a script that is using morpheus context.&lt;BR /&gt;
I don’t have that problem with powershell, for wich activating the right logger prints out every information i need, including “debugging prints”.&lt;BR /&gt;
I think i’ve already achieved to have these information in a previous version of morpheus, like 6.0.x&lt;/P&gt;
&lt;P&gt;regards,&lt;BR /&gt;
Matthieu&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 06:49:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/logbak-for-python-class/m-p/7248828#M2002</guid>
      <dc:creator />
      <dc:date>2024-06-17T06:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: Logbak for python class</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/logbak-for-python-class/m-p/7248829#M2003</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
I understand the error ; this is not my problem.&lt;BR /&gt;
My problem is that i can’t see stderr nor stdout in morpheus-ui logs, and it used to work.&lt;/P&gt;
&lt;P&gt;I wanted to dump intermediate value, for example.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 14:14:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/logbak-for-python-class/m-p/7248829#M2003</guid>
      <dc:creator />
      <dc:date>2024-06-14T14:14:53Z</dc:date>
    </item>
    <item>
      <title>Re: Logbak for python class</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/logbak-for-python-class/m-p/7248830#M2004</link>
      <description>&lt;P&gt;I don’t have any output at all from the script at all :&lt;/P&gt;
&lt;PRE style="background : #f0f1f2;"&gt;&lt;CODE class="lang-auto"&gt;2024-06-13_21:19:13.38985 '[2024-06-13 21:19:13,389] [RxCachedThreadScheduler-145] INFO  c.m.t.PythonTaskService - Python Binary: /var/opt/morpheus/morpheus-local/workspace/py-7c11c562-1b15-47bb-bdbc-473d386b9
2024-06-13_21:19:13.38990 ''[2024-06-13 21:19:13,390] [RxCachedThreadScheduler-145] INFO  c.m.t.PythonTaskService - Running this script: [sudo, -S, -u, morpheus-local, /var/opt/morpheus/morpheus-local/workspacs]
2024-06-13_21:19:13.39034 ''[2024-06-13 21:19:16,218] [RxCachedThreadScheduler-145] INFO  c.m.t.PythonTaskService - Task Results for additionalPackages: [success:true, output:Collecting requests
2024-06-13_21:19:16.21900   Using cached requests-2.32.3-py3-none-any.whl (64 kB)
2024-06-13_21:19:16.21901 Collecting charset-normalizer&amp;lt;4,&amp;gt;=2
2024-06-13_21:19:16.21902   Using cached charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (142 kB)
2024-06-13_21:19:16.21903 Collecting urllib3&amp;lt;3,&amp;gt;=1.21.1
2024-06-13_21:19:16.21903   Using cached urllib3-2.2.1-py3-none-any.whl (121 kB)
2024-06-13_21:19:16.21904 Collecting idna&amp;lt;4,&amp;gt;=2.5
2024-06-13_21:19:16.21904   Using cached idna-3.7-py3-none-any.whl (66 kB)
2024-06-13_21:19:16.21905 Collecting certifi&amp;gt;=2017.4.17
2024-06-13_21:19:16.21905   Using cached certifi-2024.6.2-py3-none-any.whl (164 kB)
2024-06-13_21:19:16.21906 Installing collected packages: urllib3, idna, charset-normalizer, certifi, requests
2024-06-13_21:19:16.21907 Successfully installed certifi-2024.6.2 charset-normalizer-3.3.2 idna-3.7 requests-2.32.3 urllib3-2.2.1
2024-06-13_21:19:16.21907 , error:, process:Process[pid=816055, exitValue=0], exitValue:0, exception:null]
2024-06-13_21:19:16.21908 ''[2024-06-13 21:19:16,219] [RxCachedThreadScheduler-145] INFO  c.m.t.PythonTaskService - Executing Task vmcreation-task-createAzureRG - Python Container Scriptlet... [sudo, -S, -u, m62-1b15-47bb-bdbc-473d386b9753/bin/python, -B, -]
2024-06-13_21:19:16.21926 ''[2024-06-13 21:19:17,548] [RxCachedThreadScheduler-145] INFO  c.m.t.PythonTaskService - Executing Task vmcreation-task-createAzureRG - Python Container Scriptlet...Complete

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Jun 2024 06:43:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/logbak-for-python-class/m-p/7248830#M2004</guid>
      <dc:creator />
      <dc:date>2024-06-14T06:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: Logbak for python class</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/logbak-for-python-class/m-p/7248831#M2005</link>
      <description>&lt;P&gt;You should not need to set a logger to get standard error output from a python task.&lt;/P&gt;
&lt;P&gt;Can you post what you are seeing on your end?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 04:05:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/logbak-for-python-class/m-p/7248831#M2005</guid>
      <dc:creator>tyboyd</dc:creator>
      <dc:date>2024-06-14T04:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: Logbak for python class</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/logbak-for-python-class/m-p/7248832#M2006</link>
      <description>&lt;P&gt;Hello Tyler,&lt;BR /&gt;
In the particular case of my logs :&lt;BR /&gt;
&lt;/P&gt;&lt;DIV class="lightbox-wrapper"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/150634iE9CA5CD45C855A95/image-size/large?v=v2&amp;amp;px=2000" role="button" title="98b3808feeece26d314e4b34178a3efe90352da6.png" alt="98b3808feeece26d314e4b34178a3efe90352da6.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;As you can see, i don’t have any more information than the stacktrace. especialy my debug informations, so debbuging this is a nightmare &lt;IMG src="https://emoji.discourse-cdn.com/twitter/smiley.png?v=12" title=":smiley:" class="emoji" alt=":smiley:" loading="lazy" width="20" height="20" /&gt;&lt;/P&gt;
&lt;P&gt;Matthieu&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 13:12:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/logbak-for-python-class/m-p/7248832#M2006</guid>
      <dc:creator />
      <dc:date>2024-06-14T13:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: Logbak for python class</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/logbak-for-python-class/m-p/7248833#M2007</link>
      <description>&lt;P&gt;I see.&lt;/P&gt;
&lt;P&gt;Although it does tell you the reason for failing. You are trying to access a key in a dictionary that does not exists.&lt;/P&gt;
&lt;P&gt;KeyError:‘container’&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 13:43:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/logbak-for-python-class/m-p/7248833#M2007</guid>
      <dc:creator>tyboyd</dc:creator>
      <dc:date>2024-06-14T13:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: Logbak for python class</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/logbak-for-python-class/m-p/7248834#M2008</link>
      <description>&lt;P&gt;ha sorry, totally missed “runs in the configuration phase” in your original post. &lt;IMG src="https://emoji.discourse-cdn.com/twitter/sweat_smile.png?v=12" title=":sweat_smile:" class="emoji" alt=":sweat_smile:" loading="lazy" width="20" height="20" /&gt;&lt;/P&gt;
&lt;P&gt;I’m not aware of a way to do that, but maybe someone else knows?&lt;/P&gt;
&lt;P&gt;Not sure if that would be a capability due to the nature of the config phase. Morpheus takes the output of the task and uses that as the spec.  Meaning if you had print statements mixed it, it would break the deployment.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 15:05:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/logbak-for-python-class/m-p/7248834#M2008</guid>
      <dc:creator>tyboyd</dc:creator>
      <dc:date>2024-06-14T15:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: Logbak for python class</title>
      <link>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/logbak-for-python-class/m-p/7248835#M2009</link>
      <description>&lt;P&gt;Typically in programs, exitValue=0 means it executed successfully without any errors and exception:null shows no exception were raised. What do you see on the task when you run it?&lt;/P&gt;
&lt;P&gt;Here is a task I created that raises a error.&lt;BR /&gt;
&lt;/P&gt;&lt;DIV class="lightbox-wrapper"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/150418i933087D4B6AA30A6/image-size/large?v=v2&amp;amp;px=2000" role="button" title="7826b6e77c99f73d1561154e2990be87c4ceef8c.png" alt="7826b6e77c99f73d1561154e2990be87c4ceef8c.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;DIV class="lightbox-wrapper"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.hpe.com/t5/image/serverpage/image-id/149784i71A3921337A02288/image-size/large?v=v2&amp;amp;px=2000" role="button" title="39aa11cc6238fb7af35781c9dce975c84dca3475.png" alt="39aa11cc6238fb7af35781c9dce975c84dca3475.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Are you sure your python task is throwing a error? What does it look like if you run it outside of Morpheus?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 12:54:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-morpheus-enterprise-software/logbak-for-python-class/m-p/7248835#M2009</guid>
      <dc:creator>tyboyd</dc:creator>
      <dc:date>2024-06-14T12:54:03Z</dc:date>
    </item>
  </channel>
</rss>

