While trying to run MediaWiki on kubernetes using our restricted mediawiki-multiversion image, I stumbled upon the following problem:
$ curl -H 'Host: en.wikipedia.org' https://staging.svc.eqiad.wmnet:4444/wiki/Main_Page <br /> <b>Warning</b>: rename(/tmp/conf2-enwiki.jsonxmqiV2,/tmp/mw-cache-1.37.0-wmf.4/conf2-enwiki.json): Permission denied in <b>/srv/mediawiki/multiversion/MWConfigCacheGenerator.php</b> on line <b>327</b><br /> <br />
This is due to the fact that the cache directories are owner by user "somebody" and not by user "www-data" (uid 33):
oblivian@kubestage1001:~$ sudo docker exec --user root -ti 93754a6c677c /bin/bash root@mediawiki-pinkunicorn-6d86dcd4fc-tptrg:/srv/mediawiki# cd /tmp/ root@mediawiki-pinkunicorn-6d86dcd4fc-tptrg:/tmp# ls -lart total 0 drwxr-xr-x 2 somebody somebody 31 May 14 19:55 mw-cache-1.37.0-wmf.4 drwxr-xr-x 2 somebody somebody 36 May 14 19:57 mw-cache-1.37.0-wmf.5 drwxr-xr-x 21 root root 269 Jun 8 16:03 .. drwxrwxrwt 4 root root 64 Jun 8 16:05 .