<?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>article REST API task is failing Intermittently with General Script Error in statement handling in Official Support Articles</title>
    <link>https://community.qlik.com/t5/Official-Support-Articles/REST-API-task-is-failing-Intermittently-with-General-Script/ta-p/1830912</link>
    <description>&lt;P&gt;"RestConnectorMasterTable" General Script Error in statement handling&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;RestConnectorMasterTable:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;20200826T102106.344+0000 0088 SQL SELECT &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;20200826T102106.344+0000 0089 "name",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;20200826T102106.344+0000 0090 "value"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;20200826T102106.344+0000 0091 FROM JSON (wrap off) "contactCustomData"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;20200826T102106.344+0000 0092 WITH CONNECTION ( &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;20200826T102106.344+0000 0093 URL "&amp;nbsp; &amp;nbsp; &amp;nbsp; ",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;20200826T102106.344+0000 0094 HTTPHEADER "Authorization" "**Token removed for security purpose**"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;20200826T102106.344+0000 0095 )&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;20200826T102106.967+0000 General Script Error in statement handling&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;20200826T102106.982+0000 Execution Failed&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;20200826T102106.986+0000 Execution finished.&lt;/FONT&gt;&lt;/P&gt;
&lt;H4&gt;&amp;nbsp;&lt;/H4&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Environment&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;LI-PRODUCT title="Qlik Sense Enterprise on Windows" id="qlikSenseEnterpriseWindows"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Resolution&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;To be able to catch the exact error and mitigate the issue they need to apply our recommended best practices for error handling in Qlik scripting using the Error variables &lt;BR /&gt;&lt;A href="https://help.qlik.com/en-US/sense/May2021/Subsystems/Hub/Content/Sense_Hub/Scripting/ErrorVariables/ErrorVariables.htm" target="_self"&gt;Error variables&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;A href="https://help.qlik.com/en-US/sense/May2021/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptControlStatements/script-control-statements.htm" target="_self"&gt;Script control statements&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Set to ErrorMode=0 it will ignore any errors and continue with the script. You can use the IF statement to retry the connection or move to another connection for a few attempts and then it will change it to ErrorMode=1 and fail or just disconnect on its own.&lt;/P&gt;
&lt;P&gt;A sample script is located here, but further options can be added from the Help links already provided.&lt;BR /&gt;&lt;A href="https://community.qlik.com/t5/Knowledge/Qlik-Sense-fail-and-retry-connection-sample-script/ta-p/1710508" target="_self"&gt;Qlik-Sense-fail-and-retry-connection-sample-script&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: QlikView scripting is the same in these functions for Qlik Sense unless otherwise stated, but there are some very helpful items in the links.&lt;BR /&gt;&lt;A href="https://community.qlik.com/t5/New-to-Qlik-Sense/Best-Practice-Error-Handling-in-Script/td-p/1757249" target="_self"&gt;Best-Practice-Error-Handling-in-Script&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Cause&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;Error with the fetch of the token with the rest call. If the number of rows in a table doesn't match or is less than expected, trigger the script to throw an error and have it try to load the table again for more records, or if the count is off, do a Loop until returns the correct number.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Internal Investigation ID(s)&amp;nbsp;&lt;/H3&gt;
&lt;P&gt;QB-3164&lt;/P&gt;</description>
    <pubDate>Mon, 23 Sep 2024 13:40:22 GMT</pubDate>
    <dc:creator>Alan_Slaughter</dc:creator>
    <dc:date>2024-09-23T13:40:22Z</dc:date>
    <item>
      <title>REST API task is failing Intermittently with General Script Error in statement handling</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/REST-API-task-is-failing-Intermittently-with-General-Script/ta-p/1830912</link>
      <description>&lt;P&gt;"RestConnectorMasterTable" General Script Error in statement handling&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;RestConnectorMasterTable:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;20200826T102106.344+0000 0088 SQL SELECT &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;20200826T102106.344+0000 0089 "name",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;20200826T102106.344+0000 0090 "value"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;20200826T102106.344+0000 0091 FROM JSON (wrap off) "contactCustomData"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;20200826T102106.344+0000 0092 WITH CONNECTION ( &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;20200826T102106.344+0000 0093 URL "&amp;nbsp; &amp;nbsp; &amp;nbsp; ",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;20200826T102106.344+0000 0094 HTTPHEADER "Authorization" "**Token removed for security purpose**"&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;20200826T102106.344+0000 0095 )&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;20200826T102106.967+0000 General Script Error in statement handling&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;20200826T102106.982+0000 Execution Failed&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;20200826T102106.986+0000 Execution finished.&lt;/FONT&gt;&lt;/P&gt;
&lt;H4&gt;&amp;nbsp;&lt;/H4&gt;
&lt;H4&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Environment&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;LI-PRODUCT title="Qlik Sense Enterprise on Windows" id="qlikSenseEnterpriseWindows"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Resolution&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;To be able to catch the exact error and mitigate the issue they need to apply our recommended best practices for error handling in Qlik scripting using the Error variables &lt;BR /&gt;&lt;A href="https://help.qlik.com/en-US/sense/May2021/Subsystems/Hub/Content/Sense_Hub/Scripting/ErrorVariables/ErrorVariables.htm" target="_self"&gt;Error variables&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;A href="https://help.qlik.com/en-US/sense/May2021/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptControlStatements/script-control-statements.htm" target="_self"&gt;Script control statements&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Set to ErrorMode=0 it will ignore any errors and continue with the script. You can use the IF statement to retry the connection or move to another connection for a few attempts and then it will change it to ErrorMode=1 and fail or just disconnect on its own.&lt;/P&gt;
&lt;P&gt;A sample script is located here, but further options can be added from the Help links already provided.&lt;BR /&gt;&lt;A href="https://community.qlik.com/t5/Knowledge/Qlik-Sense-fail-and-retry-connection-sample-script/ta-p/1710508" target="_self"&gt;Qlik-Sense-fail-and-retry-connection-sample-script&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: QlikView scripting is the same in these functions for Qlik Sense unless otherwise stated, but there are some very helpful items in the links.&lt;BR /&gt;&lt;A href="https://community.qlik.com/t5/New-to-Qlik-Sense/Best-Practice-Error-Handling-in-Script/td-p/1757249" target="_self"&gt;Best-Practice-Error-Handling-in-Script&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Cause&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;Error with the fetch of the token with the rest call. If the number of rows in a table doesn't match or is less than expected, trigger the script to throw an error and have it try to load the table again for more records, or if the count is off, do a Loop until returns the correct number.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3&gt;Internal Investigation ID(s)&amp;nbsp;&lt;/H3&gt;
&lt;P&gt;QB-3164&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2024 13:40:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/REST-API-task-is-failing-Intermittently-with-General-Script/ta-p/1830912</guid>
      <dc:creator>Alan_Slaughter</dc:creator>
      <dc:date>2024-09-23T13:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: REST API task is failing Intermittently with General Script Error in statement handling</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/REST-API-task-is-failing-Intermittently-with-General-Script/tac-p/2480127#M14535</link>
      <description>&lt;P&gt;Do the internal investigation of this issue finished ?&amp;nbsp;&lt;SPAN&gt;QB-3164&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 11:37:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/REST-API-task-is-failing-Intermittently-with-General-Script/tac-p/2480127#M14535</guid>
      <dc:creator>pablolabbe</dc:creator>
      <dc:date>2024-09-06T11:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: REST API task is failing Intermittently with General Script Error in statement handling</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/REST-API-task-is-failing-Intermittently-with-General-Script/tac-p/2483026#M14629</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6144"&gt;@pablolabbe&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Internal Investigation in this case has led to the resolution mentioned in this article.&amp;nbsp; If you need additional investigation being done or are experiencing a server issue that you identified as a defect, I recommend to log a ticket with Support.&lt;/P&gt;
