(Answer) (Category) Faq-O-Matic Faq-O-Matic : (Category) Administrators' Guide : (Category) Troubleshoot :
The cron job fails to invoke maintenance script.
Gary McClellan (gdmccleATdlriDOTcom) reports that in his case, it was because his IP-aliased linux box didn't have a route to its own aliased IP addresses, so the cron job, which makes a simple HTTP request to the server on the same machine, couldn't "see" the http server.

If you're having problems with this, try replacing your cron line with a call to lynx or snarf (see URLs below) to access the same URL. This will narrow down whether the problem is in the faqomatic Perl code, or in the HTTP query process.

Snarf is at:
http://xach.dorknet.com/snarf/
ftp://ftp.mint.net/pub/linux/src/snarf-latest.tar.gz

I am getting a permissions related error that is preventing the maintainence script from running.  
Any ideas on how to get around this one without getting rid of the authentication?

----------------------------------------------------

Unable to invoke maintenance task; HTTP reply follows:

HTTP/1.1 401 Authorization Required
Date: Tue, 10 Apr 2001 20:34:00 GMT
Server: Apache/1.3.14 (Unix) mod_ssl/2.7.1 OpenSSL/0.9.6
WWW-Authenticate: Basic realm="Kintana Internal FAQ"
Connection: close
Content-Type: text/html; charset=iso-8859-1
I'm getting a strange error message when cron tries to run the maintenance:

Subject: Cron <nobody@linux> /usr/bin/perl -e 'use lib

    "/usr/lib/perl5/site_perl/5.005"; use FAQ::OMatic::maintenance;
FAQ::OMatic::maintenance::cronInvoke("www.pharmadata.fi", 80,
"/cgi-bin/faq?cmd=maintenanc

Unable to invoke maintenance task; HTTP reply follows:

HTTP/1.1 302 Moved
Date: Thu, 10 May 2001 15:48:00 GMT
Server: Apache/1.3.9 (Unix) (Red Hat/Linux) mod_auth_pam/1.0a PHP/4.0.4pl1 mod_perl/1.21
location: /cgi-bin/faq?cmd=displaySlow&slowFile=slow-output.989509681p20594
Connection: close
Content-Type: text/plain

I have looked a bit in the code, and it seems like the maintenance tries to find a HTTP/1.1 200 OK reply but gets confused when it finds a 302 instead. I just wonder why the maintenance task wants to show its output with the displaySlow thing, I'd think it's only useful for "interactive" use. Is this a bug in Faq-O-Matic (CVS version dated a few days ago, the version identifier seems to be 2.711d) or is it something weird in my own setup? Any help with this will be appreciated :)

This problem appears to be fixed (or worked around) in CVS. The fix is to replace the following line in maintenance.pm

        if ($code != '200') {

with

        if ($code != '200' && $code != '302') {

[Append to This Answer]
Previous: (Answer) Perl died: Can't locate object method "isaCGI"
Next: (Answer) crontab: you are not authorized to use cron. Sorry.
This document is: http://www.jonh.net/cgi-bin/faqomatic/fom?file=154
[Search] [Appearance]
This is a Faq-O-Matic 2.718d.
Hosted by SourceForge Logo and jonh.net.