Skip to main content
Announcements
Qlik Connect 2025! Join us in Orlando join us for 3 days of immersive learning: REGISTER TODAY

REST API task is failing Intermittently with General Script Error in statement handling

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Alan_Slaughter
Support

REST API task is failing Intermittently with General Script Error in statement handling

Last Update:

Sep 23, 2024 9:40:22 AM

Updated By:

Sonja_Bauernfeind

Created date:

Aug 30, 2021 7:23:01 AM

"RestConnectorMasterTable" General Script Error in statement handling

RestConnectorMasterTable:
20200826T102106.344+0000 0088 SQL SELECT
20200826T102106.344+0000 0089 "name",
20200826T102106.344+0000 0090 "value"
20200826T102106.344+0000 0091 FROM JSON (wrap off) "contactCustomData"
20200826T102106.344+0000 0092 WITH CONNECTION (
20200826T102106.344+0000 0093 URL "      ",
20200826T102106.344+0000 0094 HTTPHEADER "Authorization" "**Token removed for security purpose**"
20200826T102106.344+0000 0095 )
20200826T102106.967+0000 General Script Error in statement handling
20200826T102106.982+0000 Execution Failed
20200826T102106.986+0000 Execution finished.

 

Environment

Qlik Sense Enterprise on Windows  

 

Resolution

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
Error variables 
Script control statements 

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.

A sample script is located here, but further options can be added from the Help links already provided.
Qlik-Sense-fail-and-retry-connection-sample-script 

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.
Best-Practice-Error-Handling-in-Script 

 

Cause 

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.

 

Internal Investigation ID(s) 

QB-3164

Labels (1)
Comments
pablolabbe
Partner Ambassador

Do the internal investigation of this issue finished ? QB-3164

Sonja_Bauernfeind
Digital Support

Hello @pablolabbe 

The Internal Investigation in this case has led to the resolution mentioned in this article.  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.

All the best,
Sonja 

Huberto_Computop
Partner - Contributor II

Hi @Alan_Slaughter,

I am still facing the same problem even after implementing the loop and controlling the script behavior using the ErrorMode variable. From time to time, I get the "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.

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.

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?

Thank you for your attention.

Regards,

Huberto

Visual_Intelligence_Support
Partner - Contributor

Same issue, never resolved. Happened at random places when loading data from API in QlikView.

Huberto_Computop
Partner - Contributor II

Thanks, @Visual_Intelligence_Support.

What do you do when such an error happens? Do trigger the reports manually or did you find an alternative automatic solution?

Regards,

Huberto