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

The directory "/var/www/matomo/tmp/cache/tracker/" is not writable after Cron #16864

Closed
MArhEV opened this issue Dec 2, 2020 · 9 comments
Closed
Labels
Can't reproduce (yet) For issues that are reported by several people, but can't be reproduced reliably and need more data worksforme The issue cannot be reproduced and things work as intended.

Comments

@MArhEV
Copy link

MArhEV commented Dec 2, 2020

Hi! After enabling crone archiving and installing maxmind extension I have restarted my server and after that I can see only Error page in my matomo.

There is a possibility that matomo-archive has not been properly configured (no user such as nginx, i have left that entry blank) and that caused my issue.

After stopping, reloading, restarting crond, restarting and reloading nginx the error page is still present.
Is there any possibility how to get rid of it without completely reinstalling matomo?

PS all permissions are properly set, before cron all worked fine

@sgiehl
Copy link
Member

sgiehl commented Dec 2, 2020

Are you using different users for webserver and triggering the archiving cron?
What are the permissions for the directory /var/www/matomo/tmp/cache/tracker/ after cron ran?

Note: It should always be safe to clear the tmp directory of Matomo. All files should be recreated automatically when needed.

@MArhEV
Copy link
Author

MArhEV commented Dec 2, 2020

I have tried triggering cron with user nginx, but it showed me "permission denied" during running test command. I found that one user suggested removing user name from cron command so I followed his instructons :/
Anyway:
All files and directories are 0755 with user:group nginx:nginx.
After removing files in tmp, restarting crond and nginx, cache and tracker directories are now 0750.
Error page is still without change.

Furthermore, after once again removing ALL tmp directory and creating it manually as an empty dir and restarting nginx, error changed to "The directory "/var/www/matomo/tmp/cache/tracker/" does not exist and could not be created."

@Findus23
Copy link
Member

Findus23 commented Dec 2, 2020

with user nginx

Keep in mind that Matomo is not running with the nginx user, but the user your php-fpm setup runs with (e.g. www-data).

@tsteur tsteur added Can't reproduce (yet) For issues that are reported by several people, but can't be reproduced reliably and need more data worksforme The issue cannot be reproduced and things work as intended. labels Dec 2, 2020
@pedrosanchezpernia
Copy link

Same error after updating to version version 4.0.4

@tsteur
Copy link
Member

tsteur commented Dec 6, 2020

@pedrosanchezpernia did you update the files manually for the matomo 4 upgrade? AS mentioned in previous comment you might need to run some chown command or so to make sure the webserver has write access for these files.

@pedrosanchezpernia
Copy link

pedrosanchezpernia commented Dec 6, 2020

@tsteur yup, on console first php /var/www/matomo/console core:update
then chown -R root:root /var/www/matomo as stated in the update message

@pedrosanchezpernia
Copy link

pedrosanchezpernia commented Dec 7, 2020

Ok, fixed with chown -R www-data:www-data /var/www/matomo , however I'm not sure if all matomo directory should by own by www-data
reference

@tsteur
Copy link
Member

tsteur commented Dec 7, 2020

Closing this one. Setting correct permissions should fix this issue 👍

@pedrosanchezpernia you could always set only specific files to www-data like /tmp and /matomo.js and /config and /misc/userandpiwik.js` for example

@tsteur tsteur closed this as completed Dec 7, 2020
@polx
Copy link

polx commented Jan 30, 2023

FWIW... I've met the same problem and it is rather a packaging issue.
For bitnami, the user was not www-data but daemon...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Can't reproduce (yet) For issues that are reported by several people, but can't be reproduced reliably and need more data worksforme The issue cannot be reproduced and things work as intended.
Projects
None yet
Development

No branches or pull requests

6 participants