Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
cdyaro
Contributor II
Contributor II

REST connector for POST method started throwing 405 HTTP error

Hi,

 

I have an QS app which uses Qlik NPrinting APIs inside a load script which was working fine for the last 1.5 half year and suddenly started throwing an error:

2021-06-30 06:33:50 Error: HTTP protocol error 405 (Method Not Allowed):
2021-06-30 06:33:50
2021-06-30 06:33:50 {"message":"The requested resource does not support http method 'POST'."}

 

I've been searching through other similar topics but not able to find the solution.

Nothing has changed lately, no upgrades to the platform. This is Qlik Sense June 2019 Patch 6.

Is it something with the way cookie is set? I have it as below:

 

let vCookieRaw = peek( 'Set-Cookie',0,'_response_header');

if vSSL='No' then
let vCookie=TextBetween('$(vCookieRaw)','HttpOnly,','Path=/',1);
else
let vCookie = TextBetween('$(vCookieRaw)','Secure,','Path=/',2);
end if

I would be very grateful for any help on this issue.

If anything else needed from my side, please let me know.

 

Labels (2)
1 Solution

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Check my Nprinting.qvs on https://nprintingadventures.com/2019/04/08/nprinting-api-qlik-rest-subroutines/

Download the file and edit it. there is querylimit parameter i am using to change default 50 limit on response

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.

View solution in original post

10 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi

 

There is not enough info to see which method script is failing on. I am guessing task Id maybe was hardcoded and someone has changed it?

Please check the following article and section " ssue: API POST 405 method not supported (allowed)" for your answer:

https://community.qlik.com/t5/Knowledge-Base/Troubleshooting-Common-NPrinting-API-Errors/ta-p/171500...

alternatively please provide detailed info where your script fails so we can comment on that.

 

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
cdyaro
Contributor II
Contributor II
Author

Hi,

 

Thank you for the reply.

I don't think there were some changes in the script as last time it was modified it was by sa_scheduler which should be fine. I haven't noticed any changes.

 

I'm attaching logfile with the error, some info I've deleted or replaced with fake data.

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi

if you look at the “with connection” section you will notice that vTask variable does not return any value in your script. look below between task/ and /execution you would expect some id value. 
you miss it

servername.com:4993/api/v1/tasks//executions", HTTPHEADER "cookie

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Just to give you little bit more info as well..

it appears your script is searching for record called “taskChecker” in your nprinting and cannot find it as 0 lines are fetched hence no task id in your variable. 
so clearly something has changed in your nprinting!

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
cdyaro
Contributor II
Contributor II
Author

Ok, I think I kinda got what's could be the issue.

When it's looking for TaskChecker under https://servername.com:4993/api/v1/tasks/ it cannot find it as total number of tasks exceeded 50 and there is some limitation:

 

</d2p1:Items>
<d2p1:Limit>50</d2p1:Limit>
<d2p1:Offset>0</d2p1:Offset>
<d2p1:TotalItems>71</d2p1:TotalItems>

Now when I'm displaying https://servername.com:4993/api/v1/tasks/ , in fact TaskChecker is not visible.

 

Is there any option to somehow make it work?

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Check my Nprinting.qvs on https://nprintingadventures.com/2019/04/08/nprinting-api-qlik-rest-subroutines/

Download the file and edit it. there is querylimit parameter i am using to change default 50 limit on response

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
cdyaro
Contributor II
Contributor II
Author

Thank you, I will definitely analyze it and try to use this solution. Will be back once checked.

cdyaro
Contributor II
Contributor II
Author

Ok, checked and it worked. Thank you so much 🙂

tom503
Contributor
Contributor

hi 

I am having the same issue with the 50 default limit  .

I tried to open the link above it doesn't work . 

please advise