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

import_logs.py fails: copy(/var/www/html/tmp/latest/DBIP-City.mmdb.new): failed to open stream #15519

Closed
SlavikCA opened this issue Feb 5, 2020 · 5 comments
Labels
worksforme The issue cannot be reproduced and things work as intended.

Comments

@SlavikCA
Copy link

SlavikCA commented Feb 5, 2020

I have Matomo 3.13.1
On Ubuntu 16.04
import_logs.py runs daily.
Today, the script ended with failed status with following error in the log:

INFO Scheduler: executing task Piwik\Plugins\GeoIp2\GeoIP2AutoUpdater.update...
INFO Downloading https://download.db-ip.com/free/dbip-city-lite-2020-02.mmdb.gz to /var/www/html/tmp/latest/DBIP-City.mmdb.gz.
INFO GeoIP2AutoUpdater: successfully downloaded 'https://download.db-ip.com/free/dbip-city-lite-2020-02.mmdb.gz'
WARNING /var/www/html/plugins/GeoIp2/GeoIP2AutoUpdater.php(302): Warning - copy(/var/www/html/tmp/latest/DBIP-City.mmdb.new): failed to open stream: No such file or directory - Matomo 3.13.1
WARNING /var/www/html/plugins/GeoIp2/GeoIP2AutoUpdater.php(303): Warning - unlink(/var/www/html/tmp/latest/DBIP-City.mmdb.new): No such file or directory - Matomo 3.13.1
WARNING /var/www/html/plugins/GeoIp2/GeoIP2AutoUpdater.php(308): Warning - unlink(/var/www/html/tmp/latest/DBIP-City.mmdb.gz): No such file or directory - Matomo 3.13.1
INFO GeoIP2AutoUpdater: successfully updated GeoIP 2 database 'https://download.db-ip.com/free/dbip-city-lite-2020-02.mmdb.gz'
...
Error: error or warning logs detected, exit 1
ERROR: Job failed: exit status 1
@sgiehl
Copy link
Member

sgiehl commented Feb 6, 2020

Does the same error occur when running the GeoIP update manually using:
./console scheduled-tasks:run "Piwik\Plugins\GeoIp2\GeoIP2AutoUpdater.update"

@tsteur
Copy link
Member

tsteur commented Feb 6, 2020

@SlavikCA be also good to double check there is write permission for the target directory. I think the DB is written into $matomoDir/misc

@tsteur tsteur added the Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users. label Feb 6, 2020
@SlavikCA
Copy link
Author

SlavikCA commented Feb 6, 2020

I have that script running every night, as root:

sudo /var/www/html/console core:archive --force-all-websites --force-all-periods=315576000 --force-date-last-n=1000 --url=$PIWIK

So, it's not the permission issue.

I didn't make any changes on the system, but today same script worked without any errors:

INFO Scheduler: executing task Piwik\Plugins\GeoIp2\GeoIP2AutoUpdater.update...
INFO Downloading https://download.db-ip.com/free/dbip-city-lite-2020-02.mmdb.gz to /var/www/html/tmp/latest/DBIP-City.mmdb.gz.
INFO GeoIP2AutoUpdater: successfully downloaded 'https://download.db-ip.com/free/dbip-city-lite-2020-02.mmdb.gz'
INFO GeoIP2AutoUpdater: successfully updated GeoIP 2 database 'https://download.db-ip.com/free/dbip-city-lite-2020-02.mmdb.gz'
INFO Scheduler: finished. Time elapsed: 3.197s
...
Job succeeded

@SlavikCA SlavikCA closed this as completed Feb 6, 2020
@SlavikCA
Copy link
Author

SlavikCA commented Feb 6, 2020

Also, just for the record, here are my folders and permissions:

root@piwik:/home/slavik# ls -l /var/www/html/
...
drwxr-xr-x  9 www-data www-data   4096 Feb  6 08:16 misc
root@piwik:/home/slavik# ls -al /var/www/html/misc
drwxr-xr-x  9 www-data www-data     4096 Feb  6 08:16 .
drwxr-xr-x 13 www-data www-data     4096 Dec 28 16:21 ..
drwxr-xr-x  2 www-data www-data     4096 Mar 29  2017 composer
drwxr-xr-x  2 www-data www-data     4096 Mar 29  2017 cron
-rw-r--r--  1 root     root     82492328 Feb  6 08:16 DBIP-City.mmdb
-rw-r--r--  1 www-data www-data 20539238 Mar 27  2018 GeoIPCity.dat
-rw-r--r--  1 root     root     61280973 Dec  4 08:09 GeoLite2-City.mmdb
...

@tsteur tsteur added worksforme The issue cannot be reproduced and things work as intended. and removed Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users. labels Feb 6, 2020
@tsteur
Copy link
Member

tsteur commented Feb 6, 2020

Thanks for letting us know @SlavikCA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
worksforme The issue cannot be reproduced and things work as intended.
Projects
None yet
Development

No branches or pull requests

3 participants