Archive.php --url Error on line 519


#1

Hi,

I upgraded to 1.7.1 some minutes ago. I changed the cron and added the URL but it throws a error:


[2012-02-27 10:26:01] [cf727c48] ERROR: The Piwik URL http://a.planetlan.com/index.php does not seem to be pointing to a Piwik server.

But that`s the piwik folder ;p

Full Logoutput: http://paste.kde.org/430094/

Any Ideas ?


#2

No Idea ?

Rly hurts cause archiving currently won`t work. Will revert back to previous version then… damn.


#3

A guess: are you allowing access to your piwik instance only from a few hosts (webserver level), and the IP of your server is not among them? :slight_smile:


#4

No it`s open


(Matthieu Aubry) #5

please try this patch: http://dev.piwik.org/trac/changeset/5929
it will then write the response from the server, which maybe will give a tip as to what is the problem?


#6

I changed the output to your suggestion and I think I located the problem.
The URL is ok but the detailed report gives me a 404.

If I dig in my apache logs I found archive.php is using IPv6 instead of IPv4 on the webserver it run`s there is only a internal IPv6 for backup purpose no Live Apache Virtualhost. As it looks for now piwik is initializing the connection on the local IPv6 where it receives the 404 because the vhost simply does not exist.

Surprise: If I manually force the hostname in /etc/host to the IPv4 it works.

Maybe add the option --ipv4 to the archive.php and try to enfoce curl to use IPv4 Lookup: curl_setopt( $ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );

thanks, have a nice day.


#7

I’m on Piwik 2.0.3 and I’m having either this same problem or a similar one.

My cron is set hourly, so every hour I’m getting this error message:


Error in the last Piwik archive.php run:
The Piwik URL http://mydomain.com/piwik/index.php does not seem to be pointing to a Piwik server. Response was '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /piwik/index.php was not found on this server.</p>
</body></html>'.

 Here is the full errors output:

---------------------------
INIT
Querying Piwik API at: http://mydomain.com/piwik/index.php
Running as Super User: xxxxx
ERROR: The Piwik URL http://mydomain.com/piwik/index.php does not seem to be pointing to a Piwik server. Response was '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /piwik/index.php was not found on this server.</p>
</body></html>'.
PHP Fatal error:  The Piwik URL http://mydomain.com/piwik/index.php does not seem to be pointing to a Piwik server. Response was '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /piwik/index.php was not found on this server.</p>
</body></html>'. in /var/www/mydomain.com/html/piwik/misc/cron/archive.php on line 561

Although if I run the archival manually, it works fine:


su www-data -c "/usr/bin/php5 /var/www/mydomain.com/html/piwik/misc/cron/archive.php --url=http://mydomain.com/piwik"

Is this the same problem that solariz was having?

If not, what to do?

If so, how I exactly do I force the hostname? I have no /etc/host file on my server.

Thanks in advance


(Matthieu Aubry) #8

Check the URL, as the error says:

The requested URL /piwik/index.php was not found on this server.


#9

http://mydomain.com/piwik/index.php is very much on my server, it points at my Piwik dashboard.


#10

what if you were to make an alias at

/piwik/index.php that pointed to the manual complete path archive.php?


#11

Wouldn’t that be circular? Archive.php is looking for /piwik/index.php, which would just alias back to archive.php?

Can you be more specific? This would be for the archive cron, right?


#12

yes i meant for the cron as you mentioned it worked manually. the difference there was i see the absolute path and on the errored one its using a virtual domain path. as it resolves from a dns url. maybe have the piwik query api first line refence the absolute path and avoid any host resolve issues? i dont use te api myself but seems to be just a refernce issue.


#13

When I try adding the manual version of the command into the cron, I get a different version of the same error:


/bin/sh: 1: /usr/bin/php5 /var/www/mydomain.com/html/piwik/misc/cron/archive.php --url=http://mydomain.com/piwik: not found


#14

So, after double-checking the docs more carefully, I finally have a ‘good cron’ successfully running hourly. Archive.log shows the report, and is being regenerated when it’s supposed to be, every hour.

That’s the good news.

The bad news is that I’m still getting the hourly error emails like the one I pasted above. And they’re clearly coming from a second cron running somewhere else on my server - the emails have the same sender as the good cron - but I can’t find this broken cron, so I still don’t know where these error messages are coming from.

Supposedly this is how to find crons for all users:


for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done

But that doesn’t find /etc/cron.d/piwik, which is the good cron.

I also tried checking the running daemons:


ps aux

But there was nothing overtly piwik-related in the results.

Any ideas on how I can find the broken cron to stop the hourly error spam?


#15

http://www.commandlinefu.com/commands/view/3/display-the-top-ten-running-processes-sorted-by-memory-usage

try some variant of these maybe?


#16

I found it!

Thanks for your help @lesjokolat. Your link led me to another link that confirmed all the places where a cron could be. And the broken cron wasn’t in any of them.

So I then compared the source of the error message emails with the source of the ‘good cron’ notification emails, which were very similar, but I did notice that the IP addresses were different, and it turns out that a clone of my webserver, now used for something else, still had the cron running if though the Piwik install was out of use. Some housekeeping is in order.