Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Fatal error: Either cli core:archive or web index.php, but not both #6189

Closed
andreli opened this issue Sep 10, 2014 · 18 comments
Closed
Labels
answered For when a question was asked and we referred to forum or answered it. Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@andreli
Copy link

andreli commented Sep 10, 2014

I updated from 2.4.1 to 2.6.1.

Everything seamed to work fine with the exception of

php console core:archive --...

After deleting the contents of /tmp, the cron job worked fine, but then the web interface ceased to work. After again deleting /tmp, the web was back, as was the problem with my cron job.

Error:

PHP Fatal error:  Cannot redeclare class Piwik\Plugins\DevicesDetection\Columns\BrowserName in .../plugins/DevicesDetection/Columns/BrowserName.php on line 45

Did I miss a configuration or did I run in a known bug?

@mattab
Copy link
Member

mattab commented Sep 11, 2014

can you try to re-upload all files from 2.6.1 ?

when the interface doesn't work is there an error message, could you display it with the full backtrace?

@mattab mattab added the Bug For errors / faults / flaws / inconsistencies etc. label Sep 11, 2014
@mattab mattab added this to the Short term milestone Sep 11, 2014
@andreli
Copy link
Author

andreli commented Sep 11, 2014

I set up 2.6.1 from scratch, went through the installation and connected to my existing database. Problem is here again. I don't have more backtrace then the following:

On CLI and Apaches error_log I get:

PHP Fatal error:  Cannot redeclare class Piwik\Plugins\DevicesDetection\Columns\BrowserName in /.../plugins/DevicesDetection/Columns/BrowserName.php on line 45

In the Browser I see the same:

Fatal error: Cannot redeclare class Piwik\Plugins\DevicesDetection\Columns\BrowserName in /.../plugins/DevicesDetection/Columns/BrowserName.php on line 45

@andreli
Copy link
Author

andreli commented Sep 12, 2014

Downgraded to 2.5.0: same Fatal error! So I guess the Bug got introduced in 2.5.0.

So we are back to 2.4.1, where cli and web work at the same time.

@mattab
Copy link
Member

mattab commented Sep 14, 2014

@andreli what php version do you use?

@andreli
Copy link
Author

andreli commented Sep 14, 2014

@mattab: 5.3.3

@mattab
Copy link
Member

mattab commented Sep 14, 2014

can you try upgrade to most recent, maybe this would fix this issue?

@andreli
Copy link
Author

andreli commented Sep 14, 2014

Most recent Piwik or PHP?

Piwik runs on enterprise infrastructure, so upgrading PHP is no option.

@andreli
Copy link
Author

andreli commented Sep 19, 2014

@mattab: We can live with Piwik version 2.4.1 and will see further once we have a higher version of PHP available, which might be happening beginning next year.

But shouldn't you then update the documentation, that currently still states on http://piwik.org/docs/requirements/: PHP version 5.3.2 or greater?

@andreli
Copy link
Author

andreli commented Sep 29, 2014

FYI: We are experiencing with Piwik 2.7.0 still the same problem.

@qwesda
Copy link

qwesda commented Sep 30, 2014

I have the exact same problem with PHP 5.4.4 on Debian. Either the auto archiver cron works or the web interface but not both. It does't seem to be permissions related.
I upgraded form 2.3 and did a clean install.

@mattab
Copy link
Member

mattab commented Sep 30, 2014

Thanks for the report, unfortunately we cannot reproduce the issue yet.

@qwesda
Copy link

qwesda commented Sep 30, 2014

another thing I noticed is that I can call php /piwikdir/index.php just fine an get the html for the login page. but curl https://analytics.domain.org/index.php gives me an empty response. So it might be a difference between the php cli-config and the mod_php-config ...

@qwesda
Copy link

qwesda commented Sep 30, 2014

Ok I found it. The piwik installation is in a directory that is accessible under two paths – one being a symlinked version. The vhost was configured to use one path while the cron job tried to call the script with the other path. Probably composer/twig doesn't use realpath() when it tries to determine if the files are already compiled/cached. I than includes both compiled versions of the same source template and than boom

@mattab
Copy link
Member

mattab commented Sep 30, 2014

Thanks for follow up! hopefully @andreli you have the same issue?

@mattab mattab closed this as completed Sep 30, 2014
@mattab mattab added the wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it. label Sep 30, 2014
@andreli
Copy link
Author

andreli commented Nov 4, 2014

@qwesda : Thanks for your findings.

We are as well running piwik symlinked into different servers: www and intranet for tracking but only instranet for analysis, authenticated with LoginHttpAuth.

So, how have I to set up my infrastructure so that composer/twig does not trip?

@mattab mattab reopened this Feb 20, 2015
@mattab mattab removed the wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it. label Feb 20, 2015
@mattab
Copy link
Member

mattab commented Feb 20, 2015

@andreli @iquito I'm not sure how we could solve this issue, but since that's a problem I've at least reopened the bug!

@iquito
Copy link

iquito commented Feb 20, 2015

I am not sure myself why this problem appears, in my case I just have two installations of Piwik in two different directories (no symlinks) - everything is seperate (database user, tables, etc.), so nothing should collide, yet in my Nginx error log these errors appear:

2015/02/20 00:59:11 [error] 13346#0: *24179903 FastCGI sent in stderr: "PHP message: PHP Fatal error: Cannot redeclare class Piwik\Plugins\Actions\Columns\EntryPageTitle in /srv/library/piwik/latest/plugins/Actions/Columns/EntryPageTitle.php on line 0" while reading response header from upstream, client: 91.138.4.109, server: panaxis.ch, request: "GET /piwikdev/index.php?module=CoreHome&action=index&idSite=1&period=day&date=yesterday HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "panaxis.ch", referrer: "https://panaxis.ch/piwik/

I have two paths, "testing" and "latest", and the error message only occurs when I am trying to access the web interface in "testing", yet the error mentions a class which is already declared in "latest".

@mattab mattab modified the milestones: Short term, Mid term Apr 7, 2015
@mattab
Copy link
Member

mattab commented Sep 11, 2015

Thanks for the report, but we cannot reproduce. if you know how to reproduce, please create a new issue with steps to reproduce, we will definitely investigate & fix it. thanks

@mattab mattab closed this as completed Sep 11, 2015
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Sep 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it. Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

4 participants