
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
HTTP protocol error 500
Hi ,
I have an nprinting trigger application in Qliksense app and this application gives this error once a week: Error: HTTP protocol error 500 (Internal Server Error). I couldn't find the reason, I would be very happy if you could help me.
20240925T072007.786+0300 Error: HTTP protocol error 500 (Internal Server Error):
20240925T072007.786+0300
20240925T072007.786+0300 An unhandled exception occurred; check the log for more information.
20240925T072007.788+0300 Execution Failed
20240925T072007.798+0300 Execution finished.
Versions:
Qliksense May 2024
Nprinting Feb2024 SR2
Best Regards
- « Previous Replies
-
- 1
- 2
- Next Replies »
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @krmvacar
Answering above points:
point 2 - Checking timeout. I suggest to increase to value between 30-300 if necessary
point 4 - Whitelisting In NPrinting: Admin --> Settings --> OnDemand all possible combinations of Qlik Sense server addresses
point 5 - absolutely, should be added as per point 4. Then in connection POST Method configuration you would have:
for i=1 to FieldValueCount('TASKID')
LIB CONNECT TO 'REST_Nprinting_POST;
let vPublshTaskURL = 'https://*********/api/v1/tasks/'&FieldValue('TASKID',$(i))&'/executions';
SQL SELECT
"__KEY_data"
FROM JSON (wrap off) "data" PK "__KEY_data"
WITH CONNECTION( URL "$(vPublshTaskURL)", HTTPHEADER "cookie" "$(vCookie)");
Sleep(30000);
next

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @krmvacar, I will be more than happy to help, but...
What is the script you are executing? I wrote whole library (NPrinting.qvs) and I handle connection and authentication almost each time I trigger API call https://nprintingadventures.com/2019/04/08/nprinting-api-qlik-rest-subroutines/ .
In this case we dont know what you are trying to do, how you have configured your GET and POST connections, what user you are using, how you handle cookies, how often you trigger your API calls, how busy is your server (Qlik Sense and NPrinting) etc... We just know that you got an error when trying to connect to NPrinting.
I will say - I am not getting such error, so there is something in your script or environment what is configured differently. What is it? We need more info from you to be able to help.
cheers

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Lech_Miszkiewicz ,
Thank you for reply,
Of course I can give more information.
For login NP
***********************************************************************
LIB CONNECT TO 'REST_Nprinting_GET ;
RestConnectorMasterTable:
SQL SELECT
"Set-Cookie",
"__KEY__response_header"
FROM JSON "_response_header" PK "__KEY__response_header";
[_response_header]:
LOAD [Set-Cookie] AS [Set-Cookie]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__KEY__response_header]);
Let vCookieRaw = Peek('Set-Cookie',0,'cookie_items');
Let vCookie = TextBetween(vCookieRaw,'SameSite=None,',' Path=/',SubStringCount(vCookieRaw,'SameSite=None')-1);
DROP TABLE RestConnectorMasterTable;
*******************************************************************************
POST method
TASKID:
load * inline [
TASKID
1900693b-6d89-4eb1-bd19-b8ee6d22c0c2
5fc70910-2ase-49af-b3b5-efa4c30a5fd2
8f5b1d2b-7afd-4c6d-9ef3-7c9838fb743e ];
for i=1 to FieldValueCount('TASKID')
let vPublshTaskURL = 'https://*********/api/v1/tasks/'&FieldValue('TASKID',$(i))&'/executions';
SQL SELECT
"__KEY_data"
FROM JSON (wrap off) "data" PK "__KEY_data"
WITH CONNECTION( URL "$(vPublshTaskURL)", HTTPHEADER "cookie" "$(vCookie)");
Sleep(30000);
next
************************************************************************************************************
Task runs on qliksense every morning at 7am
Thank you so much

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @krmvacar
In short you are using:
- GET method
- to get a cookie
- "POST method" - although I dont see connection (Lib Connection POST) !!! - to run:
- run 1st task & wait 30 seconds
- run 2nd task & wait 30 seconds
- run 3rd task & wait 30 seconds
Questions:
- At which stage do you get an error? Is this during the GET method or POST method (which attempt)?
- What are the timeout settings on your connections?
- What are the workoads on the servers at that time - is it possible that there are many things reloading/running /executing and there is not enough time to get response in time?
- Do you have your Origins whitelisted (IPs, Hostnames and FQDNs)?
- Do you specify Origins in your headers?
- Are you having both servers in the same regional settings?
- What account are you using to run this?
- Do you have dedicated different service accounts for Qlik Sense and NPrinting services?
Having a full load log with error (you can scramble hostnames or domainnames if need be) would be helpful.
cheers

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I forgot to add the post method connection link
1- Post method.
2-I don't know how to check this?
3- yes it is possible the server is fine
4- Qliksense proxy whitelist? for nprinting ıp no
5-Yes, I specified it, but the qliksense address I connect to is not available in the origin, should I add it?
6- yes
7- service accaount
8 - same account

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @krmvacar
Answering above points:
point 2 - Checking timeout. I suggest to increase to value between 30-300 if necessary
point 4 - Whitelisting In NPrinting: Admin --> Settings --> OnDemand all possible combinations of Qlik Sense server addresses
point 5 - absolutely, should be added as per point 4. Then in connection POST Method configuration you would have:
for i=1 to FieldValueCount('TASKID')
LIB CONNECT TO 'REST_Nprinting_POST;
let vPublshTaskURL = 'https://*********/api/v1/tasks/'&FieldValue('TASKID',$(i))&'/executions';
SQL SELECT
"__KEY_data"
FROM JSON (wrap off) "data" PK "__KEY_data"
WITH CONNECTION( URL "$(vPublshTaskURL)", HTTPHEADER "cookie" "$(vCookie)");
Sleep(30000);
next

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, HTTP is a client-server protocol which works under a request-response model, in your case, I suppose you got the 500 error on your "client"; anyway, an HTTP's 500 error is a server side error.
If you are using a REST architecture, the body of the HTTP response status code (500) might have a more detailed error, if not, and if you have the permissions, you can debug the server application by taking a look into some error log; otherwise, and if you don't have permissions to the server application, you might want to contact the server admins as they might help you by reviewing their end (logs).
Finally, from my point of view sleep(30000) is not recomanded and you should use a a dynimic timer because if you have more than one application doing the same task you don't want all of them requesting resurces at exactly the same time.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Lech_Miszkiewicz ,
I made the change you said and updated the timeout period to 90. I also edited the code. I will continue testing, thank you very much for the information.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Lech_Miszkiewicz ,
It gave an error again but this time the reason is different.
A disabled task id was defined in the inline table, so it gave an error.
After giving task IDs in the inline table, can we check whether they are disabled or enabled?
If we add that control here and say that only the enabled ones should go, the possibility of an error will be eliminated.
Thank you very much for your help.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @krmvacar
Of course you can write control script checking if those tasks are enabled. I have part of it done and on screenshot I have flagged what field you can use to get this info from.
Have a looked at the NPrinting.qvs i mentioned in my previous post?: https://nprintingadventures.com/2019/04/08/nprinting-api-qlik-rest-subroutines/
There you will see field which will allow you to validate if task is enabled. This is in the section of script which loads tasks via API. Please have a look and apply according to your needs.
Cheers

- « Previous Replies
-
- 1
- 2
- Next Replies »