Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
dferreirogft
Contributor III
Contributor III

Qlik-cli bad request

Hi,

I'm trying to configure Qlik-cli in our server .

I connect successfully to it but then when executing commands like start-qliktask I'm getting bad request (400) error.

Other api calls like getAbout or so are working correctly.

I followed the steps to install the certificates from GitHub page and qlik help.

 

Any clues?

Thanks

Labels (4)
13 Replies
Levi_Turner
Employee
Employee

What's the full series of commands that you're using to connect? Because that could be due to a lack of permissions. For example:

PS C:\> Connect-Qlik -UserName Example\randomuser

PS C:\> Start-QlikTask -id 3f053d35-e1e6-40f0-b3de-449c009ce99d
The remote server returned an error: (400) Bad Request.
At C:\Program Files\WindowsPowerShell\Modules\Qlik-Cli\1.15.1\functions\core.ps1:35 char:17
+ ... $result = Invoke-RestMethod -Method $method -Uri $path @params -Web ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
ceciliadoan
Contributor II
Contributor II

hi:

i am having the same problem when using qlik-cli from windows module.  hope that you can help.

i can connect using connect-qlik.  but when calling set-qliklicense, it errors out: 

The remote server returned an error: (400) Bad Request.
At C:\Program Files\WindowsPowerShell\Modules\Qlik-Cli\functions\core.ps1:36 char:17
+ ... $result = Invoke-RestMethod -Method $method -Uri $path @params -Web ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

ScriptStackTrace:
at CallRestUri, C:\Program Files\WindowsPowerShell\Modules\Qlik-Cli\functions\core.ps1: line 36
at Invoke-QlikPost<Process>, C:\Program Files\WindowsPowerShell\Modules\Qlik-Cli\Qlik-Cli.psm1: line 181
at Set-QlikLicense<Process>, C:\Program Files\WindowsPowerShell\Modules\Qlik-Cli\resources\license.ps1: line 269
at <ScriptBlock>, <No file>: line 35

ceciliadoan
Contributor II
Contributor II

update:  this is the code where Connect-Qlik works but Set-QlikLicense doesn't.

[hashtable]$connection = @{
    ComputerName   = $module.Params.Computername
    TrustAllCerts  = $true
    UseDefaultCredentials  =  $true
}
[hashtable]$license = [ordered]@{
    serial       = $module.Params.serial
    control      = $module.Params.control
    name         = $module.Params.name
    organization = $module.Params.organization
    lef  = $module.Params.lef
}
try {
    Import-Module Qlik-Cli
    $result = Connect-Qlik @connection
    $result = Set-QlikLicense @license
}
catch {
    $module.FailJson("failed. $($_.Exception.Message)"$_)
}
ceciliadoan
Contributor II
Contributor II

update:  we have been having this problem for days.  your help is greatly appreciated.

thank you.

Levi_Turner
Employee
Employee

  • What user is making the request?
    • The user obviously needs to have the appropriate permissions
  • Is the site licensed already?
    • If so with what license type: JWT or Serial + Control number?
  • What license are you applying?
    • JWT or Serial + Control number?
ceciliadoan
Contributor II
Contributor II

hi Levi_Turner:  thanks for your response.  please find the info as follows.

.the user making the request is a service account with sufficient permissions (ie, this same service account running this same command with win_shell works.  but we are trying to make running from windows module, then we got the errors)

 

.we have qlik license with serial and control numbers

.this code is for automating deployment

please let us know if there is anything else that needs clarified.

thank you

Levi_Turner
Employee
Employee

Is the site licensed already?

That is still outstanding.

ceciliadoan
Contributor II
Contributor II

the ansible code does the followings:

.installing central node

.then running qlik-cli Connect-Qlik to connect (this works) then running set-qliklicense (this fails)

so my guess: that is still outstanding?

ceciliadoan
Contributor II
Contributor II

update:  sorry if i did not understand the question.

this is a brand new central node installation where license has never been installed.