Welcome Guest, Not a member yet? Register   Sign In
CRON: "incorrect headers"
#1

[eluser]Peter Dräxler[/eluser]
Hi guys.

I have UBUNTU 10.04 server. I'm want to scheduled tasks with CRON. I'm managing it using Webmin 1.520.
When CRON executing many cron jobs in some time, it's crash and CRON "trying again" but it starting new scripts.

When I click in Webmin to "Run now" it write:

Quote:Output from command wget http://localhost/DT-SERVER/exportovac/in...acia/asbis ..

--2010-10-18 08:13:44-- http://localhost/DT-SERVER/exportovac/in...acia/asbis
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... failed: Connection refused.
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... Read error (Connection timed out) in headers.
Retrying.

--2010-10-18 08:28:46-- (try: 2) http://localhost/DT-SERVER/exportovac/in...acia/asbis
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response...

and from "Read error" it's repeating...

Please help. Thank's for every reply.

Draex
#2

[eluser]tonanbarbarian[/eluser]
is your page you are going to redirecting at all?
if so you might need to tell wget to handle the redirections properly
#3

[eluser]Peter Dräxler[/eluser]
On my page is no redirecting but generating one page takes mininimal 40 seconds. Can It be error? Please how I can fix it? I'm noob in Linux :-(
#4

[eluser]Hockeychap[/eluser]
If I remember correctly your issue lies in the fact that Ubuntu (by default) has set up IP6 as well as IP4 on your server. When you go to resolve the address "localhost" an IP6 address is used first (hence the ::1 line) which causes either an issue with PHP or CI (can't remember which). This is causing you your delays.

There are two fixes to the problem (one more correct than the other Smile ).

Quick and Dirty Fix:
1. Remove/ Comment out the line in /etc/hosts which say something like: localhost ::1
Easiest way to do this is to
a. Open an terminal window to get a command line up
b. Type sudo gedit /etc/hosts
c. Put a # in front of the line that says localhost ::1
d. Save the file.
e. Exit

Proper Fix
1. Disable IP6 on your server unless you need to use it. This will require a quick reboot.
Full steps are http://www.webupd8.org/2010/05/how-to-di...-1004.html

Hope this helps,
Justin
#5

[eluser]Peter Dräxler[/eluser]
It works :-) Thank you.
#6

[eluser]Peter Dräxler[/eluser]
OH NO! It's not works :-( Have a another idea?
#7

[eluser]Hockeychap[/eluser]
Have a slot free this afternoon - so will fire up an Ubuntu server to have a look . Will hopefully be able to get back to you tomorrow.

Justin
#8

[eluser]Hockeychap[/eluser]
Have had a look at my ubuntu server.

I've installed teh ubuntu standard versions of Apache and PHP and put codeigniter 1.72 in /var/www/ci

If I run the following wget command : wget -S http://localhost/ci/user_guide/ from a command line I get the following output:

Code:
--2010-10-22 13:34:48--  http://localhost/ci/user_guide/
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 200 OK
  Date: Fri, 22 Oct 2010 12:34:48 GMT
  Server: Apache/2.2.14 (Ubuntu)
  Last-Modified: Mon, 12 Jul 2010 13:51:45 GMT
  ETag: "1a0aa7-1025-48b310d9e9e40"
  Accept-Ranges: bytes
  Content-Length: 4133
  Vary: Accept-Encoding
  Keep-Alive: timeout=15, max=100
  Connection: Keep-Alive
  Content-Type: text/html
Length: 4133 (4.0K) [text/html]
Saving to: `index.html'

100%[======================================>] 4,133       --.-K/s   in 0s      

2010-10-22 13:34:48 (100 MB/s) - `index.html' saved [4133/4133]

The -S setting in wget tells you what headers are being returned from the webserver.

Can you run the wget command that you have in your crontab from the command line, but add a -S switch and post the results. It should give as a clue as to what's failing in cron.

It's also worth checking the bottom of /var/log/Apache2/access.log and /var/log/Apache2/error.log to see if there's anything else comming up.


