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

Jupyterhub terminated immediately after start #63

Open
alex9434 opened this issue Jun 17, 2020 · 5 comments
Open

Jupyterhub terminated immediately after start #63

alex9434 opened this issue Jun 17, 2020 · 5 comments
Labels

Comments

@alex9434
Copy link

Bug description

Trying to run jupyterhub as user jupyterhub following instructions from https://jupyterhub.readthedocs.io/en/stable/reference/config-sudo.html
Jupyterhub starts and then terminates:

sudo -u jupyterhub -g jupyterhub /opt/conda/bin/jupyterhub --Spawner.default_url='/lab' --config=/opt/conda/etc/jupyterhub/jupyterhub_config.py --debug
[D 2020-06-17 08:40:49.839 JupyterHub application:556] Looking for /opt/conda/etc/jupyterhub/jupyterhub_config in /opt/conda/etc/jupyterhub
[D 2020-06-17 08:40:49.842 JupyterHub application:578] Loaded config file: /opt/conda/etc/jupyterhub/jupyterhub_config.py
[D 2020-06-17 08:40:49.847 JupyterHub app:2079] Writing PID 691 to /opt/conda/etc/jupyterhub/jupyterhub-proxy.pid
[I 2020-06-17 08:40:49.849 JupyterHub app:2120] Using Authenticator: jupyterhub.auth.PAMAuthenticator-1.0.0
[I 2020-06-17 08:40:49.849 JupyterHub app:2120] Using Spawner: jupyterhub.spawner.LocalProcessSpawner-1.0.0
[I 2020-06-17 08:40:49.867 JupyterHub app:1257] Loading cookie_secret from /opt/conda/etc/jupyterhub/jupyterhub_cookie_secret
[D 2020-06-17 08:40:49.869 JupyterHub app:1424] Connecting to db: postgresql://jupyterhub:[redacted]@database.lan:5432/jupyterhub
[D 2020-06-17 08:40:50.028 JupyterHub orm:749] database schema version found: 4dc2d5a8c53c
[I 2020-06-17 08:40:50.075 JupyterHub proxy:460] Generating new CONFIGPROXY_AUTH_TOKEN
[I 2020-06-17 08:40:50.235 JupyterHub app:1563] Not using whitelist. Any authenticated user will be allowed.
[D 2020-06-17 08:40:50.304 JupyterHub app:1910] Loading state for l from db
[D 2020-06-17 08:40:50.308 JupyterHub app:1910] Loading state for a from db
[D 2020-06-17 08:40:50.312 JupyterHub app:1910] Loading state for x from db
[D 2020-06-17 08:40:50.316 JupyterHub app:1910] Loading state for e from db
[D 2020-06-17 08:40:50.319 JupyterHub app:1910] Loading state for alex from db
[D 2020-06-17 08:40:50.322 JupyterHub app:1926] Loaded users:
           l admin
           a admin
           x admin
           e admin
        alex admin
[I 2020-06-17 08:40:50.370 JupyterHub app:2337] Hub API listening on http://127.0.0.1:8081/jupyter/hub/
[W 2020-06-17 08:40:50.371 JupyterHub proxy:516] Found proxy pid file: /opt/conda/etc/jupyterhub/jupyterhub-proxy.pid
[W 2020-06-17 08:40:50.372 JupyterHub proxy:533] Proxy still running at pid=691
Terminated

Expected behaviour

Jupyterhub does not terminate immediately after restart

Actual behaviour

Jupyterhub terminates after start

How to reproduce

Followed instructions from
https://jupyterhub.readthedocs.io/en/stable/reference/config-sudo.html

Your personal set up

  • OS:
    Debian
  • Version:
    10 (stable)
  • Configuration:
c.Spawner.default_url = '/lab'
c.JupyterHub.bind_url = 'http://:8000/jupyter'
c.JupyterHub.cookie_secret_file = '/opt/conda/etc/jupyterhub/jupyterhub_cookie_secret'

c.PAMAuthenticator.admin_groups = {'sudo'}
c.Authenticator.admin_users = {'alex'}
c.LocalAuthenticator.create_system_users = True

pg_pass = '...'
pg_host = 'database.lan'

c.JupyterHub.db_url = 'postgresql://jupyterhub:{}@{}:5432/jupyterhub'.format(
    pg_pass, pg_host
)

## File to write PID Useful for daemonizing JupyterHub.
c.JupyterHub.pid_file = '/opt/conda/etc/jupyterhub/jupyterhub-proxy.pid'
@alex9434 alex9434 added the bug label Jun 17, 2020
@welcome
Copy link

welcome bot commented Jun 17, 2020

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@consideRatio
Copy link
Member

I think this relates to the two warnings before the "Terminated" log message. Could it be so that JupyterHub found an old process running and didn't try start up fully again, and it found it using the pid file?

I would inspect the pid file, and i presume it describes a process ID. Then i would inspect if such process ID is running. If so, shut it down and then try start up jupyterhub.

I may also try deleting the file entirely etc.

@consideRatio
Copy link
Member

I think it could make sense to improve the log message if this was the correct analysis as a followup to this, as it isnt fully clear to me or you what goes on.

@alex9434
Copy link
Author

alex9434 commented Jun 18, 2020

Hi @consideRatio the same things happen immediately after system boot. I have installed in an LXC container that does not have any other daemons (other than DHCP for network) installed. Therefore I suspect that is not caused by an old process. Anything I could do to understand what is going on? Does it have something to to with rights of the process? I have created a system user "jupyterhub" and try to run it under that system user.

@consideRatio
Copy link
Member

I know too little about this, so i would debug by inspecting my processes and then search for the code that led to the termination by looking for the log statements youve seen in the end, and then inspect that logic, and then figure out why it triggered to terminate the hub.

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

No branches or pull requests

2 participants