Navigation Menu

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

Check folder & permission before downloading a GeoIP database #18785

Closed
abbradar opened this issue Feb 12, 2022 · 2 comments · Fixed by #18799
Closed

Check folder & permission before downloading a GeoIP database #18785

abbradar opened this issue Feb 12, 2022 · 2 comments · Fixed by #18799
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@abbradar
Copy link

When downloading free DBIP database this error is shown if tmp/latest subdirectory does not exist:

WARNING: /core/Http.php(962): Warning - fopen(/var/lib/matomo/tmp/latest/DBIP-City.mmdb.gz.download): Failed to open stream: No such file or directory - Matomo 4.7.1 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already) (Module: GeoIp2, Action: downloadFreeDBIPLiteDB, In CLI mode: false)

Expected Behavior

Directory is created and file is downloaded.

Current Behavior

Error message is shown.

Possible Solution

Add mkdir call.

Steps to Reproduce (for Bugs)

  1. rm -rf ./tmp/latest, rm -rf ./misc/DBIP-City.mmdb;
  2. Go to /index.php?module=UserCountry&action=adminIndex&idSite=1&period=day&date=yesterday;
  3. Press "Get started..." to download free DBIP database.

Context

Stops user from downloading GeoIP database from the admin UI.

Your Environment

  • Matomo Version: 4.7.1
  • PHP Version: 8.0.13
  • Server Operating System: NixOS 21.09
  • Additionally installed plugins: -
@abbradar abbradar added the Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. label Feb 12, 2022
@sgiehl sgiehl added Bug For errors / faults / flaws / inconsistencies etc. and removed Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. labels Feb 15, 2022
@sgiehl
Copy link
Member

sgiehl commented Feb 15, 2022

Hi @abbradar
Thanks for creating that issue. I was able to reproduce and will check if I can quickly provide a fix for it.

@abbradar
Copy link
Author

Thanks!

@sgiehl sgiehl added this to the 4.8.0 milestone Feb 16, 2022
@justinvelluppillai justinvelluppillai changed the title GeoIP: /tmp/latest is not created when downloading database Check folder & permission before downloading a GeoIP database Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants