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

An error occurred Matomo couldn't write to some directories (running as user 'www-data'). #15509

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

Comments

@ghost
Copy link

ghost commented Feb 4, 2020

my server does not use user (www-data:www-data), it uses a custom username
and my folders in /tmp/ are already set to 755

this happened after setting up cron job

Matomo couldn't write to some directories (running as user 'www-data').

Try to Execute the following commands on your server, to allow Write access on these directories:

chown -R www-data:www-data /home/revelhost/domains/analytics/public_html
find /home/revelhost/domains/analytics/public_html/tmp -type f -exec chmod 644 {} \;
find /home/revelhost/domains/analytics/public_html/tmp -type d -exec chmod 755 {} \;
find /home/revelhost/domains/analytics/public_html/tmp/assets -type f -exec chmod 644 {} \;
find /home/revelhost/domains/analytics/public_html/tmp/assets -type d -exec chmod 755 {} \;
find /home/revelhost/domains/analytics/public_html/tmp/cache -type f -exec chmod 644 {} \;
find /home/revelhost/domains/analytics/public_html/tmp/cache -type d -exec chmod 755 {} \;
find /home/revelhost/domains/analytics/public_html/tmp/logs -type f -exec chmod 644 {} \;
find /home/revelhost/domains/analytics/public_html/tmp/logs -type d -exec chmod 755 {} \;
find /home/revelhost/domains/analytics/public_html/tmp/tcpdf -type f -exec chmod 644 {} \;
find /home/revelhost/domains/analyticspublic_html/tmp/tcpdf -type d -exec chmod 755 {} \;
find /home/revelhost/domains/analytics/public_html/tmp/templates_c -type f -exec chmod 644 {} \;
find /home/revelhost/domains/analytics/public_html/tmp/templates_c -type d -exec chmod 755 {} \;
If this doesn't work, you can try to create the directories with your FTP software, and set the CHMOD to 0755 (or 0777 if 0755 is not enough). To do so with your FTP software, right click on the directories then click permissions.

@tsteur
Copy link
Member

tsteur commented Feb 4, 2020

refs #13993

Thanks for letting us know @broros

I suppose Matomo should not return a default user name as this is certainly not accurate in https://github.com/matomo-org/matomo/blob/3.13.2-rc1/core/Filechecks.php#L152-L168

@tsteur tsteur added the Bug For errors / faults / flaws / inconsistencies etc. label Feb 4, 2020
@tsteur tsteur added this to the Priority Backlog (Help wanted) milestone Feb 4, 2020
@ghost
Copy link
Author

ghost commented Feb 4, 2020

I think it has something to do with my cron job command

@ghost
Copy link
Author

ghost commented Feb 4, 2020

I originally got this message and changed to the directory to 777

all my folders are set to 755

An error occurred
The directory "/home/revelhost/domains/analytics/public_html/tmp/cache/tracker/" is not writable.

@ghost
Copy link
Author

ghost commented Feb 4, 2020

I got this fixed by disabling ( 2enconf php7.3-fpm ) it was running my folders as www-data

@ghost ghost closed this as completed Feb 4, 2020
@tsteur tsteur added worksforme The issue cannot be reproduced and things work as intended. and removed Bug For errors / faults / flaws / inconsistencies etc. labels Feb 4, 2020
@tsteur
Copy link
Member

tsteur commented Feb 4, 2020

Thanks for letting us know @broros

This issue was closed.
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

2 participants