cgi: Internal Server Error

After installing a first version on my server everything was fine, but in an update stopped working and gives a 500 error:

At first it left:

[Thu Oct 26 15:22:45.576063 2017] [cgi:error] [pid 28286] [client
213.151.116.122:37716] AH01215: Can’t exec
“/var/www/vhosts/midominio.org/cgi-bin/asa/asa”: Permission denied at
asa.cgi line 186.
[Thu Oct 26 15:22:45.576252 2017] [cgi:error] [pid 28286] [client
213.151.116.122:37716] AH01215: Can’t use an undefined value as a symbol
reference at asa.cgi line 118.
[Thu Oct 26 15:22:45.576622 2017] [cgi:error] [pid 28286] [client
213.151.116.122:37716] End of script output before headers: asa.cgi

I have put the execution bit to the file “asa.cgi” and in the following call gives:

[Thu Oct 26 15:23:09.711691 2017] [cgi:error] [pid 28285] [client
213.151.116.122:37727] AH01215: Can’t use an undefined value as a symbol
reference at asa.cgi line 118.
[Thu Oct 26 15:23:09.712137 2017] [cgi:error] [pid 28285] [client
213.151.116.122:37727] End of script output before headers: asa.cgi

Line 118:
print $sock $body;

It appears that the $sock variable is not initialized correctly.

Does anybody know how I can fix it ? I do not know what to do.

Thank you.

Did you stop the old process before updating?

In some Linux distros (tested with RHEL/CentOS) this problem is new after a update of APACHE. Removing the .htaccess in the root directory of the application solves this Error 500 problem (don’t know why and didn’t investigate deeper), but it works.

http://www.dev.1701software.com/blog/2013/09/08/upgrading-xojo-cgi-apps

I have implemented the Timer solution.
I uploaded a new compiled , changed permissions and it worked.

But I compile changes, with the same permissions and again error 500.

It is very unstable. When it works I do not dare to upload changes.

[quote=356987:@Cecilio Ruiz Fernandez]I have implemented the Timer solution.
I uploaded a new compiled , changed permissions and it worked.

But I compile changes, with the same permissions and again error 500.

It is very unstable. When it works I do not dare to upload changes.[/quote]

Once you have the Web app working, before uploading the updated files you have to delete the CGI file, and wait over 5 seconds. That will stop the app. Then you can upload the new files.

The timer solution isn’t designed to stop Error 500. It simply lets you easily stop the app when that happens. What I did to the timer method is add a condition to kill the app when all sessions are gone:

Dim f As FolderItem f = GetFolderItem("") f = GetFolderItem(f.NativePath + Lowercase(App.ExecutableFile.Name) + ".cgi") If (f.Exists() = False) Or App.SessionCount = 0 Then App.Quit() End If

That way, if you have an Error 500 and sessions are gone, the app will die automatically, without you having to rename or delete the CGI file.

You will get an Error 500 when you update your Web app if that app was running when you did the update. The timer solution simply lets you easily kill the app before doing the update. Sounds like you updated your app without first making sure the app was killed.

I’m having the same problem

IDE Mac 2018r1.1
CGI LINUX 64bit

In the terminal type “sudo killall [appname]” replace [appname] with you r app name sto stop the process. Then Re-upload in Binary Mode without opeing it in the browser. Set file permissions.

Open in browser.