Wonderfall / dockerfiles

Discontinued. Fork at your will.
Creative Commons Zero v1.0 Universal
391 stars 170 forks source link

[nextcloud] failing to start after automatic update (for the first time in months) PHP error in log. #114

Closed tbrasser closed 7 years ago

tbrasser commented 7 years ago

I've been using the daily build for months now, and have not had many problems with automatic updating.

However my Nextcloud docker doesn't want to start anymore (since a few days now), this is in the logs:

{"reqId":"C5J9dj7FC06ydRpBkh9n","remoteAddr":"","app":"PHP","message":"PHP Startup: Unable to load dynamic library '\/usr\/lib\/php7\/modules\/gd.so' - Error relocating \/usr\/lib\/libpng16.so.16: inflateValidate: symbol not found at Unknown#0","level":3,"time":"2017-02-08 13:48:38","method":"--","url":"--","user":"--","version":"11.0.1.2"} {"reqId":"+KDNVjO5rdj5KJ0F+SNf","remoteAddr":"","app":"PHP","message":"PHP Startup: Unable to load dynamic library '\/usr\/lib\/php7\/modules\/gd.so' - Error relocating \/usr\/lib\/libpng16.so.16: inflateValidate: symbol not found at Unknown#0","level":3,"time":"2017-02-08 13:48:39","method":"--","url":"--","user":"--","version":"11.0.1.2"}

Any idea what causes it and how to fix it?

edit: I'll try to reinstall the php-gd module within the container when I have time (can I use apt-get in this image?), will that fix above error messages? or does the gd module needs configuring (the libpng16 thing?), and even if this fixes it, I still have no clue how it got corrupted in the first place.

edit2: Via the unraid docker log viewer I got a more verbose message: http://pastebin.com/R2YpfFVh

edit3: I'd install the php-gd module manually but since the container is stopping after a few seconds I can't do this via docker exec nextcloud bash. Is there any other way of doing this without building a container manually?

tbrasser commented 7 years ago

@Wonderfall , sorry to bump like this. But your Nextcloud Docker is the only one that I found that allows me to use my own Reverse Proxy/SSL configuration and have Nextcloud running locally on http (port 8888). But I've been unable to use it for over a week now and trying other containers (such as the official one) only seem to make my problems worse.

lachmanfrantisek commented 7 years ago

I'm having the same problem since the last upgrade. I've looked at the dockerfile and the 'gd' module should be installed.

It would be nice to have this super image ready again. Thanks for any advice.

tbrasser commented 7 years ago

Last thing I changed before the error was enabling the richdocuments app, could that have caused this behavior? @lachmanfrantisek, any chance you did something similar?

lachmanfrantisek commented 7 years ago

@tbrasser No, I didn't change anything. I've switched back to the old image and everything is fine again. But it is not a solution. I'm not sure if there were some changes in the building process or the new nextcloud version broke it. Files for the image have not been changed last 24 days.

Angelinsky7 commented 7 years ago

after doing an apk update and apk upgrade into the image i manage to remove this error

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php7/modules/gd.so' - Error relocating /usr/lib/libpng16.so.16: inflateValidate: symbol not found in Unknown on line 0

but i keep having

Fatal Error Zend OPcache cannot allocate buffer for interned strings

Angelinsky7 commented 7 years ago

Seems that it's this file causing issue : /etc/php7/conf.d/00_opcache.ini

Original is

zend_extension=opcache.so opcache.enable=1 opcache.enable_cli=1 opcache.fast_shutdown=1 opcache.memory_consumption= opcache.interned_strings_buffer=16 opcache.max_accelerated_files=5413 opcache.revalidate_freq=60

After editing it replacing <OPCACHE_MEM_SIZE> with 128 (the value from the environnement variable)

my php is working !!!

PHP 7.0.15 (cli) (built: Jan 19 2017 21:25:43) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.0.15, Copyright (c) 1999-2017, by Zend Technologies

tbrasser commented 7 years ago

@Angelinsky7 , how did you run apt-get update and apt-get upgrade in the image? It's not even starting over here. (aha, on alpine you use apk, learning something new every day :) )

Angelinsky7 commented 7 years ago

i use docker-compose.... so even if the machine doesn't start i manage to launch it with

docker-compose run app sh

