Docker: Error on the first install

Created on 6 Dec 2018  路  5Comments  路  Source: nextcloud/docker

Info: I use /var/www/html in an NFS volume

Everytime after I install nextcloud with docker run -p 8680:80 -v nextcloud:/var/www/html -d nextcloud:latest I get in the browser / curl a php error:

Fatal error: Uncaught Error: Call to a member function getLogger() on null in /var/www/html/index.php:66 Stack trace: #0 {main} thrown in /var/www/html/index.php on line 66

I've already tried using docker instead of docker-compose and deleted everything and installed it again, but It didn't work nevertheless.

Most helpful comment

There is the rsync 鈥攃hown operation within the install procedure that did not work with my nfs shares. It is totally unnecessary to do a chown there in the script. I think nextcloud installation procedure needs to get some rework on docker-compose and by now is best be done manually.

All 5 comments

I get those lines in the docker logs, they seem to be important:

[Sat Dec 08 11:01:43.153231 2018] [php7:notice] [pid 29] [client 172.17.0.1:60020] {"reqId":"1xiy2FmvULyreYIlhtUL","level":3,"time":"2018-12-08T11:01:43+00:00","remoteAddr":"172.17.0.1","user":"--","app":"PHP","method":"GET","url":"\\/","message":"fileperms(): stat failed for \\/var\\/www\\/html\\/data\\/nextcloud.log at \\/var\\/www\\/html\\/lib\\/private\\/Log\\/File.php#137","userAgent":"Mozilla\\/5.0 (X11; Fedora; Linux x86_64; rv:63.0) Gecko\\/20100101 Firefox\\/63.0","version":""}


[Sat Dec 08 11:01:43.153266 2018] [php7:notice] [pid 29] [client 172.17.0.1:60020] {"reqId":"1xiy2FmvULyreYIlhtUL","level":3,"time":"2018-12-08T11:01:43+00:00","remoteAddr":"172.17.0.1","user":"--","app":"index","method":"GET","url":"\\/","message":{"Exception":"Exception","Message":"Could not acquire an exclusive lock on the config file \\/var\\/www\\/html\\/config\\/config.php","Code":0,"Trace":[{"file":"\\/var\\/www\\/html\\/lib\\/private\\/Config.php","line":132,"function":"writeData","class":"OC\\\\Config","type":"->","args":[]},{"file":"\\/var\\/www\\/html\\/lib\\/private\\/SystemConfig.php","line":100,"function":"setValue","class":"OC\\\\Config","type":"->","args":["instanceid","ocyg523m80xn"]},{"file":"\\/var\\/www\\/html\\/lib\\/private\\/legacy\\/util.php","line":1170,"function":"setValue","class":"OC\\\\SystemConfig","type":"->","args":["instanceid","ocyg523m80xn"]},{"file":"\\/var\\/www\\/html\\/lib\\/base.php","line":415,"function":"getInstanceId","class":"OC_Util","type":"::","args":[]},{"file":"\\/var\\/www\\/html\\/lib\\/base.php","line":656,"function":"initSession","class":"OC","type":"::","args":[]},{"file":"\\/var\\/www\\/html\\/lib\\/base.php","line":1068,"function":"init","class":"OC","type":"::","args":[]},{"file":"\\/var\\/www\\/html\\/index.php","line":40,"args":["\\/var\\/www\\/html\\/lib\\/base.php"],"function":"require_once"}],"File":"\\/var\\/www\\/html\\/lib\\/private\\/Config.php","Line":258,"CustomMessage":"--"},"userAgent":"Mozilla\\/5.0 (X11; Fedora; Linux x86_64; rv:63.0) Gecko\\/20100101 Firefox\\/63.0","version":""}


[Sat Dec 08 11:01:43.227054 2018] [php7:warn] [pid 29] [client 172.17.0.1:60020] PHP Warning:  fileperms(): stat failed for /var/www/html/data/nextcloud.log in /var/www/html/lib/private/Log/File.php on line 137


[Sat Dec 08 11:01:43.227081 2018] [php7:notice] [pid 29] [client 172.17.0.1:60020] {"reqId":"1xiy2FmvULyreYIlhtUL","level":3,"time":"2018-12-08T11:01:43+00:00","remoteAddr":"172.17.0.1","user":"--","app":"PHP","method":"GET","url":"\\/","message":"fileperms(): stat failed for \\/var\\/www\\/html\\/data\\/nextcloud.log at \\/var\\/www\\/html\\/lib\\/private\\/Log\\/File.php#137","userAgent":"Mozilla\\/5.0 (X11; Fedora; Linux x86_64; rv:63.0) Gecko\\/20100101 Firefox\\/63.0","version":""}


[Sat Dec 08 11:01:43.227107 2018] [php7:notice] [pid 29] [client 172.17.0.1:60020] {"reqId":"1xiy2FmvULyreYIlhtUL","level":3,"time":"2018-12-08T11:01:43+00:00","remoteAddr":"172.17.0.1","user":"--","app":"PHP","method":"GET","url":"\\/","message":"chmod(): No such file or directory at \\/var\\/www\\/html\\/lib\\/private\\/Log\\/File.php#138","userAgent":"Mozilla\\/5.0 (X11; Fedora; Linux x86_64; rv:63.0) Gecko\\/20100101 Firefox\\/63.0","version":""}

It's working If I use bind instead of a NFS volume. So apparently NFS volumes don't work

There is the rsync 鈥攃hown operation within the install procedure that did not work with my nfs shares. It is totally unnecessary to do a chown there in the script. I think nextcloud installation procedure needs to get some rework on docker-compose and by now is best be done manually.

Nextcloud is not very docker friendly.
/--/
So apparently NFS volumes don't work

Preach. I'm a simple man with simple needs: Nextcloud on Kubernetes with NFS persistence. As there is official Docker and Helm available, one would assume helm install and that's that.

Four days of debugging later - nop, can not haz - the container doesn't get past entrypoint. The problem seems twofold:

  • a) Nextcloud trying to put static application files into persistent storage (on init) (why would one do that?)
  • b) rsync --chown pr0n in entrypoint

Trying to use chown with NFS mounts is 馃槶 , yet NFS is the most widespread persistence method in Kubernetes, which is itself quite well used in the world.

I'm out of ideas how to get Nextcloud running in a standard Kubernetes install.

Ref #1028 ; #968

Just wondering, after coming across similar issues with a s3fs mounted volume, can the devs give some insight to let us know if they are going to improve the docker image at all at heed some of the feedback about the anti patterns that currently exist?

Was this page helpful?
0 / 5 - 0 ratings