Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
nathan_
Contributor
Contributor

"App already open" error when creating session app

Hi All,

For reference, I am using Qlik Cloud.

I am trying to create session apps using the createSessionAppFromApp method. I have established a WebSocket connection with the QIX API using the WebSocket URL format as mentioned in the documentation. The appId that I provide is a random value.

wss://https://my-tenant.us.qlikcloud.com/app/SessionApp_{appId}?from={templateAppId}&qlik-web-integration-id={webIntegrationId}&qlik-csrf-token={csrfToken}

After connecting and retrieving the enigma model, I open a session and call the method:

  const session = await enigmaModel.open()
  const sessionApp = await session.createSessionAppFromApp(templateAppId)

However, I get the following WebSocket responses, terminating at the error "App already open"

First WS Response:{
    "delta": true,
    "handle": -1,
    "method": "CreateSessionAppFromApp",
    "params": [
        {templateAppId}
    ],
    "id": 1,
    "jsonrpc": "2.0"
}

Second WS Response: {
    "jsonrpc": "2.0",
    "method": "OnConnected",
    "params": {
        "qSessionState": "SESSION_ATTACHED"
    }
}

Third WS Response:{
    "jsonrpc": "2.0",
    "id": 1,
    "error": {
        "code": 1002,
        "parameter": "",
        "message": "App already open"
    }
}

 I do not have any other concurrent WebSocket connections to any Qlik app, hence I do not think that I have hit the limit of 5 WebSocket connections per user. Since this is also the only WebSocket connection I have, I do not think that the error is a result of 2 conflicting requests for 2 different apps over the same WebSocket connection.

I suspect that the error arises due to the appending of the Web Integration ID and CSRF Token at the back of the URL, but am unsure of how to address the issue.

Your inputs and suggestions will be much appreciated.

Labels (6)
0 Replies