WebApp closes by itself

But are there any workarounds or solutions? Our clients get slowly mad :wink:

itā€™s not cool, actually. If you run your standalone web app on a server that is not exposed on the internet and not used, the application quits? or the application quits only if it is used? by a single user or several?

The problematic version is 2017.R3?

IĀ’m still waiting for each of you to look in /var/log/messages or /var/log/kernel and tell me if there are any log entries related to your app.

cat /var/log/messages | grep yourappname

Using that command should show only the errors for your app.

Hi Greg!

I built a simple test app, on my server:
test.cgi

the source code can be downloaded here:
project.zip

there are no log entries on /var/log/messages file on server.

I hope someone can help me to fix this crazy error!

NOTE: only occurs on Mac !

No, itā€™s not. I moved from a host provider to another about 3 years. Since then, i have this problem.

I never worried about this, since all users of the application were windows.

unfortunately, or not, my last application is focused on mac users, and everyone is having this problem.

this is the reason why I am really and incessantly seeking a solution!

Boy I really wish weā€™d done this sooner. Now that Iā€™ve seen your app and explanation, Iā€™ve got a much clearer understanding about what you are experiencing. Some observations:

The whole app isnā€™t closing, right? Just the Sessions where a mac is connected?

Looking at my browser (a mac), Iā€™m getting 504 Gateway Timeout responses from the server. That means that the app or the web server isnā€™t responding to the browser quickly enough. That said, my browser is still connected to the test app after 30 minutes

We need a few more details about what your mac users are experiencing.
First of all, which browser are they using? Safari, Chrome, Firefox, Opera, something else?
Do you have any screen recordings of this problem they are having?

Alexandre, I opened the url on Safari, Firefox and Chrome and I donā€™t see it closing after 20 minutes or so.

I reloaded the page and I donā€™t see anything with Safari or Chrome, but I see this with Firefox (for a split second):

I hope it helps.

Your app has errors;

[quote=374148:@Greg Oā€™Lone]Boy I really wish weā€™d done this sooner. Now that Iā€™ve seen your app and explanation, Iā€™ve got a much clearer understanding about what you are experiencing. Some observations:

The whole app isnā€™t closing, right? Just the Sessions where a mac is connected?

Looking at my browser (a mac), Iā€™m getting 504 Gateway Timeout responses from the server. That means that the app or the web server isnā€™t responding to the browser quickly enough. That said, my browser is still connected to the test app after 30 minutes

We need a few more details about what your mac users are experiencing.
First of all, which browser are they using? Safari, Chrome, Firefox, Opera, something else?
Do you have any screen recordings of this problem they are having?[/quote]

Safari
Didnā€™t test on Chrome and Firefox

movie

this app i used for example, does not call mysql at all

@Alexandre Cunha

