Page MenuHomePhabricator

Fix cache purging during content deployment
Closed, ResolvedPublic5 Estimated Story Points

Description

The most recent change in wmde/fundraising-frontend-content was reported as failed. The content was deployed, but purging the cache failed due to a lack of permissions.

Respective excerpt from the shell output of the ansible playbook:

TASK [wmde.atomic-deploy : Void var/cache dir] *********************************
fatal: [test-spenden-2.wikimedia.de]: FAILED! => {"changed": false, "msg": "rmtree failed: [Errno 13] Permission denied: '/usr/share/nginx/www/test-spenden-2.wikimedia.de/fundraising-frontend-content/releases/20190327094738Z/../../../html/var/cache/content/8a/8a2329295fb1e1bfcae3587be8426940c3896e0e390eb23c91179cbd5752af1f.php'"}

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

It seems like the umask settings fo php-fpm are not overwritten correctly, leading to the cache files being not group-writable (for group www, where the deploy user is a member). The umask settings should be overwritten by the file /etc/systemd/system/php7.3-fpm.service.d/override.conf (generated through our infrastructure playbooks).

To further investigate:

  • Deploy to production and check files there, to check if this was a change in Twig (which we updated recently).
  • Check if the systemd settings are overwritten correctly (e.g. systemd startup log)
  • Check if this is a PHP 7.3 problem (we're already running PHP 7.3 on the test server)
  • Update server to a kernel >= 4.7, to be able to check the umask settings.
kai.nissen set the point value for this task to 5.Apr 1 2019, 10:18 AM

I had another look and found the error: Ubuntu 14.04 does not use Systemd yet (it uses upstart) and in preparation for the Update to 18.04 I removed the upstart configuration (PR https://github.com/wmde/fundraising-infrastructure/pull/254), misreading the info at https://wiki.ubuntuusers.de/systemd/ (German site).

Conclusion: T214461: Setup VMs for test and production will very likely solve this problem.

gabriel-wmde claimed this task.

Temporarily reverted a patch with https://github.com/wmde/fundraising-infrastructure/pull/259 and deployed it to test and production, now the cache is cleared again.