like that you can overwrite the command options... Here's my modified docker-compose file to 'patch' this issue see : command: [ 'sh', '-c', 'apk update && apk upgrade && sed -i "s/opcache.memory_consumption=<OPCACHE_MEM_SIZE>/opcache.memory_consumption=128/g" /etc/php7/conf.d/00_opcache.ini && run.sh']

version: '2' services: app: image: wonderfall/nextcloud ports:

  • "3080:8888" volumes:
  • ./apps:/apps2
  • ./config:/config
  • ./data:/data links:
  • db:mysql environment:
  • UID=991
  • GID=991
  • UPLOAD_MAX_SIZE=10G
  • APC_SHM_SIZE=128M
  • OPCACHE_MEM_SIZE=128
  • REDIS_MAX_MEMORY=64mb
  • CRON_PERIOD=15m
  • TZ=Europe/Zurich
  • ADMIN_USER=admin
  • ADMIN_PASSWORD=OMMITTED
  • DB_TYPE=mysql
  • DB_NAME=nextcloud
  • DB_USER=nextcloud
  • DB_PASSWORD=OMMITTED
  • DB_HOST=mysql restart: always command: [ 'sh', '-c', 'apk update && apk upgrade && sed -i "s/opcache.memory_consumption=/opcache.memory_consumption=128/g" /etc/php7/conf.d/00_opcache.ini && run.sh'] db: image: mysql volumes:
  • ./db:/var/lib/mysql environment:
  • MYSQL_ROOT_PASSWORD=OMMITTED
  • MYSQL_DATABASE=nextcloud
  • MYSQL_USER=nextcloud
  • MYSQL_PASSWORD=OMMITTED restart: always collabora: image: collabora/code ports:
  • "9980:9980" environment:
  • domain=DOMAIN.COM cap_add:
  • mknod restart: always
tbrasser commented 7 years ago

-- revoked, will add more info once I find out how to add

command: [ 'sh', '-c', 'apk update && apk upgrade && sed -i "s/opcache.memory_consumption=/opcache.memory_consumption=128/g" /etc/php7/conf.d/00_opcache.ini && run.sh']

to my Docker Run command

shred commented 7 years ago

In the Dockerfile, I have added an && apk -U upgrade \ just before the apk -U add line, and rebuilt the image. Nextcloud started up fine after that, also without Zend OPCache error. It seems that the used libpng requires zlib 1.2.8.1, but alpine:edge currently installs zlib 1.2.8. Upgrade installs zlib 1.2.11.

tbrasser commented 7 years ago

Thanks @shred (and everyone else), cloned the repository, added && apk -U upgrade \ to the Dockerfile, build the image, and now it's running perfectly again :D

Now on to the next challenge, find / build a LibreOffice Online / Collabora Online image that doesn't need SSL localy (I'm using Traefik.io as a reverse proxy and everything has worked out-of-the box for an insane amount of images/containers, but LibreOffice is killing me xD)

Edit1: I guess I'll leave this issue open for now, since it isn't automatically fixed. Will this apk upgrade interfere with stuff in the future or is it a safe fix that we can merge?

edit2: I can't reopen this issue, meh

Wonderfall commented 7 years ago

I've seen it but I really don't have time (med school) to investigate... Sorry for the lack of support, I'm literally lost with all these issues.

I've made an update featuring PHP 7.1 but I'm running into an issue with this php redis extension... Very discouraging.

Wonderfall commented 7 years ago

This is now fixed. I've made the choice to remove redis extension. Anyway, the redis server shouldn't be in the container...

Hope it'll be good for you all and don't hesitate to open a PR next time.

skriems commented 7 years ago

@Wonderfall thanks and +1 for removing redis. Beeing new to that feature, that means I now need to link this Container to an existent redis Container, right?

Wonderfall commented 7 years ago

@skriems Yes exactly. But for now the php redis extension doesn't work, Alpine doesn't provide it and pecl install redis doesn't seem to install the module correctly (but that's working well for apcu). Redis extension or not, I was anyway planning to remove the server part.

xsteadfastx commented 7 years ago

i ran into the same problem with the official wallabag container. i always add a apk upgrade --available to the dockerfile to upgrade to the latest basing alpine stuff... if something changed there and its not in the already pulled image there are problems. just a hint.