matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.82k stars 2.64k forks source link

Composer file integrity #12147

Closed auchri closed 7 years ago

auchri commented 7 years ago

File integrity check failed and reported some errors. You should fix this issue and then refresh this page until it shows no error.

Errors below may be due to a partial or failed upload of Piwik files. --> Try to reupload all the Piwik files in BINARY mode. <--

File size mismatch: /var/www/html/vendor/composer/autoload_classmap.php (expected length: 300705, found: 1764) File size mismatch: /var/www/html/vendor/composer/autoload_static.php (expected length: 341066, found: 8163)

What I basically do is to download piwik-3.1.1.tar.gz from http://builds.piwik.org/, upload it to the webroot of my server and extract it. So why are the file sizes not as expected?

auchri commented 7 years ago

I just skipped the check and piwik itself works as expected ¯\(ツ)

Findus23 commented 7 years ago

The file integrity check is optional, but I would definitely look into the issue again. The file size of the two files is far of (2 KB instead of about 300KB)

Can you check again if the files on the server are correct?

auchri commented 7 years ago

Yea, since this is a major warning at the install process, it should not be there without an reason.

How do you define "correct"? What should be the content of the files?

Findus23 commented 7 years ago

That can definitely cause issues as it is a list of classes used by php to be able to import the correct class.

The file should consist of 2748 Lines of PHP code similar to this:

```php $vendorDir . '/pear/archive_tar/Archive/Tar.php', 'Composer\\Semver\\Comparator' => $vendorDir . '/composer/semver/src/Comparator.php', 'Composer\\Semver\\Constraint\\AbstractConstraint' => $vendorDir . '/composer/semver/src/Constraint/AbstractConstraint.php', 'Composer\\Semver\\Constraint\\Constraint' => $vendorDir . '/composer/semver/src/Constraint/Constraint.php', 'Composer\\Semver\\Constraint\\ConstraintInterface' => $vendorDir . '/composer/semver/src/Constraint/ConstraintInterface.php', 'Composer\\Semver\\Constraint\\EmptyConstraint' => $vendorDir . '/composer/semver/src/Constraint/EmptyConstraint.php', 'Composer\\Semver\\Constraint\\MultiConstraint' => $vendorDir . '/composer/semver/src/Constraint/MultiConstraint.php', 'Composer\\Semver\\Semver' => $vendorDir . '/composer/semver/src/Semver.php', [MANY MORE LINES] 'Zend_Version' => $baseDir . '/libs/Zend/Version.php', 'lessc' => $vendorDir . '/leafo/lessphp/lessc.inc.php', 'lessc_formatter_classic' => $vendorDir . '/leafo/lessphp/lessc.inc.php', 'lessc_formatter_compressed' => $vendorDir . '/leafo/lessphp/lessc.inc.php', 'lessc_formatter_lessjs' => $vendorDir . '/leafo/lessphp/lessc.inc.php', 'lessc_parser' => $vendorDir . '/leafo/lessphp/lessc.inc.php', ); ```
auchri commented 7 years ago

That's the content of the files on the server ... the code doesn't look really broken.

autoload_classmap.php ```php $vendorDir . '/tecnickcom/tcpdf/include/barcodes/datamatrix.php', 'PDF417' => $vendorDir . '/tecnickcom/tcpdf/include/barcodes/pdf417.php', 'PclZip' => $vendorDir . '/piwik/decompress/libs/PclZip/pclzip.lib.php', 'PiwikTracker' => $vendorDir . '/piwik/piwik-php-tracker/PiwikTracker.php', 'QRcode' => $vendorDir . '/tecnickcom/tcpdf/include/barcodes/qrcode.php', 'TCPDF' => $vendorDir . '/tecnickcom/tcpdf/tcpdf.php', 'TCPDF2DBarcode' => $vendorDir . '/tecnickcom/tcpdf/tcpdf_barcodes_2d.php', 'TCPDFBarcode' => $vendorDir . '/tecnickcom/tcpdf/tcpdf_barcodes_1d.php', 'TCPDF_COLORS' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_colors.php', 'TCPDF_FILTERS' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_filters.php', 'TCPDF_FONTS' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_fonts.php', 'TCPDF_FONT_DATA' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_font_data.php', 'TCPDF_IMAGES' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_images.php', 'TCPDF_IMPORT' => $vendorDir . '/tecnickcom/tcpdf/tcpdf_import.php', 'TCPDF_PARSER' => $vendorDir . '/tecnickcom/tcpdf/tcpdf_parser.php', 'TCPDF_STATIC' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_static.php', 'lessc' => $vendorDir . '/leafo/lessphp/lessc.inc.php', 'lessc_formatter_classic' => $vendorDir . '/leafo/lessphp/lessc.inc.php', 'lessc_formatter_compressed' => $vendorDir . '/leafo/lessphp/lessc.inc.php', 'lessc_formatter_lessjs' => $vendorDir . '/leafo/lessphp/lessc.inc.php', 'lessc_parser' => $vendorDir . '/leafo/lessphp/lessc.inc.php', ); ```
autoload_static.php ```php __DIR__ . '/..' . '/mustangostang/spyc/Spyc.php', 'bbf73f3db644d3dced353b837903e74c' => __DIR__ . '/..' . '/php-di/php-di/src/DI/functions.php', '6dcc7fc6910472564e7b11f0b5d852b5' => __DIR__ . '/..' . '/szymach/c-pchart/src/Resources/data/constants.php', ); public static $prefixLengthsPsr4 = array ( 'T' => array ( 'Twig\\' => 5, ), 'P' => array ( 'Psr\\Log\\' => 8, 'Psr\\Container\\' => 14, 'Piwik\\Plugins\\' => 14, 'Piwik\\Network\\' => 14, 'Piwik\\Ini\\' => 10, 'Piwik\\Decompress\\' => 17, 'Piwik\\Cache\\' => 12, 'Piwik\\' => 6, 'PhpDocReader\\' => 13, ), 'M' => array ( 'Monolog\\' => 8, ), 'I' => array ( 'Invoker\\' => 8, 'Interop\\Container\\' => 18, ), 'D' => array ( 'Doctrine\\Common\\Cache\\' => 22, 'DeviceDetector\\' => 15, 'DI\\' => 3, ), 'C' => array ( 'CpChart\\' => 8, 'Composer\\Semver\\' => 16, ), ); public static $prefixDirsPsr4 = array ( 'Twig\\' => array ( 0 => __DIR__ . '/..' . '/twig/twig/src', ), 'Psr\\Log\\' => array ( 0 => __DIR__ . '/..' . '/psr/log/Psr/Log', ), 'Psr\\Container\\' => array ( 0 => __DIR__ . '/..' . '/psr/container/src', ), 'Piwik\\Plugins\\' => array ( 0 => __DIR__ . '/../..' . '/plugins', ), 'Piwik\\Network\\' => array ( 0 => __DIR__ . '/..' . '/piwik/network/src', ), 'Piwik\\Ini\\' => array ( 0 => __DIR__ . '/..' . '/piwik/ini/src', ), 'Piwik\\Decompress\\' => array ( 0 => __DIR__ . '/..' . '/piwik/decompress/src', ), 'Piwik\\Cache\\' => array ( 0 => __DIR__ . '/..' . '/piwik/cache/src', ), 'Piwik\\' => array ( 0 => __DIR__ . '/../..' . '/core', ), 'PhpDocReader\\' => array ( 0 => __DIR__ . '/..' . '/php-di/phpdoc-reader/src/PhpDocReader', ), 'Monolog\\' => array ( 0 => __DIR__ . '/..' . '/monolog/monolog/src/Monolog', ), 'Invoker\\' => array ( 0 => __DIR__ . '/..' . '/php-di/invoker/src', ), 'Interop\\Container\\' => array ( 0 => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container', ), 'Doctrine\\Common\\Cache\\' => array ( 0 => __DIR__ . '/..' . '/doctrine/cache/lib/Doctrine/Common/Cache', ), 'DeviceDetector\\' => array ( 0 => __DIR__ . '/..' . '/piwik/device-detector', ), 'DI\\' => array ( 0 => __DIR__ . '/..' . '/php-di/php-di/src/DI', ), 'CpChart\\' => array ( 0 => __DIR__ . '/..' . '/szymach/c-pchart/src', ), 'Composer\\Semver\\' => array ( 0 => __DIR__ . '/..' . '/composer/semver/src', ), ); public static $prefixesPsr0 = array ( 'Z' => array ( 'Zend_' => array ( 0 => __DIR__ . '/../..' . '/libs', ), ), 'T' => array ( 'Twig_' => array ( 0 => __DIR__ . '/..' . '/twig/twig/lib', ), ), 'S' => array ( 'Symfony\\Component\\EventDispatcher\\' => array ( 0 => __DIR__ . '/..' . '/symfony/event-dispatcher', ), 'Symfony\\Component\\Console\\' => array ( 0 => __DIR__ . '/..' . '/symfony/console', ), 'Symfony\\Bridge\\Monolog\\' => array ( 0 => __DIR__ . '/..' . '/symfony/monolog-bridge', ), ), 'P' => array ( 'PEAR_' => array ( 0 => __DIR__ . '/../..' . '/libs', ), 'PEAR' => array ( 0 => __DIR__ . '/..' . '/pear/pear_exception', ), ), 'J' => array ( 'JShrink' => array ( 0 => __DIR__ . '/..' . '/tedivm/jshrink/src', ), ), 'H' => array ( 'HTML_' => array ( 0 => __DIR__ . '/../..' . '/libs', ), ), 'C' => array ( 'Console' => array ( 0 => __DIR__ . '/..' . '/pear/console_getopt', ), ), 'A' => array ( 'Archive_Tar' => array ( 0 => __DIR__ . '/..' . '/pear/archive_tar', ), 'Archive_' => array ( 0 => __DIR__ . '/../..' . '/libs', ), ), ); public static $fallbackDirsPsr0 = array ( 0 => __DIR__ . '/..' . '/pear/pear-core-minimal/src', ); public static $classMap = array ( 'Datamatrix' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/barcodes/datamatrix.php', 'PDF417' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/barcodes/pdf417.php', 'PclZip' => __DIR__ . '/..' . '/piwik/decompress/libs/PclZip/pclzip.lib.php', 'PiwikTracker' => __DIR__ . '/..' . '/piwik/piwik-php-tracker/PiwikTracker.php', 'QRcode' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/barcodes/qrcode.php', 'TCPDF' => __DIR__ . '/..' . '/tecnickcom/tcpdf/tcpdf.php', 'TCPDF2DBarcode' => __DIR__ . '/..' . '/tecnickcom/tcpdf/tcpdf_barcodes_2d.php', 'TCPDFBarcode' => __DIR__ . '/..' . '/tecnickcom/tcpdf/tcpdf_barcodes_1d.php', 'TCPDF_COLORS' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_colors.php', 'TCPDF_FILTERS' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_filters.php', 'TCPDF_FONTS' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_fonts.php', 'TCPDF_FONT_DATA' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_font_data.php', 'TCPDF_IMAGES' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_images.php', 'TCPDF_IMPORT' => __DIR__ . '/..' . '/tecnickcom/tcpdf/tcpdf_import.php', 'TCPDF_PARSER' => __DIR__ . '/..' . '/tecnickcom/tcpdf/tcpdf_parser.php', 'TCPDF_STATIC' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_static.php', 'lessc' => __DIR__ . '/..' . '/leafo/lessphp/lessc.inc.php', 'lessc_formatter_classic' => __DIR__ . '/..' . '/leafo/lessphp/lessc.inc.php', 'lessc_formatter_compressed' => __DIR__ . '/..' . '/leafo/lessphp/lessc.inc.php', 'lessc_formatter_lessjs' => __DIR__ . '/..' . '/leafo/lessphp/lessc.inc.php', 'lessc_parser' => __DIR__ . '/..' . '/leafo/lessphp/lessc.inc.php', ); public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { $loader->prefixLengthsPsr4 = ComposerStaticInit18259f4ab23c61d183f43a8cc6fcba07::$prefixLengthsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInit18259f4ab23c61d183f43a8cc6fcba07::$prefixDirsPsr4; $loader->prefixesPsr0 = ComposerStaticInit18259f4ab23c61d183f43a8cc6fcba07::$prefixesPsr0; $loader->fallbackDirsPsr0 = ComposerStaticInit18259f4ab23c61d183f43a8cc6fcba07::$fallbackDirsPsr0; $loader->classMap = ComposerStaticInit18259f4ab23c61d183f43a8cc6fcba07::$classMap; }, null, ClassLoader::class); } } ```
Findus23 commented 7 years ago

Thanks for the file.

That's really odd. The files look valid, but a lot of the classes are missing. I guess you didn't run composer by chance.

Do you still have the original tar.gz file? Can you compare it to https://builds.piwik.org/piwik-3.1.1.tar.gz, which I just downloaded?

auchri commented 7 years ago

On of the parent docker images executed composer at start, that's why the classes where missing 😁

Sorry for bothering you.