HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- perl script getting http:500 response
Operating System - Linux
1827810
Members
1925
Online
109969
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2007 02:11 PM
01-04-2007 02:11 PM
Hi guys,
I have written a perl script to post http message to a server and I am getting a response of 500 - Internal Server Error. There are no problem posting to other server so I am thinking if it is a problem with their server or simply a connectivity issue. What do you think?
Best regards
Henry
I have written a perl script to post http message to a server and I am getting a response of 500 - Internal Server Error. There are no problem posting to other server so I am thinking if it is a problem with their server or simply a connectivity issue. What do you think?
Best regards
Henry
Solved! Go to Solution.
- Tags:
- Perl
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2007 02:36 PM
01-04-2007 02:36 PM
Solution
Shalom,
This is almost always a scripting erorr, not a network connectivity problem.
Issues I've faced in the past on this:
1) perl script tries to read a file that is not there, dies.
2) permissions on a file it needs to read is not correct.
3) Data format it needs is not what it gets.
4) Debugging print statements in the program that can be run in production.
5) Output lines at top of script commented out.
Normally I find the script and at the least get it to run properly at the command line, even if there is no ouput if that doesn't work, I next comment out the output statement redirecting output to http/text and put in write/print statements to figure out what part of the code is bad.
SEP
This is almost always a scripting erorr, not a network connectivity problem.
Issues I've faced in the past on this:
1) perl script tries to read a file that is not there, dies.
2) permissions on a file it needs to read is not correct.
3) Data format it needs is not what it gets.
4) Debugging print statements in the program that can be run in production.
5) Output lines at top of script commented out.
Normally I find the script and at the least get it to run properly at the command line, even if there is no ouput if that doesn't work, I next comment out the output statement redirecting output to http/text and put in write/print statements to figure out what part of the code is bad.
SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2007 08:04 PM
01-04-2007 08:04 PM
Re: perl script getting http:500 response
Hi Henry,
as SEP suspects, this most likely seems to be a scripting error.
Usually the 500 HTTP RC is owed to a malformed HTTP server response header.
To avoid this it is recommended practise to rather rely on well established standard CGI modules like CGI.pm than doing the HTTP formatting, parsing and encoding by some self tinkered routine (unless you know the HTT protocol intimately and have well justified needs).
This is what the average HTTP response header should look like:
$ perl -MCGI=header -le 'print header'
Content-Type: text/html; charset=ISO-8859-1
Please, note that the HTTP header requires a CR/NL separator, which can be seen when dumped:
$ perl -MCGI=header -le 'print header'|od -c
0000000 C o n t e n t - T y p e : t e
0000020 x t / h t m l ; c h a r s e t
0000040 = I S O - 8 8 5 9 - 1 \r \n \r \n \n
0000060
But if, as you say, you are using the same Perl CGI script successfully on another server where you don't receive the 500 RC,
it probably isn't a header problem.
To find out what really causes the 500 you need to inspect that webserver's error.log for possible hints in the error message.
An alternative would be (just for debugging purposes) to dump the error messages wrapped up in HTML to your browser by inserting this import in your Perl CGI script on that webserver:
use CGI::Carp qw(fatalsToBrowser);
as SEP suspects, this most likely seems to be a scripting error.
Usually the 500 HTTP RC is owed to a malformed HTTP server response header.
To avoid this it is recommended practise to rather rely on well established standard CGI modules like CGI.pm than doing the HTTP formatting, parsing and encoding by some self tinkered routine (unless you know the HTT protocol intimately and have well justified needs).
This is what the average HTTP response header should look like:
$ perl -MCGI=header -le 'print header'
Content-Type: text/html; charset=ISO-8859-1
Please, note that the HTTP header requires a CR/NL separator, which can be seen when dumped:
$ perl -MCGI=header -le 'print header'|od -c
0000000 C o n t e n t - T y p e : t e
0000020 x t / h t m l ; c h a r s e t
0000040 = I S O - 8 8 5 9 - 1 \r \n \r \n \n
0000060
But if, as you say, you are using the same Perl CGI script successfully on another server where you don't receive the 500 RC,
it probably isn't a header problem.
To find out what really causes the 500 you need to inspect that webserver's error.log for possible hints in the error message.
An alternative would be (just for debugging purposes) to dump the error messages wrapped up in HTML to your browser by inserting this import in your Perl CGI script on that webserver:
use CGI::Carp qw(fatalsToBrowser);
Madness, thy name is system administration
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP