My web app works fine in the IDE but when deployed to Apache2, I get these 2 errors repeatedly (thousands) logged to /var/log/apache2/site-error.log
[Sat Jan 30 13:31:54.987127 2016] [cgi:error] [pid 14526] [client 10.10.0.82:64678] AH01215: Can’t use an undefined value as a symbol reference at /mnt/data/www/site/cgi-bin/app/app.cgi line 118., referer: https://site/cgi-bin/app/app.cgi
[Sat Jan 30 13:31:54.987269 2016] [cgi:error] [pid 14526] [client 10.10.0.82:64678] End of script output before headers: app.cgi, referer: https://site/cgi-bin/app/app.cgi
Line #118: print $sock $body;
No additional information in Apache’s error.log
I have
successfully connected to MySQL from the web server using the credentials app.cgi is configured to use (and pulled data from the DB)
zipped up the build files in a tar ball, used FileZilla (in Active mode) to copy the files to the server
verified permission and ownership of all files and directories
copied files/directories to the server using just FileZilla (in Active mode) – This is normally the method I use to update the files and haven’t had any issues in the past
I have a few other Xojo cgi apps running just fine on the same server. They also connect to the same MySQL server.
The app is successfully establishing a connection to the MySQL server as noted in the app’s log file. The app is rapidly respawning with the “undefined value” messages I noted above.
{"timestamp":1454189041,"num":0,"desc":"Database","msg":"Attempting to establish connection to SQL Server..."}
{"timestamp":1454189041,"num":0,"desc":"Database","msg":"Connection successful"}
Where does System.DebugLog write its output on Ubuntu? I haven’t been able to find anything in the traditional log files. I also added a line to write to the same log file I used for the MySQL (as noted above) and nothing appears there either.
[code] If error <> Nil Then
Dim type As String = Introspection.GetType(error).Name
System.DebugLog(type + EndOfLine + EndOfLine + Join(error.Stack, EndOfLine))
LogToFile(Error.ErrorNumber, type, Error.Message + EndOfLine + Join(error.Stack, EndOfLine))
Thanks Albin. The docs say [quote]On Linux, it prints the message to StdErr.[/quote] From what I can find, StdErr is simply output to the console. If that truly is the case, I get nothing which would mean I’m not receiving any UnhandledExeceptions. What else would be causing the
[Sat Jan 30 13:31:54.987127 2016] [cgi:error] [pid 14526] [client 10.10.0.82:64678] AH01215: Can't use an undefined value as a symbol reference at /mnt/data/www/site/cgi-bin/app/app.cgi line 118., referer: https://site/cgi-bin/app/app.cgi
[Sat Jan 30 13:31:54.987269 2016] [cgi:error] [pid 14526] [client 10.10.0.82:64678] End of script output before headers: app.cgi, referer: https://site/cgi-bin/app/app.cgi
messages to scroll continuously in the apache2 error log?
Thought I had it resolved by updating e-CryptIt and compiling my app as 64-bit. That lasted all of about 3 mins. before the same thing occurred again. There are 7 of us using this app (trying to use it) so I don’t understand why it is having such a hard time. When running in the debugger, the app performs just fine but when deployed…
Any more thoughts on what is causing my app to run so dog dang slow?
Don’t make that assumption. Put code in App.UnhandledException and check for yourself.
The reason I say this is that running an app as a CGI app changes the behavior of StdOut, StdIn and StdErr, so that info is probably being redirected to a log file somewhere.
After upgrading the e-CryptIt engine and compiling for 64-bit on Linux, the errors have not returned but the app still exhibits the exact same symptoms. I have been working with the apache2 configuration for the site to log CGI errors to /var/log/apache2 but haven’t been able to get apache to create the file and log anything.
Tonight I figured I’d do a standalone build for OS X since I don’t run into any of the issues during debug. Multiple users can access the app without delay and I receive no crash. After building and running the app, I get the following from StdErr on my Mac. Not the foggiest about what it is but hope someone can shed some light. These repeat on the console.
Replacing all .StringValue statements with DefineEncoding(rs.Field("account_name").StringValue,Encodings.UTF8) seems to have fixed the BadDataExceptions but the CGI built application is still running super dog slow. No errors or CGI script output so I have nothing to go off of.