<?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: &amp;quot;Heartbeat failed because Expecting value&amp;quot; Exception Handling in Extensions</title>
    <link>https://community.dynatrace.com/t5/Extensions/quot-Heartbeat-failed-because-Expecting-value-quot-Exception/m-p/291965#M6955</link>
    <description>&lt;P&gt;It will be hard to help without the extension code, basically scheduled methods have a status that can be optionally reported, it looks like one of your scheduled methods might not be correctly created our you are using an old version of the SDK with a new OA/AG.&lt;/P&gt;</description>
    <pubDate>Sat, 20 Dec 2025 04:24:23 GMT</pubDate>
    <dc:creator>david_lopes</dc:creator>
    <dc:date>2025-12-20T04:24:23Z</dc:date>
    <item>
      <title>"Heartbeat failed because Expecting value" Exception Handling</title>
      <link>https://community.dynatrace.com/t5/Extensions/quot-Heartbeat-failed-because-Expecting-value-quot-Exception/m-p/285258#M6696</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I created a &lt;STRONG&gt;custom Dynatrace Extension&lt;/STRONG&gt; using APIs ingesting data from one system into Dynatrace BizEvents, based on a custom scheduler. The execution of data ingestion take few minutes exceeding the regular 60 seconds/1 minute, that is set to execute query method. The executions of the process based on the schedule are successful. Checking the logs from &lt;STRONG&gt;&lt;EM&gt;python3.log&lt;/EM&gt;&lt;/STRONG&gt; file, I notice sometimes I am getting an exception from executing the _heartbeat method from the SDK module &lt;EM&gt;extension.py&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;/var/lib/dynatrace/remotepluginmodule/agent/runtime/extensions/python_venvs/custom_&amp;lt;custom_extension_name&amp;gt;_0.0.8/lib/python3.10/site-packages/dynatrace_extension/sdk/extension.py&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;First, it starts with an error&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;Error HTTP 400 from &lt;A href="http://127.0.0.1:14599/alive" target="_blank" rel="noopener"&gt;http://127.0.0.1:14599/alive&lt;/A&gt;&lt;/STRONG&gt;/-5515299317920783049: b'Bad Request - unable to parse status&lt;/EM&gt;&lt;BR /&gt;and continues with another&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;Heartbeat failed because Expecting value&lt;/STRONG&gt;: line 1 column 1 (char 0), response b'not set'&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;As it can be seen in the screenshot the exceptions are triggered by different thread executor&amp;nbsp;&lt;EM&gt;ThreadPoolExecutor-0_2&lt;/EM&gt;, than the one executes the process&amp;nbsp;&lt;EM&gt;ThreadPoolExecutor-0_0&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Below is the code of &lt;EM&gt;fastcheck&lt;/EM&gt; method, nothing particular:&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;def fastcheck(self) -&amp;gt; Status:&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;EM&gt;"""&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Use to check if the extension can run.&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;If this Activegate cannot run this extension, you can&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;raise an Exception or return StatusValue.ERROR.&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;This does not run for OneAgent extensions.&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;"""&lt;/EM&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;&amp;nbsp; return Status(StatusValue.OK, "Fastcheck - TODO:: Check the connections.")&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Screenshot of logs&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="chris_cho_0-1756835550229.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/29919i46F7C1AF5E7C74D0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="chris_cho_0-1756835550229.png" alt="chris_cho_0-1756835550229.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Screenshot of the extension.py _heartbeat method&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="chris_cho_1-1756838166926.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/29921iF0DB09D8E02F1A5B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="chris_cho_1-1756838166926.png" alt="chris_cho_1-1756838166926.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Please let me know if you have any thoughts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2025 10:13:52 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/quot-Heartbeat-failed-because-Expecting-value-quot-Exception/m-p/285258#M6696</guid>
      <dc:creator>chris_cho</dc:creator>
      <dc:date>2025-09-04T10:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: "Heartbeat failed because Expecting value" Exception Handling</title>
      <link>https://community.dynatrace.com/t5/Extensions/quot-Heartbeat-failed-because-Expecting-value-quot-Exception/m-p/291965#M6955</link>
      <description>&lt;P&gt;It will be hard to help without the extension code, basically scheduled methods have a status that can be optionally reported, it looks like one of your scheduled methods might not be correctly created our you are using an old version of the SDK with a new OA/AG.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Dec 2025 04:24:23 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Extensions/quot-Heartbeat-failed-because-Expecting-value-quot-Exception/m-p/291965#M6955</guid>
      <dc:creator>david_lopes</dc:creator>
      <dc:date>2025-12-20T04:24:23Z</dc:date>
    </item>
  </channel>
</rss>