&lt;P&gt;All the best,&lt;BR /&gt;Sonja&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2024 13:39:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/REST-API-task-is-failing-Intermittently-with-General-Script/tac-p/2483026#M14629</guid>
      <dc:creator>Sonja_Bauernfeind</dc:creator>
      <dc:date>2024-09-23T13:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: REST API task is failing Intermittently with General Script Error in statement handling</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/REST-API-task-is-failing-Intermittently-with-General-Script/tac-p/2506650#M15411</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/8511"&gt;@Alan_Slaughter&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I am still facing the same problem even after implementing the loop and controlling the script behavior using the &lt;SPAN class="script_token"&gt;ErrorMode&lt;/SPAN&gt; variable.&amp;nbsp;From time to time, I get the &lt;SPAN class="lia-message-unread lia-message-unread-windows"&gt;"General Script Error in statement handling" message from the Qlik Sense app that triggers the QNP REST API methods and the script does not stop as expected.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-message-unread lia-message-unread-windows"&gt;So far, I haven't figured out a robust and resilient solution via Qlik script. Even though it works for other use cases when I force an error.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-message-unread lia-message-unread-windows"&gt;Could please shed some light on this topic and provide me and the Qlik Community with the potential causes of this issue and what to solve it via Qlik script?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-message-unread lia-message-unread-windows"&gt;Thank you for your attention.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-message-unread lia-message-unread-windows"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-message-unread lia-message-unread-windows"&gt;Huberto&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2025 16:34:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/REST-API-task-is-failing-Intermittently-with-General-Script/tac-p/2506650#M15411</guid>
      <dc:creator>Huberto_Computop</dc:creator>
      <dc:date>2025-02-19T16:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: REST API task is failing Intermittently with General Script Error in statement handling</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/REST-API-task-is-failing-Intermittently-with-General-Script/tac-p/2512693#M15635</link>
      <description>&lt;P&gt;Same issue, never resolved. Happened at random places when loading data from API in QlikView.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2025 07:57:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/REST-API-task-is-failing-Intermittently-with-General-Script/tac-p/2512693#M15635</guid>
      <dc:creator>Visual_Intelligence_Support</dc:creator>
      <dc:date>2025-04-02T07:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: REST API task is failing Intermittently with General Script Error in statement handling</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/REST-API-task-is-failing-Intermittently-with-General-Script/tac-p/2512697#M15638</link>
      <description>&lt;P&gt;Thanks, &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/144371"&gt;@Visual_Intelligence_Support&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;What do you do when such an error happens? Do trigger the reports manually or did you find an alternative automatic solution?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Huberto&lt;/P&gt;</description>
      <pubDate>Wed, 02 Apr 2025 08:05:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/REST-API-task-is-failing-Intermittently-with-General-Script/tac-p/2512697#M15638</guid>
      <dc:creator>Huberto_Computop</dc:creator>
      <dc:date>2025-04-02T08:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: REST API task is failing Intermittently with General Script Error in statement handling</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/REST-API-task-is-failing-Intermittently-with-General-Script/tac-p/2537284#M16595</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/200306"&gt;@Huberto_Computop&lt;/a&gt;&amp;nbsp;did you manage to find a solution to this issue?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Nov 2025 08:36:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/REST-API-task-is-failing-Intermittently-with-General-Script/tac-p/2537284#M16595</guid>
      <dc:creator>francesco_menin</dc:creator>
      <dc:date>2025-11-26T08:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: REST API task is failing Intermittently with General Script Error in statement handling</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/REST-API-task-is-failing-Intermittently-with-General-Script/tac-p/2537285#M16596</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/42759"&gt;@francesco_menin&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Yes, I did it. Simply said, you need to have one Qlik Sense task that triggers one specific Qlik NPrinting task. This QS task has to be set to Max Retries 5 or 10, as you like to retry the QNP task execution.&lt;/P&gt;&lt;P&gt;You need to have this 1:1 (QS task - QNP task) to make sure that when your QS task fails, retrying it won't send out reports that were already dispatched.&lt;/P&gt;&lt;P&gt;The trick here is my QS app name, which looks like this:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;QNP_Smart_Report_Daily -&amp;gt; Main app where the visualizations are developed and will be used by QNP to create the reports.&lt;/LI&gt;&lt;LI&gt;QNP_Smart_Report_Daily~Metadata_Reload -&amp;gt; Dedicated task created to run the metadata load only. I always run it before the reports, and it has a specific logic not to trigger the reports before the metadata load is finished.&lt;/LI&gt;&lt;LI&gt;QNP_Smart_Report_Daily~Transaction_Report_en-US_Daily_EXCELtoFTP -&amp;gt; It triggers the&amp;nbsp;Transaction_Report_en-US_Daily_EXCELtoFTP QNP task. Output Excel file to sFTP.&lt;/LI&gt;&lt;LI&gt;QNP_Smart_Report_Daily~Transaction_Report_en-US_Daily_CSVtoFTP&amp;nbsp;-&amp;gt; It triggers the Transaction_Report_en-US_Daily_CSVtoFTP QNP task. Output CSV file to sFTP.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Here is the trick. The&amp;nbsp;~ is the delimiter for the QNP App Name (first part in the app name before the ~), and the second part is the QNP Task Name.&lt;/P&gt;&lt;P&gt;This way, using the QS app name, you can "send" parameters to your QS app script and build a generic script.&lt;/P&gt;&lt;P&gt;It might be difficult to grasp all the details with such a simple explanation, but I can assure you there is a solution for this, not as elegant as I expected, but when if structured, it works well and gives you a lot of flexibility.&lt;/P&gt;&lt;P&gt;Let me know if I can be of any help or if you're able to figure out the whole picture.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Huberto&lt;/P&gt;</description>
      <pubDate>Wed, 26 Nov 2025 09:02:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/REST-API-task-is-failing-Intermittently-with-General-Script/tac-p/2537285#M16596</guid>
      <dc:creator>Huberto_Computop</dc:creator>
      <dc:date>2025-11-26T09:02:10Z</dc:date>
    </item>
  </channel>
</rss>

