Can not seem to get the most basic new web app (cgi) running (after lots of previous successes)

Same server all my other programs are running on - CentOS.
New sub directory (like other sub directories) in same directory where other programs are running their respective sub directory.
Tried compiling with 2015.2.1, 2.2, 2.4 - all now fail whereas program was working fine before I recompiled it.
No errors in logs.

New app = 1 webpage with 1 label. (just for test purposes - nothing more than that).

  1. Compile.
  2. Verify permissions for app on server.
  3. Update .htaccess to include AddHandler cgi-script .cgi (just like I have been doing for a year now)
  4. Launch via URL in browser (Firefox latest).
  5. Internal Server Error (no other information) upon launch (do not see the ‘launching…’ message appear during launch).

Any clues? Hints?

FYI - 64-bit library has already been updated, and other CGI app compiled previously with 2015.2.2 is working fine.

Back to being very frustrated - spending too much time trying to get basic crap working. Everything has been doing so well - why can’t I figure this out!?!?

One thing that I always forget is the permissions on the parent folder of the app.

Another problem I’ve had is exceptions that occur in the App open event. Do you have any logging features? If so I’d put some in the application and session open events and see if they’re actually finishing. If the open events have an exception and bail it may not be possible to recover from it. Logging will at least start narrowing it down.

I guess the other thing to check is the unhanded exception events. Make sure you’re logging that info and returning true from it. You’re probably already doing that but it’s worth asking.

Thanks Bob - I will take a look at those things.

I assume you made sure to kill the program before uploading the new one ?

Is this accomplished by the system.debuglog method? I have put that in my app.open event, but when I run on the server nothing is showing up in the Error Log (I am using cPanel on a GoDaddy Linux Server to see the Error Log). Is there a different way to register errors to a server that may get reflected in the cPanel Error Log?

My experience is that if the current program is running then I will not be able to transfer the new version to the server. I did a quick peek via Top command (SSH) and didn’t see the program running - is there a better way to see if it is running?

OK - I found the Jobs command as well. I think that helps also.

Did you load the icu library? If you try launching the app from the command line, it might give some other hints about missing libs. If the version of Xojo you compiled with is newer than what the running apps on the server were compiled with, it’s probably a missing lib.

Yes - I did that.

OK - using SSH, I am in the directory where the .cgi file is. What is the command I use to run the program?

[quote=212116:@Mark Pastor]My experience is that if the current program is running then I will not be able to transfer the new version to the server. I did a quick peek via Top command (SSH) and didn’t see the program running - is there a better way to see if it is running?

OK - I found the Jobs command as well. I think that helps also.[/quote]

Ps Aux

Will show you all the running processes. You may filter that with Grep to show only you program

ps Aux | grep myprogram

Will show you only the results with ‘myprogram’ in them.

Not in my experience, no. You can upload whatever you want, even if the CGI is running and has sessions active. What happens is that if the program is running into memory, that version will prevent the launch of the new copy with an error, what you just described.

In order to update the app, you got to kill the running process, and then, next time the CGI is called, that will load the new version from disk.

You will probably benefit from Phillip Zedalis wisdom here
http://www.dev.1701software.com/blog/2013/09/08/upgrading-xojo-cgi-apps

[quote=212166:@Michel Bujardet]Will show you all the running processes. You may filter that with Grep to show only you program
ps Aux | grep myprogram
Will show you only the results with ‘myprogram’ in them.[/quote]

Thanks Michel - I checked - program not running.

[quote=212166:@Michel Bujardet]You will probably benefit from Phillip Zedalis wisdom here
http://www.dev.1701software.com/blog/2013/09/08/upgrading-xojo-cgi-apps [/quote]
Good idea - will consider this moving forward.

To my earlier question - Can anyone help with what command I use to run my program from Linux via SSH shell?

[quote=212184:@Mark Pastor]Thanks Michel - I checked - program not running.

Good idea - will consider this moving forward.

To my earlier question - Can anyone help with what command I use to run my program from Linux via SSH shell?[/quote]

If it is a cgi program, you do not run it from SSH. You point to it in a browser.

OK - that is what I have been doing. I was trying to follow the suggestion offered earlier in the thread (copied below).

From all I know, it is not possible to launch the executable that comes within the CGI files. It is not a standalone program.

Greg will correct me if I’m wrong, but you can launch the Xojo app for a CGI build from the command line. It won’t do much since it needs to wait for a web server to communicate with it via CGI, but it will at least tell you if it launches. And this can sometimes pinpoint if the CGI itself is having trouble starting the app.

Running it from the command line is the same as usual:

./MyAppName

[quote=212200:@Paul Lefebvre]Running it from the command line is the same as usual:

./MyAppName[/quote]

./jmwtest
“Segmentation Fault”

./jmwtest.cgi
Use of uninitialized value $ENV{“REQUEST_METHOD”} in string eq at ./jmwtest.cgi line 110.
Can’t use an undefined value as a symbol reference at ./jmwtest.cgi line 118.

Any insights?

It means the app crashed badly.

http://blog.xojo.com/take-a-core-dump-linux

Updated info…

./jmwtest
“Segmentation Fault”

./jmwtest.cgi
Use of uninitialized value $ENV{“REQUEST_METHOD”} in string eq at ./jmwtest.cgi line 110.
Can’t use an undefined value as a symbol reference at ./jmwtest.cgi line 118.

Any insights?

[quote=212200:@Paul Lefebvre]Greg will correct me if I’m wrong, but you can launch the Xojo app for a CGI build from the command line. It won’t do much since it needs to wait for a web server to communicate with it via CGI, but it will at least tell you if it launches. And this can sometimes pinpoint if the CGI itself is having trouble starting the app.

Running it from the command line is the same as usual:

./MyAppName

My bad. I should have said “it does nothing”. But indeed it allows debugging. Thanks.

[quote=212206:@Mark Pastor]./jmwtest
“Segmentation Fault”[/quote]
Review the Take a Core Dump blog post to see how to get specifics of the crash.

[quote=212206:@Mark Pastor]./jmwtest.cgi
Use of uninitialized value $ENV{“REQUEST_METHOD”} in string eq at ./jmwtest.cgi line 110.
Can’t use an undefined value as a symbol reference at ./jmwtest.cgi line 118.[/quote]
You cannot run the actual CGI file from the command line.

Yeah, there should be an app in there with a similar name as the .cgi. That’s the file you want to run (./appname) to see if there are any errors launching it.