Archive.php not working any more via cron in 2.1 RC1

Hi!

After updating to 2.1 RC1, my cron running archive.php is not working any more (the cron is still running but the archive.php gives an error):

archive.php --url=https://my-url-to/piwik/

INFO [2014-02-13 08:52:07] [21610] ---------------------------
INFO [2014-02-13 08:52:07] [21610] INIT
INFO [2014-02-13 08:52:07] [21610] Querying Piwik API at: https://my-url-to/piwik/index.php
INFO [2014-02-13 08:52:07] [21610] Running Piwik 2.1-rc1 as Super User: admin
Cannot find /proc/version - is /proc mounted?
INFO [2014-02-13 08:52:09] [21610] ERROR: Got invalid response from API request:
https://my-url-to/piwik/index.php?module=API&method=API.getDefaultMetricTranslations&format=original&serialize=1&trigger=archivephp. The response was empty. This usually means a server error. This solution to this error is generally to increase the value of ‘memory_limit’ in your php.ini file. Please check your Web server Error Log file for more details.
INFO [2014-02-13 08:52:09] [21610] ERROR: The Piwik URL https://my-url-to/piwik/index.php does not seem to be pointing to a Piwik server. Response was ‘’.
Error in the last Piwik archive.php run:
The Piwik URL https://my-url-to/piwik/index.php does not seem to be pointing to a Piwik server. Response was ‘’.

Here is the full errors output:


INIT
Querying Piwik API at: https://my-url-to/piwik/index.php
Running Piwik 2.1-rc1 as Super User: admin
ERROR: Got invalid response from API request: https://my-url-to/piwik/index.php?module=API&method=API.getDefaultMetricTranslations&format=origin al&serialize=1&trigger=archivephp. The response was empty. This usually means a server error. This solution to this error is generally to increase the value of ‘memory_limit’ in your php.ini file. Please check your Web server Error Log file for more details.
ERROR: The Piwik URL https://my-url-to/piwik/index.php does not seem to be pointing to a Piwik server. Response was ‘’.

I assue that this must have to do either with the force SSL (I was using SSL before!) and/or the new super user features.

Any ideas?

It seems that the archive.php now tried to access /proc/version/ to determine the Linux version. When I run this at command line I get:

cat /proc/version/
cat: /proc/version/: Permission denied

So it seams that on my server this feature is not available. Maybe you should not rely on that since due to security reasons, proc/version might not be available on all systems.

Thx for reporting this issue! I just pushed a fix to the Piwik master and should be available in next beta/rc release.

I get this error in Piwik 2.2.1 still. I have updated from Piwik 1.x so I don’t know if it was working in Piwik 2.1 after the fix that was mentioned.

Can you please copy the full error you get from the error log or syslog?

Is it still this?


cat /proc/version/
cat: /proc/version/: Permission denied

Maybe we will need access to your server to reproduce and fix it, if you dont mind

$ ./console core:archive --url=http://piwik.[server].com
INFO CoreConsole[2014-05-08 07:19:20] [391d2] ---------------------------
INFO CoreConsole[2014-05-08 07:19:20] [391d2] INIT
INFO CoreConsole[2014-05-08 07:19:20] [391d2] Piwik is installed at: http://piwik.[server].com/index.php
INFO CoreConsole[2014-05-08 07:19:20] [391d2] Running Piwik 2.2.2 as Super User
Cannot find /proc/version - is /proc mounted?
ERROR CoreConsole[2014-05-08 07:19:20] [391d2] Got invalid response from API request: http://piwik.[server].com/index.php?module=API&method=API.getDefaultMetricTranslations&format=original&serialize=1&trigger=archivephp. The response was empty. This usually means a server error. This solution to this error is generally to increase the value of 'memory_limit' in your php.ini file. Please check your Web server Error Log file for more details.

$ cat /proc/version
cat: /proc/version: No such file or directory

Looks like /proc is really not mounted on our shared hoster:

$ mount
none on /proc type proc (rw)

oK, would you please email to matt@piwik your SSH access to Piwik so I can reproduce? I should then be able to find the bug and fix it in piwik. thanks!

mounted /proc and not mounted /proc is both a “stream” resource type. So is_resource() is not sufficient enough to test if /proc is really mounted or not I guess.
create an empty folder somehwere and then compare

get_resource_type(@fopen('/proc', 'r')
get_resource_type(@fopen('/empty/folder', 'r')

http://www.php.net/manual/en/resource.php

@Klaus can you please comment on the related ticket: procfs needed by process component as of Piwik 2.2 · Issue #5041 · matomo-org/matomo · GitHub

feel free to re-open it, if that’s not working for you. It’s important we get this fixed :slight_smile: thanks