Common issues resulting in Internal Server Error

Okay, so I’m sick of looking “Internal Server Error” when I try to run my web application on the host.

I’m creating a CGI application, with port set to automatic and I’ve ensured that all the files created by Xojo have the permission 755, yet I’m constantly getting “Internal Server Error”.

Just wondering what are the common issues that can cause this and any tips on being able to resolve this myself. It seems like this entire process is a bit hit or miss and makes me very nervous about my choice of Xojo (at least with PHP, I’ve never had an Internal Server Error, let alone constantly getting it).

Is there an errors.log file in the same dir as the binary?
And if not, is that dir set to be writable by whatever user owns the web server (may be apache / nobody / www-data)?
I usually give the containing dir has permissions 777 at first, just to be sure (but don’t do that recessively).

You also need to make sure config.cfg is writable by the web server user too (I often give it permission 666).

You can also check the web server log files for a bit more info on the error :slight_smile:

[quote=136033:@Sam Rowlands]Okay, so I’m sick of looking “Internal Server Error” when I try to run my web application on the host.

I’m creating a CGI application, with port set to automatic and I’ve ensured that all the files created by Xojo have the permission 755, yet I’m constantly getting “Internal Server Error”.

Just wondering what are the common issues that can cause this and any tips on being able to resolve this myself. It seems like this entire process is a bit hit or miss and makes me very nervous about my choice of Xojo (at least with PHP, I’ve never had an Internal Server Error, let alone constantly getting it).[/quote]

Have you had any luck before on that particular host, or is this the first Xojo app you try to run on it ? Are there other running Xojo apps there ?

Not all of the files should be set this way. The executable, .cgi, Libs directory and its contents should all be set to 755. If you have any helper apps, they should be set this way also. Just about everything else will only need 644, and I’ve seen servers which will give you a 5xx error is a log file is set to be executable.

Some hints:

  • It is very important that the .cfg file have the right permissions because the .cgi script must be able to write to that file.
  • if you have command line access, try running the binary like this: ldd MyApplication. That will show you if there are any dependencies missing.
  • Are you using shared hosting? You might want to check with your hosting company to see if they allow binaries. Some do not and require you to use a VPS.
  • Some servers are configured to only allow .cgi files to run from a particular folder. Again, you’ll need to check with your hosting company to see if this is the case.

Regarding the comments above about using permissions of 666 and 777. If you are on a shared hosting server, this is a really bad idea. You’re essentially telling the server that anyone on the server has the ability to read/write to your files and with 777, execute them. If you’re on a VPS, it’s less of an issue since you are technically on the server all by yourself.

Absolutely, my apologies, should have mentioned this is only for debugging, and I never run Xojo web apps from a shared host as it’ll likely be disallowed port access/binary execution etc. With a VPS or dedicated server of any sort at least you can control access and what is installed (e.g. 32bit libs etc), there’s too much hassle with a shared host.

Hi Guys and thanks for all the tips. Philip was able to help frustrated ole me, it turns out that I already had an instance of the application running. Once I SSH in and killed the little shit, everything worked.

Just very frustrating when you keep getting the same useless error message!

[quote=136186:@Sam Rowlands]Hi Guys and thanks for all the tips. Philip was able to help frustrated ole me, it turns out that I already had an instance of the application running. Once I SSH in and killed the little shit, everything worked.

Just very frustrating when you keep getting the same useless error message![/quote]

Glad to read you got that solved.

See http://1701software.com/blog/upgrading_xojo_cgi_apps.php Phillip Zedalis advice to facilitate app upgrading and avoid what just happened to you.

Internal Server Error can come from a lot of different places, do you remember if there was any more information on the browser describing the error?

Digging up this old thread as once again, I face the dreaded internal server error. I killed the app prior to replacing it, uploaded the new one and now all I get is this message. This is a live production app, so downtime will cost me this time!

I’ve checked the permissions and they’re 755 across the range. Any ideas?

Philip Zedalis saved my bacon again! It was my bad.

Sorry to reopen the issue,
but today I have made a change to a webapp that is working fine since 2 years on a dedicated server, and I have seen the “Internal server error” page.
after some digging I have discovered that the issue depends on the version of Xojo used, also in a one-button test application.
if I compile with a version up to 2014 R3 all is fine, from 2015 R1 I see the Internal error

looking at the logs:

Failed to find/load Framework path_to_cgi_folder/./RBConsoleFramework.so: cannot open shared object file: No such file or directory

and that’s strange: the libs folder contain a XojoConsoleFramework32.so, it seems that it is searched with an old name related to RB

Can’t use an undefined value as a symbol reference at /home/flippermusic.it/public/cgi-bin/test2015/test2015.cgi line 118.

Premature end of script headers: test2015.cgi

thanks in advance

 Giulio

Hi, sorry for reopening this topic.

I do have the same issue as Giulio described in the ending-post.
I can use 2014.R3 for a new app, but with the actual version I got the Internal error .

@Anybody how do I solve this?
@ Giulio, did you find a solution?

Best regards,
Marc

All three of the errors above are the app crashing. Make sure you have implemented the two UnhandledException handlers so yo can see what’s failing. There’s one in app and one in Session.

Hi Greg O’Lone,

Thanks for your reply, but it is not solved for me.
I made a new conversation, describing exactly what I have done.
Hope you can take a look here: https://forum.xojo.com/31111-deploy-on-vps-getting-error-500

Best regards,
Marc

I was getting “Internal Server Error” on a small app running on a VPS that runs a couple other apps without issue. The app has only one page with four containers and a segmented control on it. All four contains were the same size and at the same location. The app ran fine in the the Windows debugger, but I not on the linux VPS. Moving the containers just one or two pixels so they were all in different locations solved the problem.

Another thing that caused an Internal Server Error was I had set all the permissions to 755 using a feature of my FTP program that sets an entire directory to the same permission. Once I set .htaccess back to 644, everything worked. The config.cfg file must be set to 777.

Having a prior instance of the app still running can also cause a problem. This is probably old hat to Mac users, but most of us Windows guys need some help with Linux. I use WinSCP to enter this terminal command

[quote]ps aux | grep -i webapp[/quote] where webapp is the name of the app. The result will show the the process number in the second column on the left. Then enter

[quote]kill -9 12345[/quote] where 12345 is the process number from the previous command.

644 or 666 should work for this file. There’s no reason for it to be executable.

As for killing the process, you could also use:

killall WebAppName