jaydon has asked for the wisdom of the Perl Monks concerning the following question:

I am getting the following error when my solaris system was rebooted:

Error: 500 Can't connect to www.somesite.com:80 (Bad protocol 'tcp')

This is when I run a perl script that previously worked. I tried to run another script that uses https and I get the same error for port number 440:

Error: 500 Can't connect to www.anothersite.com:443 (Bad protocol 'tcp')

The scripts utilize the Perl LWP and WWW::Mechanize modules respectively

When I googled for this error, I found a response that said to set the $SYSTEMROOT variable after the reboot. However, since I'm on a unix system, I don't the its unix equivalent. The value it said to set was 'C:/WINNT'

Has anyone encountered this problem? How do I fix it?

Replies are listed 'Best First'.
Re: weird 500 Error after system reboot
by samizdat (Vicar) on Jul 21, 2005 at 21:30 UTC
    jaydon, we need more info, though this is much more a system configuration problem than a Perl problem and would probably better be discussed on a system admin board than PerlMonks. What has almost certainly happened is that somebody changed a configuration value on the server using an active program (ifconfig or route add or something like that) but did not change the disk-resident bootup configuration files to reflect that change. Given that it's port configuration that's being bounced, I'd look first with ps to see if the httpd daemons are actually running.
    ps -a | grep httpd
    Then, i'd look at /etc/inetd.conf (not sure if that's what Solaris uses; that's the FreeBSD name for it) or /etc/services to make sure that those ports are enabled.

    Beyond that, we'd need more info on what's running where and how it all is set up.

    update: Solaris appears to have a few variations in its ps from what I'm used to: ps -A or ps -e would be more appropriate.

      Thanks for your response. I'm not the sysadmin type, so I don't really know about the httpd daemons, but there's none running now, and I was told that there weren't any running before the reboot either. I cannot know for sure if that was true.

      I've been able to reproduce the error on the command line:

      /qhds/bin/perl -MLWP::Simple -e "getprint('http://www.yahoo.com')"

      My sisadmin says he's never seen this error before either. We duplicated this problem on another box, so it might be something to do with our network. So now, I can't connect to the internet with LWP at all:(.

        Okay, check for firewall rules if you're a gateway or at your gateway/router. Can you do ping, traceroute, ftp, etc.?

        You didn't make it clear where the system was that you were trying to connect to, but slurping yahoo is probably not a good idea. I know they've blocked several UN!X services because of traffic issues. Try another simpler site before you assume that it's a problem.
Re: weird 500 Error after system reboot
by Fletch (Bishop) on Jul 21, 2005 at 23:44 UTC

    On a *NIX variant usually /etc/protocols would be where the name to protocol number mapping would be, but given this is a Solaris box it could be trying NIS instead (depends on how /etc/nsswitch.conf or the like is configured). But yes, this is a problem for your sysadmin (be prepared with offerings; beer, pizza, and skittles are good choices to have on hand).

    --
    We're looking for people in ATL

Re: weird 500 Error after system reboot
by derby (Abbot) on Jul 21, 2005 at 23:43 UTC

    I would check /etc/protocols to see if it's there and if there is an entry for tcp in it.

    -derby