@antald opened this Issue on October 28th 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 commented on October 29th 2016

same here.

@tsteur commented on October 30th 2016 Member

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 commented on October 31st 2016

No, this is not via Git.

@codifex commented on October 31st 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 commented on November 1st 2016 Member

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 commented on November 1st 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 commented on November 1st 2016 Member

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

@kolewu commented on November 1st 2016

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


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

@mattab commented on November 2nd 2016 Member
  • could you please post a screenshot
  • Is the error displayed only once or do you see it again and again?


@kolewu commented on November 2nd 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 commented on November 2nd 2016 Member

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 https://github.com/piwik/piwik/compare/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

@bizmate commented on March 26th 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 commented on March 26th 2018 Member

@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 commented on May 3rd 2018

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

@mattab commented on May 3rd 2018 Member
This Issue was closed on November 2nd 2016
Powered by GitHub Issue Mirror