Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Vishal_Gupta
Partner - Creator
Partner - Creator

Qlik Cili Invoke-RestMethod Error

Hi Community,

We send out NPrinting report every day. Currently Customer has Qlik Sense SaaS and we have deployed QSEoW and NPrinting on seperate servers. We have created a cli script which does the following operations:

  • Export app from SaaS to local folder
  • Removing all apps from workspace in Qlik Sense hub
  • Importing apps from the local folder to Qlik Sense hub
  • Publish and replace old apps.


This script was working fine till last week and all the apps were getting properly migrated from SaaS to On prem and our NPrinting reports were also getting generated properly.

Unfortunately, since yesterday evening we are facing a new issue which seems to be cli/api related issue.
While the exporting and importing of apps are working fine while replacing old app with new app
Error message: 

 

 

Invoke-RestMethod : Content-Length or Chunked Encoding cannot be set for an operation that does not write data.
At C:\Program Files\WindowsPowerShell\Modules\Qlik-Cli\1.22.0\functions\core.ps1:66 char:23
+ ...            $result = Invoke-RestMethod @paramInvokeRestMethod @params
+                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Invoke-RestMethod], ProtocolViolationException
    + FullyQualifiedErrorId : System.Net.ProtocolViolationException,Microsoft.PowerShell.Commands.InvokeRestMethodCo 
   mmand

 

 


MicrosoftTeams-image (2).png

Would really appreciate some inputs by fellow Qlik experts.

If a post helps to resolve your issue, please accept it as a SOLUTION and leave a LIKE!
Labels (4)
6 Replies
Vishal_Gupta
Partner - Creator
Partner - Creator
Author

@Levi_Turner 

@Clever_Anjos 

@Sonja_Bauernfeind ...would love to get some help from you guys.

If a post helps to resolve your issue, please accept it as a SOLUTION and leave a LIKE!
Marc
Employee
Employee

If the script was working then suddenly stopped working, that suggests something has changed.

If the script has not been changed then something on the Operating system must have been changed.

Based on the Error Message you are currently using Qlik-CLI-Windows version 1.22.0 the update to that version

V1.22.0 Update Commit included a Change in the "Core.ps1" that added $params.Header.Add("Transfer-Encoding", "chunked") which seems to match the error you are seeing.

It may be worth rolling back to a previous version of Qlik-CLI-Windows and giving that a try. 

fmarvnnt
Partner - Creator III
Partner - Creator III

Never works on our system even with old release of Qlik-cli.

Any idea?

 

FMa

 

Marc
Employee
Employee

if not working with older release of Qlik-CLI can you confirm that the error message is different? if you have multiple versions installed, PowerShell will default to the newest version.

If is using a different version then the path shown in the error message should also be different. 

Marc
Employee
Employee

As an alternative option, you could also try QlikSenseCLI (Installation)

most of the commands are fairly similar to the module you are using, so converting the script should be pretty straight forward.

Connect-Qlik => Connect-QlikSense

Invoke-QlikPut => Invoke-QSPut

Invoke-QlikGet => Invoke-QSGet

Get-QlikApp => Get-QSApp

 

for uploading the App Binary

$New = Add-QSApp -AppPath "\\path\to\file.qvd" -Name "Name Of Uploaded App" -Upload

and replacing the current app

Update-QSApp -Id $($new.id) -Replace -App $($old.id) 

 

of you can use the experimental UploadReplace API

Add-QSApp -AppPath \\path\to\file.qvd -Targetappid $old.id -UploadReplace

 

 

 

NadiaB
Support
Support

Hi @Vishal_Gupta 

By any chance could it be clarified if the issue occurs when using qlik-cli for SAAS or if it fails when things are getting pushed to QS on prem ?

Kind Regards. 

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm