@vsatmydynipnet opened this Issue on February 3rd 2021

FreeBSD 12.2
Matomo-Version: 4.1.1
MySQL-Version: 5.6.50
PHP-Version: 7.4.14
python37-3.7.9

Problem: Script to import Log Files fails since Update from 3.14 to 4.1.1 with:

importing Matomo ID 8 from partnerwelt.domain.tld without botsFatal error: php /usr/local/www/matomo/misc/cron/updatetoken.php --matomo-domain=analytics.domain.tld failed with error: PHP Fatal error: Uncaught InvalidArgumentException: The directory "/usr/local/www/matomo/tmp/cache/tracker/" does not exist and could not be created. in /usr/local/www/matomo/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php:84

Directory exists and is owned by www, as are the subdirs and files. All is accessible.

Log

HANDLING: /var/log/www/2021/02/02/ssl_request.log
importing Matomo ID 8 from partnerwelt.domain.tld without botsFatal error: php /usr/local/www/matomo/misc/cron/updatetoken.php --matomo-domain=analytics.domain.tld failed with error: PHP Fatal error: Uncaught InvalidArgumentException: The directory "/usr/local/www/matomo/tmp/cache/tracker/" does not exist and could not be created. in /usr/local/www/matomo/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php:84
Stack trace:
#0 /usr/local/www/matomo/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PhpFileCache.php(33): Doctrine\Common\Cache\FileCache->construct('/usr/local/www/...', '.php', 2)
#1 /usr/local/www/matomo/vendor/matomo/cache/src/Backend/File.php(40): Doctrine\Common\Cache\PhpFileCache->
construct('/usr/local/www/...', '.php')
#2 /usr/local/www/matomo/vendor/matomo/cache/src/Backend/Factory.php(22): Matomo\Cache\Backend\File->__construct('/usr/local/www/...')
#3 /usr/local/www/matomo/vendor/matomo/cache/src/Backend/Factory.php(96): Matomo\Cache\Backend\Factory->buildFileCache(Array)
#4 /usr/local/www/matomo/vendor/matomo/cache/src/Backend/Factory.php(41): Matomo\Cache\Backend\Factory->buildBackend('file', Array)
#5 /usr/local/www/matomo/vendor/matomo/cache/src/Backend/Factory.php(100) in /usr/local/www/matomo/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php on line 84
.
Reponse code was: 255. You can alternatively run the importer using the --login and --password option
system /usr/local/bin/python3.7 /usr/local/www/matomo/misc/log-analytics/import_logs.py --url=https://analytics.domain.tld/analytics/ --idsite=8 --recorders=4 --enable-http-errors --enable-http-redirects --enable-static ~/sv03.domain.tld.output.tmp failed: 256importing Matomo ID 9 from partnerwelt.domain.tld without botsFatal error: php /usr/local/www/matomo/misc/cron/updatetoken.php --matomo-domain=analytics.domain.tld failed with error: PHP Fatal error: Uncaught InvalidArgumentException: The directory "/usr/local/www/matomo/tmp/cache/tracker/" does not exist and could not be created. in /usr/local/www/matomo/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php:84
Stack trace:
#0 /usr/local/www/matomo/vendor/doctrine/cache/lib/Doctrine/Common/Cache/PhpFileCache.php(33): Doctrine\Common\Cache\FileCache->construct('/usr/local/www/...', '.php', 2)
#1 /usr/local/www/matomo/vendor/matomo/cache/src/Backend/File.php(40): Doctrine\Common\Cache\PhpFileCache->
construct('/usr/local/www/...', '.php')
#2 /usr/local/www/matomo/vendor/matomo/cache/src/Backend/Factory.php(22): Matomo\Cache\Backend\File->__construct('/usr/local/www/...')
#3 /usr/local/www/matomo/vendor/matomo/cache/src/Backend/Factory.php(96): Matomo\Cache\Backend\Factory->buildFileCache(Array)
#4 /usr/local/www/matomo/vendor/matomo/cache/src/Backend/Factory.php(41): Matomo\Cache\Backend\Factory->buildBackend('file', Array)
#5 /usr/local/www/matomo/vendor/matomo/cache/src/Backend/Factory.php(100) in /usr/local/www/matomo/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php on line 84
.
Reponse code was: 255. You can alternatively run the importer using the --login and --password option
system /usr/local/bin/python3.7 /usr/local/www/matomo/misc/log-analytics/import_logs.py --url=https://analytics.domain.tld/analytics/ --idsite=9 --recorders=4 --enable-http-errors --enable-http-redirects --enable-static --enable-bots ~/sv03.domain.tld.output.tmp failed: 256Press any key to continue...
$ ./LOAD_sv03_partnerwelt_matomo_date-1.pl

Permissions:

pwd
/usr/local/www/matomo/tmp

ls -lR cache
total 16
-rw-rw-r-- 1 www www 20 Feb 3 16:47 index.htm
-rw-rw-r-- 1 www www 20 Feb 3 16:47 index.php
-rw-r--r-- 1 www www 47 Jan 28 04:34 token.php
drwxrwxr-x 2 www www 3584 Feb 3 16:51 tracker

cache/tracker:
total 3432
-rw-rw-r-- 1 www www 218694 Feb 3 16:28 eagercache-411-tracker.php
-rw-rw-r-- 1 www www 305782 Feb 3 15:41 eagercache-411-ui.php
-rw-rw-r-- 1 www www 3230 Feb 3 16:51 matomocache_1.php
-rw-rw-r-- 1 www www 1066 Feb 3 15:03 matomocache_10.php

@diosmosis commented on February 4th 2021 Member

@vsatmydynipnet what user did you run the import_logs.py script with? Will it work if you run it with the www user?

(Note: you can also set the token auth manually via the --token-auth parameter)

@vsatmydynipnet commented on February 4th 2021

Just found out that a FreeBSD 11 to 12 updated removed the user running the import from the www group. Sorry for the noise and thank you for this great peace of software.

This Issue was closed on February 4th 2021
Powered by GitHub Issue Mirror