Open rvaheldendaten opened 3 years ago
I think this may be caused by either the app being open for the same user in another context or a previous sse function not closing the app. Can you post the sse script you are using?
hi Rob!
We do some work to generate our Master Items, but then we basically do a resident load. See below.
CreatorMeasures: Load *, QCB.CreateMeasure(MeasureMEASURE_NAME, MeasureDEFINITION_FORMULA,MeasureDesc , MeasureMASTER_ITEM_TAGS, MeasureLabel) as MeasureState ; LOAD %MEASUREID, %MEASUREID as MeasureID, MeasureMEASURE_NAME, //add KPI number format if available if(Len(trim(FormatFunction))> 0, FormatFunction&'(')& MeasureDEFINITION_FORMULA& if(Len(trim(FormatFunction))> 0, ','&chr(36)&'(='&chr(36)&'(vF('&%MEASUREID & ')))'&')' ) as MeasureDEFINITION_FORMULA, MeasureMASTER_ITEM_TAGS, '='&chr(36)&'(vTMeasureDesc('&chr(39)&DESCRIPTION&chr(39)&'))' as MeasureDesc, '='&chr(36)&'(vTMeasure('&chr(39)&LABEL_DEFINITION&chr(39)&'))' & if (len(LABEL_DYN) > 0,'&chr(32)&'&LABEL_DYN) as MeasureLabel resident QCB_Measure;
Are there any errors displayed on the sse console prior to the "App already open" error?
We are running the SSE as "Windows Service". Where do I see the console output? I haven't found any logfile. Do I have to pipe the output to some file?
Thx, Roland
Take a look at the doc for whatever package you are using to run this as a service, to see how to pipe the stdout output.
I'm using https://nssm.cc/ --> I will take a look how to retrieve the logs, and will come back to you next week.
Thx Roland
Hello Rob!
I don't get much information in the logfiles. See attachment. logs.zip
I only see an error from enigma.js:
{ Error: App already open at Intercept.errorResponseInterceptor (D:\QVDs\07_SSE\qcb-qlik-sse-master_heldendaten\qcb-qlik-sse-master\node_modules\enigma.js\enigma.js:2668:19) at process._tickCallback (internal/process/next_tick.js:68:7) code: 1002, parameter: 'ecba5c14-b348-4bc7-b3ad-bc5c129672bd' }
So I guess for some reason Qlik Sense "thinks" the app is already open.
I'm running the QCB Windows Service as "Local System". Should I run it with the Qlik Sense service user? The user running the Qlik Sense script is a different user anyway - maybe this causes some trouble.
Unfortunately I was not able to reproduce it while I was on site. So it seems it's not a general problem.
Best regards, Roland
hi! We recently saw this issue again. Anyone else having this issue?
The error disappears when we duplicate the app. Then the next (manual) reload creates the masteritems again.
We are running QlikSense May 2021 Patch1.
I guess we now know what's happening:
If two "QCB"-tasks (for example via Qlik Sense Scheduler) run in parallel it seems QlikSession.js does not handle parallel connections correctly. It seems instead of creating a second session for the second app, we get a "SESSION_ATTACHED" in the trace log. When "SESSION_ATTACHED" happens, we get a "App Already Open" Error.
We are currently testing to create a seperate enigma websocket connection for every masteritems. I will post some code, once we have tested it in more detail.
QlikSession.js was written to cache and reuse the session to avoid the problem of exceeding the 5 session limit per license in QSEoW. I see how that design could be a problem with parallel activity. I recommend you test any new design with repeated runs as well.
I read somewhere that this 5 session limitation only exists when you go via Qlik Sense Proxy. But I'm not quite sure.
Basically what we want to try:
1) suspendOnClose: false,
2) Open the websocket with a new /identity/
I guess this is probably a litte bit slower, as we do a new session for each call. But hopefully we can avoid the current issue. We will do some days of testing and then come back to you!
hi! We have now testet the code for some weeks and it seems more stable: in QlikSession.js I now do a seperate identity for each app:
const config = { schema, url: isDesktop ? 'ws://localhost:9076/app/engineData' : 'wss://localhost:4747/app/engineData' +'/identity/'+commonHeader.appId, suspendOnClose: true, }
It sounds like an improvement. Please submit a PR we you are ready.
Hi,
The "Error: App already open" message can occur in Qlik Sense when multiple users try to access and modify the same app simultaneously. When one user opens an app, the app is locked for editing until the user closes it. If another user tries to open and edit the same app while it is locked, they will receive the "Error: App already open" message.
To avoid this issue, you can implement a few best practices for app sharing and collaboration in Qlik Sense:
You can Limit app access to a smaller group of users who need to edit or view the app, rather than allowing it to be accessed by a large number of users simultaneously.
Make sure all users are aware of the app lock mechanism and the importance of closing the app after editing to release the lock.
Set up a notification system or workflow to inform users when an app is available for editing, so that they can avoid attempting to open the app at the same time.
Consider using Qlik Sense's collaborative features, such as shared bookmarks or sheets, to allow multiple users to work on different aspects of the same app without conflicting with each other.
Thank you
Hi Rob!
We are running Qlik Sense Feb 2021.
We quite often get the MeasureState "Error:Error: App already open". Anyidea why this happens? See screenshot. We have not really found a pattern when we see this error.
Is this related to the max number of sessions the Qlik Sense User can have to open apps?
Thx, Roland