Same observation as Greg. On my Mac (10.12.6), safari and firefox (http://alemac.com.br/cgi-bin/test/test.cgi), the web app doesnā€™t quit, but the browser canā€™t communicate properly with the Xojo server app (all Xojo push requests have a 504 error).

Ok. Great!

So whatā€™s the solution / fix for this?

I really donā€™t know what to do.

Alex

Sorry for late reply as it was Chinese New Year holiday hereā€¦

https://drive.google.com/open?id=1gItUPkdQ_bKZh2CHTnSA8Re4AZxUFcke

This is the screen cap of the console when running my app in debug mode. I startup my app, didnā€™t type anything (login details grabbed from cookie), let it stand still. After a minute or 2, the event ā€œpushā€ coming out and seems it cannot be finished, then keep trying. In deploy mode, there is another ā€œpingā€ action but it does successfully. Just wondering if this cause the timeout for the app thus lead to app crash.

[quote=374258:@Tony Lam]Sorry for late reply as it was Chinese New Year holiday hereā€¦

https://drive.google.com/open?id=1gItUPkdQ_bKZh2CHTnSA8Re4AZxUFcke

This is the screen cap of the console when running my app in debug mode. I startup my app, didnā€™t type anything (login details grabbed from cookie), let it stand still. After a minute or 2, the event ā€œpushā€ coming out and seems it cannot be finished, then keep trying. In deploy mode, there is another ā€œpingā€ action but it does successfully. Just wondering if this cause the timeout for the app thus lead to app crash.[/quote]

I saw this push event somewhere on my logs or erros, or somewhere but i canā€™t remember where!

[quote=374182:@olivier vidal]@Alexandre Cunha

Same observation as Greg. On my Mac (10.12.6), safari and firefox (http://alemac.com.br/cgi-bin/test/test.cgi), the web app doesnā€™t quit, but the browser canā€™t communicate properly with the Xojo server app (all Xojo push requests have a 504 error).[/quote]
Olivier, please confirm that itĀ’s all push requests. On my side, it was one out of 10 and the app kept working. FWIW, This behavior is expected once in a while (although IĀ’ve never seen it like this).

[quote=374258:@Tony Lam]Sorry for late reply as it was Chinese New Year holiday hereā€¦

https://drive.google.com/open?id=1gItUPkdQ_bKZh2CHTnSA8Re4AZxUFcke

This is the screen cap of the console when running my app in debug mode. I startup my app, didnā€™t type anything (login details grabbed from cookie), let it stand still. After a minute or 2, the event ā€œpushā€ coming out and seems it cannot be finished, then keep trying. In deploy mode, there is another ā€œpingā€ action but it does successfully. Just wondering if this cause the timeout for the app thus lead to app crash.[/quote]
Ok, first of all, we need to stop referring the this as a crash. A crash would mean that the app is quitting (or being forced to quit) and all of the connected users are being disconnected at the same time. ThatĀ’s not what Alexandre is describing here. ItĀ’s simply not responding properly to certain users.

As for the 504 Gateway Timeout error, this HTTP error is not generated by the Xojo app itself. ItĀ’s created by the web server in front of the cgi app in cases where it isnĀ’t getting a response fast enough. This can happen under several circumstances:
0. The app is crashing during the request (not whatĀ’s happening here)
0. The app is in a tight loop and too busy to respond (also not whatĀ’s happening here because itĀ’s an empty app)
0. Too many users. It could be thisā€¦ cgi apps can only handle about 50 simultaneous users.
0. A web server configuration issue. While unlikely, it could simply be that the requests are being misrouted.
0. A framework bug. IĀ’m not expecting this to be the case or the problem would be more widespread, but it could be that the app canĀ’t respond for some reason.

What I need next is to know the country and language of the users who are having trouble so we can see if this is some sort of regional encoding issue.

When I test the link to the remote server @Alexandre Cunha has provided with Safari 11.0.3 on 10.12.6 it with the, it seems to affect all push requests. As these are long polling AJAX requests, a delayed response is expected. The CGI seems to sit behind an Apache. That, together with the log excerpt from the OP let me think of an Timeout for CGI requests configured within the Apache.

I tried it from Europe, Switzerland with an Accept-Language of de-ch. All Push requests get an 504 Error after 40.3 sec. Posts to Ping-Requests on the other side can span 137sec but I understand these are delayed while sending not receiving.

CURL-extracted samples:

[code]$ time curl ā€˜http://alemac.com.br/cgi-bin/test/test.cgi/4D08D700E876726DF30072FAB4918E6B5ED63CD0/comm/pushā€™ \

-XPOST \
-H ā€˜Referer: http://alemac.com.br/cgi-bin/test/test.cgiā€™ \
-H ā€˜Content-Type: application/x-www-form-urlencodedā€™ \
-H ā€˜Origin: http://alemac.com.brā€™ \
-H ā€˜Host: alemac.com.brā€™ \
-H ā€˜Accept: /ā€™ \
-H ā€˜Connection: keep-aliveā€™ \
-H ā€˜Accept-Encoding: gzip, deflateā€™ \
-H ā€˜Accept-Language: de-chā€™ \
-H ā€˜DNT: 1ā€™ \
-H ā€˜User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0.3 Safari/604.5.6ā€™ \
-H ā€˜Content-Length: 0ā€™ \
-H ā€˜Cache-Control: no-cacheā€™

504 Gateway Timeout

Gateway Timeout

The gateway did not receive a timely response from the upstream server or application.

Additionally, a 504 Gateway Timeout error was encountered while trying to use an ErrorDocument to handle the request.

real 0m40.351s
user 0m0.007s
sys 0m0.008s
[/code]

and

[code]$ time curl ā€˜http://alemac.com.br/cgi-bin/test/test.cgi/4D08D700E876726DF30072FAB4918E6B5ED63CD0/comm/pingā€™ \

-XPOST \
-H ā€˜Referer: http://alemac.com.br/cgi-bin/test/test.cgiā€™ \
-H ā€˜Content-Type: application/x-www-form-urlencodedā€™ \
-H ā€˜Origin: http://alemac.com.brā€™ \
-H ā€˜Accept: /ā€™ \
-H ā€˜Cache-Control: no-cacheā€™ \
-H ā€˜DNT: 1ā€™ \
-H ā€˜User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0.3 Safari/604.5.6ā€™
{ā€œjsSourceā€:ā€œXojo.comm.begin();ā€}
real 0m0.481s
user 0m0.006s
sys 0m0.005s
[/code]

@Greg Oā€™Lone I think my problem is different from AlexandreĀ’s one as my app is really shutting down with all connected users being kicked out. I am not sure if we need to separate this thread into 2 for separate discussion.

Greg, you have mentioned that cgi has a limitation on 50 concurrent users, does standalone app have the same limitation?

@Greg Oā€™Lone In the case of Alexandre, I thought exactly the same as Tobias. All push requests failed after 40 seconds. Like Tobias, I try from Europe (France). @Alexandre Cunha , can you send your Apache configuration file (httpd. conf) please?

Safari
https://www.dropbox.com/s/8jomajf97aaav5f/xojoAlexSafari.png?dl=0

Chrome
https://www.dropbox.com/s/i9p5vh7h1rf1l9h/xojoAlexChrome.png?dl=0