2021r3 how do I debug what's triggering WebSession.InterruptionMessage?

Hello,

So… I have a webapplication, built with the previous 2 versions of Xojo 2021 as expected.
I have updated Xojo to r3, built the webapp and uploaded it.
ABSOLUTELY NOTHING was changed to the webapp code!
Now my clients are reporting they keep getting disconnected from the webapp (I’ve timed it to a minute and 10 seconds, plus or minus a few).
When I am debugging the webapp and doing exactly what my clients are reporting, nothing happens, it works as expected :))

My question: what exactly might trigger the WebSession.InterruptionMessage? The docs simply say “The text the user will see if the connection drops between the browser and the application.” but honestly they need more work with examples as why that might happen.

What can I do to debug this problem? Was there something changed in r3 that skipped the release log? Because from the release log I honestly don’t see anything that might cause this.

Thanks! Much appreciated for any and all input on this matter.

  • Do you use App.HandleURL ?
  • Do you have App.HTMLHeader set in the IDE (if so what’s in there) ?
  • Do you use any 3rd party code in your web app ?
  • Do you set anything in Session.PreparingSession event ?
  • Do you have set App.SessionTimeOut (what’s it’s value) ?
  1. Yes, I do for managing api connections to the app when there’s no need for the web interface
  2. I use Session.PreparingSession for injecting some google fonts and custom css
  3. Nope
  4. Yes, for injecting some google fonts and custom css
  5. No, haven’t used it so far. And neither App.UserTimeout
  1. So are you blocking any xojo paths?
  • “” ?
  • “xojo” ?
  • “sessionidhere” ?
    etc?
  1. Don’t suspect an issue here
  2. skipped
  3. Don’t suspect an issue here
  4. ok
  • Did you check your browser developer tools?
  • Does the disconnect happen if you keep the tab open (visual) or if you browsed outside the tab (other tab or browser minified etc. ?

In App.HandleURL I have:

If Not Request.Path.IsEmpty Then
  
  If Request.Path.BeginsWith("apis", ComparisonOptions.CaseSensitive) Then
    
    If Request.Header("apikey").IsEmpty Then
      
      Response.Write("API KEY MISSING!")
      Response.Status = 401
      Return True

    Else
        // code to do some api stuff here that returns true
    End if
    
  Else
    
    // web interface user
    Return False
    
  End If
  
End If

The disconnect happens with the tab visually opened or if out of focus (other tab).
Haven’t checked developer tools, didn’t even think of it. I will open it to see if it says something…

Developer tools throws this error:

GET https://domain-here.tld/84EE6246AE42B60D5D4EF1B50A72E57884E6E65BCA835C8196D71BDF68F2EEAB/comm/serverevent net::ERR_HTTP2_PROTOCOL_ERROR 200

Do you have a proxy (nginx?) on your server?

Yup. But no changes to the initial config files we’re done since… June or May :slight_smile:

Apparently Nginx error.log is throwing:

2021/11/22 13:13:40 [error] 739#739: *17011 upstream timed out (110: Unknown error) while reading upstream, client: xxx.xxx.xxx.xxx, server: domain.tld, request: "GET /2FB6527395C811B1E10C3D6DDCB0B1A7298734C1DCEC6FBC95D9AA9D2B210C39/comm/serverevent HTTP/2.0", upstream: "http://127.0.0.1:42004/2FB6527395C811B1E10C3D6DDCB0B1A7298734C1DCEC6FBC95D9AA9D2B210C39/comm/serverevent", host: "domain.tld", referrer: "https://domain.tld/"

So far, I’ve managed to track the causality…
If the webapp is running behind nginx (proxy) then there’s that webapp server event “xxxxxx/comm/serverevent” that’s making nginx to throw a “739#739: *17011 upstream timed out”

If I run the webapp directly, bypassing the nginx in the form of http://domain.tld:app_port everything is fine.

Something was changed in Xojo r3 that’s causing this problem and was not mentioned in the release log…

P.S. Thanks @DerkJ for pointing me in the right direction!

2 Likes

I think you may need to forward the connection keep-alive to be kept alive if it requests that?

Note the ServerEvent headers are shown here
Headers for nginx with 2021 R2.1:

HTTP 1/1
Transfer encoding chunked
Connection keep-alive
Cache no cache

This is working in Xojo 2021 R2.1 maybe 2021 R3 is different here?

I think your nginx is not correctly configured to accept the keep-alive maybe you used http 2.0 setting but you can better keep it http 1.1 since xojo comms mostly use that.

The only thing that changed is xojo now calls a /sessionidhere/comm/ping to check if the session is still online. if not then the session is probably offline or not responding in time ! (threads?, long processes running?)

response_header
Humm I am missing the keep-alive header and the transfer encoding.

I did changed nginx to serve it as http 1.1 and the problem persisted so I switched back to http2, because it’s faster.

No threads, no long processes running.

maybe there is a setting that is not allowing keep-alive ?

Neither web 1 nor web 2 support HTTP/2.0 (and never have) so you should make sure nginx isn’t trying to communicate using that. That said, the framework should be returning an error in that case as it definitely would not understand that protocol.

You wouldn’t have those headers in the response headers anyway.

Well, I’ve been using http2 since June and Xojo r2, 2.1 never complained about it in any way :))

It should be http 1.1 compatible but still i wouln’t recommend it…

maybe try to see if nginx is not trying to handle the request itself since you seem to edit the config…