15 Replies Latest reply: Jul 2, 2018 5:55 AM by Tomasz Truszkowski RSS

    Frequent "Connection Lost"

    Urs Blapp

      We are experiencing frequent connection loss to QlikSense server.  If we work locally (from within the company) there is no problem.

      When working from outside, a popup window with the following message appears:

       

      "Connection lost: Make sure that Qlik Sense is running properly.

      If your session has timed out due to incativity, refresh to continue working."

       

      We have set the session timeout in QlikSense Server to 30 minutes. But the connection lost happens after a minute.

       

      In the developer console of ChromeBrowser, we can see the following entry:

       

      Error from Engine:" error {target:WebSocket, isTrusted : true, currentTarget : WebSocket,eventPhrase : 2 bubbles : false, cancelable : false, defaultPreveted : false, timestamp :1433922, orignalTarget : WebSocket, explicitOriginalTarget : WebSocket, NONE : 0 }

       

      The connection to wss://xxxxxx.com/resources/app/a4bdfb1b-71f2-42fc-83f2-53f4f7a...?reloadUri=https://xxxx.com-sense-app-a4bdfb1b-..../sheet/UCbAB/state/analysis was interrrupted while the page was loading.

       

      Has someone discovered something similar before? What could be the problem?

        • Re: Frequent "Connection Lost"
          Steve Dark

          Please see this thread that references the same error message:

          https://community.qlik.com/thread/141043

           

          You will see my comment on there regarding proxy settings, which is what sorted it for me.

           

          Steve

            • Re: Frequent "Connection Lost"
              Phaneendra Kunche

              Steve,

               

              I was not able to understand your comment from your above post.

               

              Adding a manual exclusion for the Sense site in the Advanced settings under the Proxy settings (in the IE, Settings, Connection options) solved the issue.


              I have a client who is getting this "Connection lost" message very frequently. And this is not happening to any one else besides this client. And this error is popping up in and around 3-7mins. I have updated my time out settings to 2hrs, but still no use.

               

              Below is the error message i see in the proxy log.

               

              Backend web socket connection Closed for session '28323627-cdf1-457f-8bfe-298fcb2494bd'. App id: '6480f687-b705-495f-a209-72514fd308db. UserAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.6.3 (KHTML, like Gecko) Version/8.0.6 Safari/600.6.3'

               

              And client is on MAC and using Firefox. I tried simulating the same with my MAC but didn't see connection lost.

              Do you have any idea why this might be happening.

                • Re: Frequent "Connection Lost"
                  Steve Dark

                  It sounds like a different issue to what I had.  This was on a Windows machine with a web proxy (which I believe caused Sense not to recognise the client as authenticated) and the user could not get on at all - it was not a case of them being able to work for a while and then being disconnected.

                   

                  It seems strange that the issue only happens to one user.

                   

                  What type of authentication are you using?

                    • Re: Frequent "Connection Lost"
                      Urs Blapp

                      Hello Steve,

                      For your info, we were also using Windows Authentication.

                      Further we found out, that the problem occured on one Windows client machine using Firefox v38. When using Chrome on the same Windows machine, the problem was not present. I got told that the problem was not observed with Firefox v39 on the same windows machine.

                       

                      Conclusion: It looks like our problem was related to Firefox v38 on Windows 8.

                • Re: Frequent "Connection Lost"
                  Phaneendra Kunche

                  Thanks Steve for the Reply. Yeah that is wired. I am thinking this is something to do with their network or corporate security policy.  Do you know if we have to allow/open certain ports on their end as well?

                   

                  We are using Windows Authentication.

                  • Re: Frequent "Connection Lost"
                    Scott Booth

                    Did anyone ever find a solution to this?  I'm having a similar issue with one of my users.  They are on a Mac using Chrome.  They receive the "app has closed" error after a few minutes (typically 2 - 5).  No other users have this problem.  I have not been able to duplicate it on my Mac also using Chrome.  Any ideas on how to fix this??

                    • Re: Frequent "Connection Lost"
                      Yakir Manor

                      this is a solution if you're using mashup and ticket, but you can interfere in the hub scripts as well.
                      this is indeed a bit annoying and the answers here did not help,

                      we're using the mashup option and it keeps disconnecting after 60 seconds of inactivity (not selecting anything in the model),

                      this is what we get:

                      "

                      An error occurred

                      Connection lost. Make sure that Qlik Sense is running properly. If your session has timed out due to inactivity, refresh to continue working.

                      "

                      luckily everything has a work around and a good one (:

                       

                      so the deal is that as long as you provoke the web socket the connection will stay open, so just provoke it,

                      this is how its done:

                      create a variable in your model (Data Load Editor or in the bottom left of the sheet after pressing edit),

                      now create a KPI and put the variable in the kpi

                      last thing, put the qlik object on the top page and create a set interval

                       

                      var qlikapp = null;
                      require( ["js/qlik"], function ( qlik ) {
                      qlik.setOnError( function ( error ) {
                        $( '#popupText' ).append( error.message + "<br>" );
                        $( '#popup' ).fadeIn( 1000 );
                      } );
                      $( "#closePopup" ).click( function () {
                        $( '#popup' ).hide();
                      } );
                      
                      
                      //callbacks -- inserted here --
                      //open apps -- inserted here --
                      qlikapp = qlik.openApp('4287ca1c-9b53-45dc-afe2-55f8e69af7f2', config);
                      //get objects -- inserted here --
                      qlikapp.getObject('QV01','fkAQBG');
                      qlikapp.getObject('CurrentSelections','CurrentSelections');
                      //create cubes and lists -- inserted here --
                      } );
                      
                      
                      setInterval('KeepSessionAlive()', 5000);
                      function KeepSessionAlive() {
                      if (qlikapp) {
                        //alert(getTime());
                        qlikapp.variable.setStringValue('Current Time', getTime());
                      }
                      return false;
                      }
                      
                      

                       

                      but do you really want to keep the socket open all the time?

                      this is an optimization question, if all the users use a named license then sure! but what if you convert some of them to Login Access Tokens? (you get 10 hours per month for each license)

                      this could be a waste of license time, so show some creativity, to my opinion 5 minuets of inactivity counted from the last mouse move on the page for login access user, and unlimited keep alive (until the window is closed for User access) is the best way to go.

                       

                      this is a basic code for mouse move (i used it in qlikview i frame to keep the login alive):

                      var keepSessionAliveBool = false;
                      SetupSessionUpdater();
                      function SetupSessionUpdater() {
                      //...set the event that makes the keep alive
                      var container = $("#QvBody");
                      container.mousemove(function() {
                        keepSessionAliveBool = true;
                      });
                      container.keydown(function() {
                        keepSessionAliveBool = true;
                      });
                      CheckToKeepSessionAlive();
                      return true;
                      }
                      
                      
                      function CheckToKeepSessionAlive() {
                      setTimeout("KeepSessionAlive()", 30000); // // 1000 is every second
                      return true;
                      }
                      
                      
                      function KeepSessionAlive() {
                      CheckToKeepSessionAlive();
                      if (keepSessionAliveBool) {
                        window.parent.postMessage("KeepSessionAlive", "*");
                        keepSessionAliveBool = false;
                        return true;
                      }
                      return false;
                      }
                      
                      
                      • Re: Frequent "Connection Lost"
                        Yakir Manor

                        the root cause for this issue might also be load balancer (we use aws) and not qlik sense,

                        see:

                        Elastic Load Balancing Connection Timeout Management | AWS News Blog

                         

                        console_elb_conn_settings_2.png