Web App goes down suddenly

Hi everyone!
A few years ago I wrote a web application (my first major web application) using Xojo 2019r2.1. This CGI application runs on a shared Linux server, and there is a problem that I can’t solve (I have very little experience with Web applications).
There is a WebPage that has a ContainerControl at the top, one on the left (a sort of Navigator) and a central one, where all the other ContainerControls called by the Navigator alternate.
In particular, there is one that, in turn, contains 7 others.
When this ContainerControl is displayed, after some time, which varies from time to time, the application goes down without reporting any type of error.
Looking in the server error log I regularly find this message:

07/02/2025 09:50:37 [error] [client 93.34. 113.18] - www.nedifreguglia.it - ​​AH01215: Can’t use an undefined value as a symbol reference at /web/htdocs/www.nedifreguglia.it/home/cgi-bin/presto/presto.cgi line 118.: /web/htdocs/www.nedifreguglia.it/home/cgi-bin/presto/presto.cgi, referer www.nedifreguglia.it
07/02/2025 09:50:37 [error] [client 93.34. 113.18] - www.nedifreguglia.it - ​​End of script output before headers: presto.cgi, referer www.nedifreguglia.it

Since I don’t know Perl, I can’t figure out what the problem could be.
I tried to insert the 7 ContainerControls both at the IDE level and with the EmbedWithin method, but the result doesn’t change.
Can someone help me?

Thanks everyone!

Nedi

That error just means that the app crashed while responding to a request.

Make sure you have code in the App.UnhandledException event which writes the error to a file. I suggest setting up the textoutputstream for that event when the app launches so you don’t have the additional overhead of creating that socket when the app is already in a bad state.

If you don’t get an error from that, you’ll need to look in the system logs on the computer under /var/log. The kernel log (Ubuntu calls it kern.log) may have an entry with your app name indicating why it crashed.

Now to be fair, if you get here, you’ve got drastic changes to be made. The most common reasons for this kind of crash are:

  1. Out of memory - your app used up all available memory and then asked for more.
  2. System monitoring. This can take multiple forms but the most common is that your app was using too much cpu for an extended period, and was killed by the system because it decided your app had hung.

Thank you, Greg, for your answer.

Make sure you have code in the App.UnhandledException event which writes the error to a file.

Yes, I have code in App.UnhandledException event.

I suggest setting up the textoutputstream for that event when the app launches so you don’t have the additional overhead of creating that socket when the app is already in a bad state.
It seems to me a good idea: I’ll do it soon.

What makes me driving mad is that the app goes down only when that Container is displayed, and even I don’t do anything.

The /var/log is on the Linux server? If so I can’t do anything, because it is a shared server.

Well there’s your problem right there.

1 Like

I suspected that was the problem…

Thanks a lot, Greg!

Just for clarity, on shared servers, the agreement often lets the host shut down long running or memory intensive processes, even if it’s short. Xojo web apps fall into both categories.

Thanks Greg!
As always you are clear and competent!