debug mode?

Is there a way to run a cgi-bin app in some sort of debug mode that will dump more information that it normally outputs?

reasoning:
I am running into an error 500 and I get only 1 line in access_log and 1 line in error_log for the app. the error_log aborts the app with an error code 500 premature ending of script (doing the message from memory so bare with me). the access_log line is the URL that called the cgi-bin app.

I can run the *.cgi and it tells me that I dont have a valid browser.
I can run the app but it immediately exits (aborts?).

I have put in lines all over the place to write to a logfile. The only lines that get executed is the app.open() ones. the app.close() doesnt write out. session.open() doesnt. nothing does (except app.open() ). And since I am a WE n00b, I am trying to brute force my way through this but I keep tripping over my own feet. so bare with me.

thanks
sb

Launch the app with strace, assuming Linux deployment. It will dump a whole lotta information whichmight help you zero in on what’s going wrong.

yes it is a linux box. it is a hosted enviroment so I am not sure if I have strace or not. I didnt think of it. I will check it out tonight.

thanks!!

For what it’s worth, 99% of the time when you get an error about a premature ending of script (or something similar), the problem is that the app is crashing either due to missing libraries or because of something in App.Open.

as far as I can tell the libs are there…

and the only thing in the App.Open() is opening the logfile, and writing to it. (2-3 lines total).

and it is probably something I have done.

Perhaps an IOException when writing to the log file? It is notorious for not throwing catchable exceptions in the App.Open event.

Another thing to try would be using a shell object and writing to a file using the echo command. Something like:

echo "loginfo" >> log file.txt

could be an IOException. but the logfile gets the writes from app.Open() but none of the other tries. I will try disableing them to see if that helps.

OK… I am a complete complete idiot… like in a new level of idiot. I was calling the app itself in the iframe URL instead of the .cgi file. I like a complete n00b.

thanks everyone for helping me out.

Yea! Fixed!