Cheers
Justin
#9

[eluser]Peter Dräxler[/eluser]
I forget say, ipv6 is disabled. And I detect, these problems is only with some controllers.

Code:
Output from command wget -S http://127.0.0.1/DT-SERVER/exportovac/index.php/asbis/get/najnakup ..

--2010-10-22 18:39:11--  http://127.0.0.1/DT-SERVER/exportovac/index.php/asbis/get/najnakup
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response... Read error (Connection timed out) in headers.
Retrying.

--2010-10-22 18:54:12--  (try: 2)  http://127.0.0.1/DT-SERVER/exportovac/index.php/asbis/get/najnakup
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response...

Access log:
Quote:127.0.0.1 - - [22/Oct/2010:14:00:01 +0200] "GET /DT-SERVER/exportovac/index.php/edsystem/get/najnakup HTTP/1.0" 200 2029 "-" "Wget/1.12 (linux-gnu)"
127.0.0.1 - - [22/Oct/2010:18:39:11 +0200] "GET /DT-SERVER/exportovac/index.php/asbis/get/najnakup HTTP/1.0" 200 2044 "-" "Wget/1.12 (linux-gnu)"
127.0.0.1 - - [22/Oct/2010:18:54:12 +0200] "GET /DT-SERVER/exportovac/index.php/asbis/get/najnakup HTTP/1.0" 200 2044 "-" "Wget/1.12 (linux-gnu)"

Error log is blank..

Email:

Quote:The original message was received at Sun, 17 Oct 2010 14:32:02 +0200
from localhost [127.0.0.1]

----- The following addresses had permanent fatal errors -----
<dttrading@DT-SERVER>

----- Transcript of session follows -----
451 DT-SERVER: Name server timeout
451 DT-SERVER: Name server timeout
451 DT-SERVER: Name server timeout
451 DT-SERVER: Name server timeout
Message could not be delivered for 5 days
Message will be deleted from queue
451 DT-SERVER: Name server timeout

Final-Recipient: RFC822; dttrading@DT-SERVER
Action: failed
Status: 4.4.7
Last-Attempt-Date: Fri, 22 Oct 2010 14:39:58 +0200

Email attachment (name of file: noname):
Quote:Return-Path: <dttrading@DT-SERVER>
Received: from DT-SERVER (localhost [127.0.0.1])
by DT-SERVER (8.14.3/8.14.3/Debian-9.1ubuntu1) with ESMTP id o9HCVgi0015974
for <dttrading@DT-SERVER>; Sun, 17 Oct 2010 14:32:02 +0200
Received: (from dttrading@localhost)
by DT-SERVER (8.14.3/8.14.3/Submit) id o9HCVg1T015962
for dttrading; Sun, 17 Oct 2010 14:31:42 +0200
Date: Sun, 17 Oct 2010 14:31:42 +0200
Message-Id: <201010171231.o9HCVg1T015962@DT-SERVER>
From: root@DT-SERVER (Cron Daemon)
To: dttrading@DT-SERVER
Subject: Cron <dttrading@DT-SERVER> wget http://localhost/DT-SERVER/exportovac/in...t/najnakup
Content-Type: text/plain; charset=ANSI_X3.4-1968
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/dttrading>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=dttrading>
#10

[eluser]Hockeychap[/eluser]
Sorry - been away. Your problem on IPV6 appears to have gone away (hoorah).

It looks like the timeouts that you are seeing are related to issues with your outbound mail configuration/ DNS. The mail server is asking DNS to resolve the domain DT-SERVER which isn't actually a domain, hence the error.

Fixing this depends on whether or not you are running a local DNS service, or if you have a handy fully configured email service available. If you have a local DNS service running, you can invent a domain and tell DNS to make your machine the mail server for that domain. If you have a fully configured email service then just change the email address that you are sending to so that it uses that service (i.e. [email protected])

Cheers
Justin




Theme © iAndrew 2016 - Forum software by © MyBB