Best practices to deal with errors?

Wanted to start a thread dealing with some of the more common errors we have been getting with our Xojo Cloud to get peoples recommendations on how best to deal with them. Especially since in another thread it was mentioned that Rebooting your Xojo Cloud server should be the last resort. I think for many it would be our first resort without an explanation as to why?

We often get a ‘Mutex cleaned. Application could not launch’ message that occurs on our servers and at that point all of our applications on that server give the same message.

Our solution has been to delete the application… Then reboot the server. Then re-deploy the applications to the server. This has been okay when our environment was not live. We are about to go live so I need a better solution.

So I ask, what is the Xojo recommended course of action? Waiting for Xojo staff to resolve it is not an answer. Are we doing something wrong that is causing this error in the first place?

The mutex cleaned error is a red-herring. That error means that the mutex file, which prevents multiple copies of the same app from running at the same time, could not be removed. Usually this occurs because your app did not quit cleanly… In other words crashed.

Now just to be clear, there’s a significant difference between an exception and a crash. Exceptions like NilObjectExcptions and OutOfBoundsExceptions, even if they’re not handled by your code, will usually still cause the app to quit cleanly. ON the other hand, if your app runs out of memory, there is no opportunity for your app to do anything about it, and your app just dies. That’s considered a crash and 99% of the time when we get called in to fix this particular error, that’s what the logs tell us has happened.

Now the easiest way to deal with this on your end is to go to your control panel and just quit the app. Even though the app isn’t technically running, one of the things we do there is make sure the mutex file for that app doesn’t exist, and delete it if it does… And you don’t need to reboot the server.

Honestly, today’s server OSs are designed to run for months, if not years at a time, and while rebooting does solve your problem for that moment, it really is just a bandage until the next time it would be much better to get your app to run within the confines of the memory that it is allocated. Just remember, part of the server’s memory is used to the OS and other services that make the server run, so if you have more than one app running or have one of the database servers installed, they all use the same RAM to run in When you run out, the system will start limiting or quitting apps to make sure it has enough free RAM to stay alive.

It would be nice to get some notification of low RAM. If the app crashes because of no memory how do we know?

Thanks Greg.

We do have the app that Jason gave us that now lets us see better our memory usage and yes I do believe we have been hitting the limit of our server. I was not sure since it seemed to take down all apps. Your explanation clarifies that it can affect all apps. Is there anyway to indicate after you have quit the app that it is back available? Does quitting the app kill all instances of it running?

If there is anything we are saying here its that we need more feedback from our servers to keep us from rebooting.

A notification where ?

Email from Xojo Cloud, something on the Xojo Cloud control panel. Just…something. We currently have no way of knowing if it happens so something is better than nothing.

We have been talking about this internally and we do plan to do add something in the future.

We would gladly test any of these new features you have planned. For those of us committing to going live with our applications on Xojo cloud. The sooner you implement those features the better!