dawarich icon indicating copy to clipboard operation
dawarich copied to clipboard

A server is already running (pid: 10, file: /var/app/tmp/pids/server.pid).

Open adromir opened this issue 11 months ago • 13 comments

OS & Hardware Unraid

Version any - Docker

Describe the bug Whenever the Container crashes it fails to restart, because of said file (/var/app/tmp/pids/server.pid) is still present, since it doesnt get cleaned up on crash and Ruby on Rails "believes"" there is already a server running and exits.

Proposed fix: Running a check on container Start if file is present and then delete it

Additional context Add any other context about the problem here.

adromir avatar Jan 25 '25 10:01 adromir

/var/app/tmp shouldn't be persistent volume. On container crash the entire /var/ should be recreated.

shaman007 avatar Jan 26 '25 10:01 shaman007

but how do i make Imports persistent then?

adromir avatar Jan 26 '25 10:01 adromir

I mount /var/app/tmp/imports/watched and /var/app/public as persistent. Make persistent only the things you really need to be persistgent. In the ideal situation, / must be R/O, and everyting RW (/tmp, everyting ../run/..) must me mounted as EmptyDir and re-created every container restart.

shaman007 avatar Jan 26 '25 10:01 shaman007

But these are the only Directories i am mounting as persistent directories as well. As soon as I recreate the container, the problem is gone. But not if I restart it.

adromir avatar Jan 26 '25 11:01 adromir

Shouln't it be restarted if app crashes?

shaman007 avatar Jan 26 '25 11:01 shaman007

As i am saying from the beginning, when i just restart the Container, the App fails to start because of that. Since i am not using the docker compose in this case, there is no health check, so its not restarting, if there is no exit signal from the app

adromir avatar Jan 26 '25 13:01 adromir

i get the same error with the docker on unraid every couple of days. i have to force update aka recreate the container to get it running again.

Trancep0rt avatar Jan 28 '25 13:01 Trancep0rt

same issue here, also on unraid. Good to know that force update is a workaround

swaggerino avatar Jan 29 '25 16:01 swaggerino

i get the same error with the docker on unraid every couple of days. i have to force update aka recreate the container to get it running again.

Same here, recreating fixes this, but thats not the solution.

markggn avatar Jan 31 '25 08:01 markggn

I see the same issue. Is this just related to the Docker on Unraid, or is it a general issue? At the moment the Docker container stops almost every night. just restarting it does not even allow to show the log file with the Unraid GUI because it closes so fast.

andrepue avatar Feb 27 '25 14:02 andrepue

It seems to be a problem with the Unraid template. I installed it via docker compose on my unraid now and never ran into the problem again. So if you use the docker compose Plugin on unraid and install dawarich with compose, it's not an issue anymore

adromir avatar Feb 27 '25 14:02 adromir

after your answer yesterday I was trying a bit with the Unraid Docker Templated, comparing it to the Docker-Compose file. I am not 100% sure yet, but there is a difference in the "Command" section of the Webserver Container.

entrypoint: web-entrypoint.sh command: ['bin/rails', 'server', '-p', '3000', '-b', '::']

The Unraid Template uses under "Post Arguments" in "Advanced View" only bin/dev. The Sidekiq Container template uses sidekiq in the "Post Arguments" After several trials I ended up with the "Post arguments" like in the docker-compose file, just without the quotation marks:

bin/rails server -p 3000 -b ::

At the moment, even after restarting the Dawarich-Container there is no problem yet. In the past, restarting already gave me this problem. Maybe you can try this out.

andrepue avatar Feb 28 '25 07:02 andrepue

I have the same problem and find it to be really odd as i never seen docker containers behaving in a similar way.

Although i must say that the solution mentioned by @andrepue worked for me

Dinth avatar Apr 09 '25 11:04 Dinth

@nwithan8 is this something you can help with?

after your answer yesterday I was trying a bit with the Unraid Docker Templated, comparing it to the Docker-Compose file. I am not 100% sure yet, but there is a difference in the "Command" section of the Webserver Container.

entrypoint: web-entrypoint.sh command: ['bin/rails', 'server', '-p', '3000', '-b', '::']

The Unraid Template uses under "Post Arguments" in "Advanced View" only bin/dev. The Sidekiq Container template uses sidekiq in the "Post Arguments" After several trials I ended up with the "Post arguments" like in the docker-compose file, just without the quotation marks:

bin/rails server -p 3000 -b ::

At the moment, even after restarting the Dawarich-Container there is no problem yet. In the past, restarting already gave me this problem. Maybe you can try this out.

Freika avatar May 21 '25 22:05 Freika

@nwithan8 is this something you can help with?

after your answer yesterday I was trying a bit with the Unraid Docker Templated, comparing it to the Docker-Compose file. I am not 100% sure yet, but there is a difference in the "Command" section of the Webserver Container. entrypoint: web-entrypoint.sh command: ['bin/rails', 'server', '-p', '3000', '-b', '::'] The Unraid Template uses under "Post Arguments" in "Advanced View" only bin/dev. The Sidekiq Container template uses sidekiq in the "Post Arguments" After several trials I ended up with the "Post arguments" like in the docker-compose file, just without the quotation marks: bin/rails server -p 3000 -b :: At the moment, even after restarting the Dawarich-Container there is no problem yet. In the past, restarting already gave me this problem. Maybe you can try this out.

This was resolved in March via https://github.com/nwithan8/unraid_templates/commit/f2e580ebbde4a6b6a91b93ac8a855f48834a161f

Sounds like the user had the old version cached.

nwithan8 avatar May 22 '25 04:05 nwithan8

Thanks!

Freika avatar May 22 '25 19:05 Freika