leepeuker / movary

Self hosted web app to track and rate your watched movies
MIT License
409 stars 14 forks source link

Container dies after a few days #294

Open samcro1967 opened 1 year ago

samcro1967 commented 1 year ago

I have noticed the container dies after running for a few days. Removing the container and adding it back gets it working again. Any ideas?

2023-03-03 10:59:55,476 INFO success: movary entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)2023-03-03 11:00:02,486 WARN received SIGQUIT indicating exit request
2023-03-03 11:00:02,487 INFO waiting for syslogd, nginxd, php-fpmd, crond, movary to die
2023-03-03 11:00:03,491 INFO stopped: movary (terminated by SIGTERM)
2023-03-03 11:00:05,493 INFO waiting for syslogd, nginxd, php-fpmd, crond to die
2023-03-03 11:00:05,494 INFO stopped: crond (terminated by SIGTERM)
2023-03-03 11:00:05,494 INFO reaped unknown pid 15200 (exit status 0)
2023-03-03 11:00:05,494 INFO reaped unknown pid 15201 (exit status 0)
[03-Mar-2023 11:00:05] NOTICE: Terminating ...
[03-Mar-2023 11:00:05] NOTICE: exiting, bye-bye!
2023-03-03 11:00:06,803 INFO stopped: php-fpmd (exit status 0)
2023-03-03 11:00:06,914 INFO stopped: nginxd (exit status 0)
[SYSLOG] syslog-ng[56]: syslog-ng shutting down; version='3.38.1'
2023-03-03 11:00:08,084 INFO stopped: syslogd (exit status 0)
error: failed switching to "root": operation not permitted
error: failed switching to "root": operation not permitted
error: failed switching to "root": operation not permitted
leepeuker commented 1 year ago

This is rooted somewhere in the base image (webdevops/php-nginx) we are using, see a discussion about it e.g. here

I am not sure how to solve this besides recreating the container. The current plan is to rework the docker image which should solve this problem.

fscorrupt commented 1 year ago

i have same problem with new installation: "error: failed switching to "root": operation not permitted" im using the nightly build, is there a fix/workaround?

leepeuker commented 1 year ago

Hey, the current fix is to recreate (not just restart!) the container. With docker compose a down + up should do it, without compose you have to stop + remove the container and then start it again.

If you use only managed volumes and not bind them manually from your host you should not get this problem.

slimshizn commented 1 year ago

Hey just noticed this is still a thing. I had to manually remove the container, and then docker-compose up -d movary to have it work again. Is this being worked on?

samcro1967 commented 1 year ago

I am just running the script below every 30 mins via cron to look for the error, send an email, remove the container, and re-create the container:

``

!/bin/bash

ERROR_COUNT=$(docker logs movary --since 30m 2>&1 | grep 'operation not permitted' | wc -l) echo $ERROR_COUNT if [ "$ERROR_COUNT" != "0" ]; then echo "Movary operation not permitted, restarted movary" | sudo ssmtp user@mydomain.net docker rm -f movary cd /home/user/Documents/Docker && \ docker compose -f docker-compose.yml --env-file .env up -d movary fi

leepeuker commented 1 year ago

Is this being worked on?

Not currently sadly (I would love to, but did not find the time for it yet). Here is the main issue for this topic https://github.com/leepeuker/movary/issues/206 The rework of the docker image is the main blocker for version 1.0

leepeuker commented 1 year ago

@samcro1967 How many emails about errors do you get? For me the containers run without issues for weeks usually. would love to find out what is causing your problems

samcro1967 commented 1 year ago

Looks like I have had 23 instances with the first being on March 7th, 2023. Seeing it about once a week, every once in awhile it is every 2 weeks.