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

Explain that misc/ folder must be writable for GeoIP geo location to update geoip dbs #7421

Closed
blueyed opened this issue Mar 13, 2015 · 2 comments
Labels
c: Website matomo.org For issues related to our matomo.org website. Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Milestone

Comments

@blueyed
Copy link

blueyed commented Mar 13, 2015

I am seeing the following error from the cron job:

ERROR CoreConsole[2015-03-13 01:05:04] Got invalid response from API request: http://a.example.com/index.php?module=API&method=CoreAdminHome.runScheduledTasks&format=csv&convertToUnicode=0&token_auth=removed&trigger=archivephp.
Response was 'task,output Piwik\Plugins\ExamplePlugin\Tasks.myTask,Time elapsed: 0.000s Piwik\Plugins\UserCountry\GeoIPAutoUpdater.update,
    ERROR: GeoIPAutoUpdater: failed to download 'http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz' to '/var/piwik.git/misc/GeoIPCity.dat.dat.gz': Error while creating the file: /var/piwik.git/misc/GeoIPCity.dat.dat.gz'

The problem is that the "misc" directory is not writable.

The documentation at http://piwik.org/docs/update/ says:

After the one click update has successfully completed, you may also choose to change back your Piwik folder and files to read only permissions (except the tmp/ folder which must be writable at all times).

So I would assume that it's not necessary to change the permissions for the whole "misc" folder. It can be expected though to make the final GeoIPCity.dat file writable.

I've tried to touch and chmod the GeoLiteCity.dat.dat.gz file, but then
the next job failed with:

GeoIPAutoUpdater: failed to unzip '/var/piwik.git/misc/GeoIPCity.dat.dat.gz' after downloading 'http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz': The downloaded file is not a valid GeoIP database. Please re-check the URL or download the file manually.'

That was maybe caused because the target file could not be written.

@mattab
Copy link
Member

mattab commented Apr 8, 2015

Hi @blueyed - good point, thanks for noting our documentation is wrong here.

(issue scope: let's update our documentation to mention misc/ dir must be writable)

@mattab mattab added Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. c: Website matomo.org For issues related to our matomo.org website. labels Apr 8, 2015
@mattab mattab added this to the Piwik 2.13.0 milestone Apr 8, 2015
@mattab mattab changed the title GeoIP updater should use "tmp" directory for download / work with non-writable "misc" folder Explain that misc/ folder must be writable for GeoIP geo location to update geoip dbs Apr 8, 2015
@mattab
Copy link
Member

mattab commented Apr 8, 2015

Text updated in user guide:

After the one click update has successfully completed, you may also choose to change back your Piwik folder and files to read only permissions. Important: the tmp/ folder must be writable at all times. Note that if you use the GeoIP auto updater feature, you will also need to make the misc/ folder writable.

@mattab mattab closed this as completed Apr 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Website matomo.org For issues related to our matomo.org website. Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Projects
None yet
Development

No branches or pull requests

2 participants