I have commented ALL code out except for the following and I still receive an Internal Server Error (500) when sending a request to the /api URL. Please tell me why this is happening.
Apache error log shows (I’m obviously building this for Linux)
[quote][Mon Mar 30 00:19:08.497859 2015] [cgi:error] [pid 15746] [client 10.10.0.8:33239] AH01215: Can’t use an undefined value as a symbol reference at /mnt/data/www/api/cgi-bin/stripewh/stripewh.cgi line 118.
[Mon Mar 30 00:19:08.498666 2015] [cgi:error] [pid 15746] [client 10.10.0.8:33239] End of script output before headers: stripewh.cgi[/quote]
[quote=177356:@Scott Rich]I am past screaming on this one!
I have commented ALL code out except for the following and I still receive an Internal Server Error (500) when sending a request to the /api URL. Please tell me why this is happening.
Apache error log shows (I’m obviously building this for Linux)
That particular log error usually means the app is starting but then being quickly terminated before a response is generated. This usually happens because of a couple things:
Something in the App.Open event is causing an exception. This could be an invalid FolderItem or some other assumption about the environment that does not hold true and is not handled correctly via exceptions.
Suexec policies are killing the app. This is usually caused by giving the cgi-bin, app folder, or app binaries/cgi files too much permissions. Suexec will enforce CGI apps having CHMOD 755 at maximum.
I have also seen this sometimes where the binary is corrupted. This is most often caused by FileZilla uploading in ASCII mode vs Binary mode because it’s “auto-detect” feature handles Xojo apps poorly. In FileZilla you can overwrite this setting with the Binary setting.
It’s also sometimes caused by uploading the wrong binary. It’s very easy to accidentally build a Mac binary and then upload to a Linux server because they look the same.
Some things to try:
log into the terminal and just try to launch the app manually. If there is a corrupt binary, you’ll probably get errors printed in the terminal.
Make sure you are uploading everything. Users sometimes forget to upload the Libs directory.
Run the app with ldd. This will show you the missing dependencies if there are any: ldd yourAppName (the one without the .cgi extension)
Also, can you tell us a little about the server you are running the app on? Flavor? Version? 32 or 64 bit?
-rwxr-xr-x 1 www-data www-data 56 Mar 30 00:19 config.cfg
drwxr-xr-x 3 www-data www-data 4096 Mar 30 00:18 Resources
-rwxr-xr-x 1 www-data www-data 3269477 Mar 30 00:18 stripewh
-rwxr-xr-x 1 www-data www-data 7023 Mar 30 00:18 stripewh.cgi
drwxr-xr-x 2 www-data www-data 4096 Mar 30 00:18 stripewh Libs
-rw-r--r-- 1 www-data www-data 277 Mar 30 00:18 webapp.conf
I use Macfusion (SSHFS) to copy the files. I have also used Filezilla in binary mode with the same results.
[quote]Greg: 1. log into the terminal and just try to launch the app manually. If there is a corrupt binary, you’ll probably get errors printed in the terminal.
[/quote]
OS: Ubuntu 14.04 LTS (64-bit)
uname -a: Linux web 3.13.0-48-generic #80-Ubuntu SMP Thu Mar 12 11:16:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Apache 2.4.7
In order to get another Xojo app to run, I had to install the ia32-libs which I really didn’t want to do since it installs so many files I’m sure I don’t need. Is there a way to force 64-bit compilation instead of 32-bit?
I have been using MacFusion to drag and drop the files from my MBP to the web server. I assumed since I was using a SSHFS connection, file operations were all done in “binary” mode. When I tried Filezilla (in Binary mode), it was after I ran the file from the CLI as Greg had suggested and received the same results. It wasn’t until my last post responding to Philip that I realized the app that was copied using MacFusion was still running.
Killing the process and using Filezilla again to transfer the build solved the issue.
** Note to all: MacFusion using SSHFS does the same thing to the build as Filezilla in text mode does.
Thanx to all who helped me resolve this issue. I can always count on you when I get thoroughly frustrated.
[quote=200070:@Sergio Tamborini]I have the same problem now, and I can’t solve using filezilla
Anyone have other suggestions? My web-app was working…[/quote]