Skip to main content
Announcements
Talend Data Catalog 8.0 End of Support: December 31, 2024 Get Details

Qlik Sense June 2020 connecting to NPrinting getting "HTTP protocol error 403 (Forbidden): The server refused to fulfill the request."

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

Qlik Sense June 2020 connecting to NPrinting getting "HTTP protocol error 403 (Forbidden): The server refused to fulfill the request."

Last Update:

Apr 26, 2023 12:28:09 PM

Updated By:

Frank_S

Created date:

Nov 5, 2020 11:50:59 AM

Attachments

When trying to run load script in Qlik Sense using REST connection to NPrinting (using NTLM authentication) you get the below error message:

The following error occurred:
HTTP protocol error 403 (Forbidden):

The server refused to fulfill the request.

 

Data Load Progress Failed.png

 

 

Qlik Sense September 2020 Patch 2 and later versions

R&D released a permanent fix for this issue which is included in Qlik Sense September 2020 Patch 2,

However, in the load script, you must still replace

let vCookieRaw = Peek('Set-Cookie',0,'_response_header');  
let vCookie = TextBetween('$(vCookieRaw)','Secure,','Path=/',2);

with

Let vCookieRaw = Peek('Set-Cookie',0,'cookie_items'); 
Let vCookie = TextBetween(vCookieRaw,'SameSite=None,',' Path=/',SubStringCount(vCookieRaw,'SameSite=None')-1);


Workaround Qlik Sense June 2020

If using Qlik Sense June 2020 and cannot perform an upgrade but a file can be replaced. 

NOTEPlease backup existing folder before proceeding below

Download the file attached on this article (below: qvrestconnector-enterprise.zip), unzip it and

1. Replace existing QvRestConnector folder content on the driver with this files.

The QvRestConnector folder is located in:

C:\Program Files\Common Files\Qlik\Custom Data\QvRestConnector


2. Replace the following

let vCookieRaw = Peek('Set-Cookie',0,'_response_header');  
let vCookie = TextBetween('$(vCookieRaw)','Secure,','Path=/',2);

with*

//Extracts session cookie from the API response
Let vCookieRaw  = Peek('Set-Cookie',0,'cookie_items');
Let vCookie = TextBetween(vCookieRaw,'SameSite=None,',' Path=/',SubStringCount(vCookieRaw,'SameSite=None')-1);

*For some cases:

A request to NP returns one or more Set-Cookie headers that are parsed in the connector code. The value of the header is a list of semicolon separated key-value pairs. In case of multiple values with the same key, the last one should be used.

The sample load script extracts the key-value pair with NPWEBCONSOLE_SESSION as key. Then you could use the Sense string functions to achieve this result in a way that would work also in case of future changes to the cookies:

let session = TextBetween(vCookieRaw, 'NPWEBCONSOLE_SESSION', '; ', SubStringCount(vCookieRaw, 'NPWEBCONSOLE_SESSION'));
let vCookie = 'NPWEBCONSOLE_SESSION'&session&';';


Example of the key value pair (ending with semicolon) to extract:

NPWEBCONSOLE_SESSION=5d7ff2747d10d82e46c39f385ceb9fc48948adcf-%00userlogin%3A2021-03-22T14%3A56%3A21.9786004Z%00%00NPWEBCONSOLE_XSRF-TOKEN%3AwVMqYfj%2FrZrhR01OcKU2F8AtGIj9J9WfStbviXWhJRM%3D%00%00_TS%3Asession%00%00userid%3A74aaa5a6bdf547fa99a24cf4495b3bab%00;

 

Labels (1)
Comments
Digvijay_Singh

Hi@Sonja_Bauernfeind 

Do we need to stop engine service for replacing the connector. We recently upgraded Sense from Apr 2019 to June 2020 and facing this issue. The connector available here, didn't work for me, it failed data reload tasks for monitoring apps as well.

Pl let me now if  I am missing something.

 

Thanks for your help.

Digvijay

maksim_senin
Partner - Creator III
Partner - Creator III

Please take a look to https://community.qlik.com/t5/Qlik-NPrinting-Discussions/Nprinting-REST-API-broke-after-June-2020-up... also.

Maybe you need to add the extra header too.

ramazanerduran
Partner - Contributor II
Partner - Contributor II

Hi @Sonja_Bauernfeind,

 

You said that the RnD crew permanent fix the issue on 2020 but I'm getting the same error on May 2024 Patch 3. Not the same application that is related to NPrinting but the error is occured from the same source. 


SaaS Readiness App:

HTTP protocol error 403 (Forbidden):

The server refused to fulfill the request.

RestConnectorMasterTable:
    SQL SELECT 
        "contentHash",
        "senseId",
        "originalClassName",
        "version",
        "deploymentType",
        "releaseLabel",
        "deprecatedProductVersion",
        "productName",
        "copyrightYearRange"
    FROM JSON (wrap on) "root"
    WITH CONNECTION(
        URL "https://centralservername/api/about/v1/systeminfo",
        QUERY "xrfkey" "abcdefg123456789",
        HTTPHEADER "X-Qlik-Xrfkey" "abcdefg123456789",
        HTTPHEADER "User-Agent" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36"
    )


It's occured because of the `WITH CONNECTION` side. Because I'm successfully getting data without `WITH CONNECTION`. Also I'm successfully go to `https://centralservername/api/about/v1/systeminfo` address. I tried on localhost but the result was same.

I tried to replace RestConnector files with zip file that you uploaded then I tried again but there isn't any difference. You said that I should replace the Cookie things but there isn't any cookie variable as I said the app is SaaS Readiness default app. 

Is there any suggestion for this issue on May 2024 Patch 3?

Best regards,
Ramazan

Sonja_Bauernfeind
Digital Support
Digital Support

Hello @ramazanerduran 

As this particular issue is resolved, we are likely looking at a different root cause or different iteration of a similar problem. Please log a support ticket to have this properly investigated.

All the best,
Sonja 

Version history
Last update:
‎2023-04-26 12:28 PM
Updated by: