Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting existing container fails #1

Open
dpwrussell opened this issue Jul 18, 2017 · 6 comments
Open

Starting existing container fails #1

dpwrussell opened this issue Jul 18, 2017 · 6 comments

Comments

@dpwrussell
Copy link
Member

dpwrussell commented Jul 18, 2017

If you create a container in the usual way, stop it and restart, the following warning occurs. I think we should work around that for the docker case as starting a container you know there can not be existing running processes.

web_1    | 0 static files copied to '/opt/omero/web/OMERO.web/lib/python/omeroweb/static', 611 unmodified, 2 post-processed.
web_1    | Clearing expired sessions. This may take some time... [OK]
web_1    | Starting OMERO.web... [ERROR] OMERO.web workers (PID 79) - no such process. Use `ps aux | grep /opt/omero/web/OMERO.web/var/django.pid` and kill stale processes by hand.
web_1    | Removed stale /opt/omero/web/OMERO.web/var/django.pid
@manics
Copy link
Member

manics commented Jul 19, 2017

Sounds like a bug in OMERO.web- if it's terminated with docker stop (not docker kill) it should shut-down cleanly and remove it's PID file. Might need a signal handler added to it?

@dpwrussell
Copy link
Member Author

dpwrussell commented Jul 21, 2017

I just confirmed that docker-compose is using docker stop as opposed to docker kill and it certainly is. I also tried start -> stop -> start with docker, without compose and the error is the same.

@manics
Copy link
Member

manics commented Jul 25, 2017

If I run omero web --foreground locally (not in container) Ctrl-C causes a clean shutdown:

$ OMERO.web/bin/omero web start --foreground
Post-processed 'omeroweb.viewer.min.css' as 'omeroweb.viewer.min.css'
Post-processed 'omeroweb.viewer.min.js' as 'omeroweb.viewer.min.js'

0 static files copied to '/home/spli/OMERO.web/lib/python/omeroweb/static', 611 unmodified, 2 post-processed.
Clearing expired sessions. This may take some time... [OK]
Starting OMERO.web... [2017-07-25 15:15:17 +0000] [14389] [INFO] Starting gunicorn 19.7.1
[2017-07-25 15:15:17 +0000] [14389] [INFO] Listening at: http://127.0.0.1:14080 (14389)
[2017-07-25 15:15:17 +0000] [14389] [INFO] Using worker: sync
[2017-07-25 15:15:17 +0000] [14394] [INFO] Booting worker with pid: 14394
[2017-07-25 15:15:17 +0000] [14395] [INFO] Booting worker with pid: 14395
[2017-07-25 15:15:17 +0000] [14404] [INFO] Booting worker with pid: 14404
[2017-07-25 15:15:17 +0000] [14405] [INFO] Booting worker with pid: 14405
[2017-07-25 15:15:17 +0000] [14414] [INFO] Booting worker with pid: 14414

^CCancelled
[2017-07-25 15:15:29 +0000] [14389] [INFO] Handling signal: int
[2017-07-25 16:15:29 +0000] [14394] [INFO] Worker exiting (pid: 14394)
[2017-07-25 16:15:29 +0000] [14414] [INFO] Worker exiting (pid: 14414)
[2017-07-25 16:15:29 +0000] [14404] [INFO] Worker exiting (pid: 14404)
[2017-07-25 16:15:29 +0000] [14395] [INFO] Worker exiting (pid: 14395)
[2017-07-25 16:15:29 +0000] [14405] [INFO] Worker exiting (pid: 14405)
[2017-07-25 15:15:29 +0000] [14389] [INFO] Shutting down: Master

docker stop doesn't do a clean shutdown, defining STOPSIGNAL SIGINT doesn't seem to work either. This requires more investigation.

@joshmoore
Copy link
Member

Is an exec perhaps needed for the last file?

https://github.com/Yelp/dumb-init#using-a-shell-for-pre-start-hooks

The call hierarchy is likely:

  • docker
    • dumb-init
      • bash
        • 99
          • exec python

which would get rid of the 99 shell but not the for-loop one.

@manics
Copy link
Member

manics commented Aug 14, 2017

I tried that before, and also tried adding a signal handler without success.

manics added a commit to manics/omero-web-docker that referenced this issue Oct 26, 2017
@manics
Copy link
Member

manics commented Oct 26, 2017

I've opened a PR with the suggested workaround #14

This issue should remain open until we figure out why OMERO.web isn't being shutdown cleanly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants