Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Why CGI is hard debug

by blackjackstory.com (Initiate)
on Oct 27, 2021 at 21:05 UTC ( [id://11138123]=perlquestion: print w/replies, xml ) Need Help??

blackjackstory.com has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Why CGI is hard debug
by dave_the_m (Monsignor) on Oct 27, 2021 at 22:06 UTC
    The 500 error is the error the web server sends to the browser. Any error messages produced by the script will go the web server's error log. If there is no error log file, that means the web server has been misconfigured.

    Is this related to to the "cgi HTML head error" thread?

    Dave.

Re: Why CGI is hard debug
by davido (Cardinal) on Oct 28, 2021 at 16:43 UTC

    A COBOL application probably isn't spewing errors to the general public's web browsers. To do so can expose security vulnerabilities. So the more common approach is to spew a 500 Internal Server Error (to not expose more than is needed), and to log the error to error logs on the web host.

    What gets logged is up to the person who developed the web application or CGI application. If the diagnostics aren't sufficient, add better diagnostic information to the error messages. While you're at it, make sure that you're actually handling errors usefully; that you're logging somewhere in the first place. And make sure that there are logfiles configured.

    Debugging CGI is something you have to design into your CGI application. If a COBOL application were interacting over the CGI you would be facing the same concerns; this isn't a Perl-specific issue. There's nothing other than sanity preventing you creating a CGI application in COBOL. Once you do that, you'll find it equally challenging (perhaps more-so) to debug in a CGI environment. The point is that CGI layers in a whole other element of complexity, and that complexity has to be managed through more meticulous application design and architecture.


    Dave

      There's nothing other than sanity preventing you creating a CGI application in COBOL.

      Somewhere in a strange, off-kilter dimension there's a poor shoggoth commiserating while shuffling his punch cards and saying "You know that's right" . . .

      The cake is a lie.
      The cake is a lie.
      The cake is a lie.

        I just googled "COBOL CGI" and there are both open and closed source COBOL implementations providing a CGI interface, and I even find a working COBOL CGI form (with source code). I am appalled and amused at the same time.
Re: Why CGI is hard debug
by haj (Vicar) on Oct 27, 2021 at 22:40 UTC

    Debugging web applications is something which can be learned. And, not unlike debugging COBOL, it must be learned for a successful debugging experience. I'd say it is easier to learn than debugging COBOL mainframe applications because the documents are readily available.

    A status code 500 is sent to a web client to indicate an error which is not the client's fault. You need to check the server's log files for details. I could wade through your article to the text script not found or unable to stat and after this message a well configured Apache should write the file path (not the URL!) where it looked for your CGI program.

    So, most likely, either the file doesn't exist, or it isn't readable and executable by the web server's user id, or Perl is not installed as /usr/bin/perl. But we can't tell. If the error message doesn't contain the path, ask to your hoster to improve the error logging (the LogLevel directive in Apache).

A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11138123]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2024-04-23 16:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found