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

Class Composer\Semver\VersionParser not found when updating Piwik 2.16 to 2.17 #10801

Closed
antald opened this issue Oct 28, 2016 · 15 comments
Closed
Assignees
Labels
answered For when a question was asked and we referred to forum or answered it.
Milestone

Comments

@antald
Copy link

antald commented Oct 28, 2016

PHP Fatal error: Class 'Composer\Semver\VersionParser' not found in /var/www/{WEBSITE}/web/core/Plugin/Dependency.php on line 77" while reading response header from upstream, client: {IP}, server: {SERVER}, request: "GET /index.php?module=CoreUpdater&action=oneClickUpdate HTTP/1.1", upstream: "fastcgi://unix:/var/lib/php5-fpm/web.sock:", host: "{SERVER}", referrer: "https://{WEBSITE}/index.php?module=CoreUpdater&action=newVersionAvailable"

@grzchr15
Copy link

same here.

@tsteur
Copy link
Member

tsteur commented Oct 30, 2016

Are you installing / updating Piwik via Git? If so, you need to run a php composer.phar install --no-dev after each update see eg http://piwik.org/faq/how-to-install/faq_18271/

@antald
Copy link
Author

antald commented Oct 31, 2016

No, this is not via Git.

@codifex
Copy link

codifex commented Oct 31, 2016

Same error here when updating from 2.16.5 to 1.17 using Piwik's built-in updater. However, at first sight everything seems to work fine after the update error despite the error message being shown. I do not know if this error has any side effects.

@tsteur
Copy link
Member

tsteur commented Nov 1, 2016

I checked the version at http://builds.piwik.org/piwik-2.17.0.zip and the file seems to be included.
Can you list which files exist in yourPiwikDirectory/vendor/composer/semver/src?

I can only presume there were some errors creating the file when updating Piwik. Can you try the 3 step manual update as described here? http://piwik.org/docs/update/#the-manual-three-step-update . If so, don't forget to backup the file config/config.ini.php.

@kolewu
Copy link

kolewu commented Nov 1, 2016

Same here with two different installations. Both automatic upgrades from 2.16.5 to 2.17.0. The error message is shown as simple text and after a page reload a real piwik box says an error occurred and your version is up-to-date (or something similar). Then it is possible to go to piwik and this triggers the database update. From there on all seems to work.

For me it looks like the update process doesn't activate the composer packages while running but they are correctly activated when the page is reloaded.

@tsteur
Copy link
Member

tsteur commented Nov 1, 2016

@kolewu can you check as well which files exist in yourPiwikDirectory/vendor/composer/semver/src directory?

@kolewu
Copy link

kolewu commented Nov 1, 2016

After the update and with piwik that seems to run without problem, this directory contains:

Constraint/
Comparator.php
Semver.php
VersionParser.php

I have to update another installation. Should I look for something special?

@mattab
Copy link
Member

mattab commented Nov 2, 2016

  • could you please post a screenshot
  • Is the error displayed only once or do you see it again and again?

Thanks

@kolewu
Copy link

kolewu commented Nov 2, 2016

The class not found error for Composer\Semver\VersionParser only shows up once and is only a text, no html at all. After the reload the message box from piwik is shown, but the process continues flawlessly.

I will do the upgrade later and post the exact page content for the error message and a screenshot of the piwik dialog.

@tsteur tsteur self-assigned this Nov 2, 2016
@tsteur tsteur added the answered For when a question was asked and we referred to forum or answered it. label Nov 2, 2016
@tsteur tsteur added this to the 2.17.1 milestone Nov 2, 2016
@tsteur
Copy link
Member

tsteur commented Nov 2, 2016

OK it is now clear what the problem is for me.

In 2.16.X the Composer/Semver package was not included in Piwik. What happens is when updating Piwik we replace all files in Piwik and then it tried to include the new PluginDependency from Piwik 2.17.0 where it required a Semver. But the autoloader etc was already loaded and it could not find Composer/Semver automatically. This is why users mention it is only a one time problem.

A fix would have been 2.x-dev...10801 to include require_once PIWIK_DOCUMENT_ROOT . '/core/Plugin/Dependency.php'; before updating the files. This change is actually not really needed anymore as the bug is in the updater of 2.16.X and we cannot fix it there anymore as the code that contains the bug is already shipped to users.

Fixing it anyway would not really help either because this problem is super unlikely to occur again in Piwik 2.x

@tsteur tsteur closed this as completed Nov 2, 2016
@bizmate
Copy link

bizmate commented Mar 26, 2018

I have just experienced this problem doing an online automatic update but the problem is permanent even after doing a composer install manually on the server. Any suggestions? This was from an old 2.3 i think version to the latest 3.3. Should i open a separate ticket?

@mattab
Copy link
Member

mattab commented Mar 26, 2018

@bizmate you shouldn't have to install composer unless you are using Matomo from GIT: http://matomo.org/faq/how-to-install/faq_18271/

So maybe just re-upload all files from the latest stable release and try again?

@Jeeva-Rathinam
Copy link

Jeeva-Rathinam commented May 3, 2018

Anyone have solution? if yes, pls explain the steps.

@mattab
Copy link
Member

mattab commented May 3, 2018

follow steps in http://matomo.org/faq/how-to-install/faq_18271/

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.
Projects
None yet
Development

No branches or pull requests

8 participants