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 exited with code 1: Found database schema version 4dc2d5a8c53c != 896818069c98 #2711

Closed
relyativist opened this issue Aug 30, 2019 · 4 comments

Comments

@relyativist
Copy link

Hi! Thanks for using JupyterHub.

If you are reporting an issue with JupyterHub, please use the GitHub issue search feature to check if your issue has been asked already. If it has, please add your comments to the existing issue.

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. add to docker-compose.yml:
jupyterhub:
    #Config for Hub+proxy
    build: jupyterhub
    image: jupyterhub_img
    container_name: jupyterhub
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - jupyterhub_data:/srv/jupyterhub
    environment:
      - DOCKER_JUPYTER_CONTAINER=jupyterlab_img
      - DOCKER_NETWORK_NAME=${COMPOSE_PROJECT_NAME}_default
      - HUB_IP=jupyterhub
      - HOST
    labels:
      - "traefik.enable=true"
      - "traefik.frontend.rule=Host:${HOST}"
    restart: on-failure
  1. Jupyterhub-config.py
import os

## Generic
c.JupyterHub.admin_access = True
c.Spawner.default_url = '/lab'

## Authenticator
from jhub_cas_authenticator.cas_auth import CASAuthenticator
c.JupyterHub.authenticator_class = CASAuthenticator

# The CAS URLs to redirect (un)authenticated users to.
c.CASAuthenticator.cas_login_url = 'https://ironman/login'
c.CASLocalAuthenticator.cas_logout_url = 'https://ironman/logout'

# The CAS endpoint for validating service tickets.
c.CASAuthenticator.cas_service_validate_url = 'https://ironman/serviceValidate'

# The service URL the CAS server will redirect the browser back to on successful authentication.
c.CASAuthenticator.cas_service_url = 'https://%s/hub/login' % os.environ['HOST']

c.Authenticator.admin_users = { 'lucadefe' }

## Docker spawner
c.JupyterHub.spawner_class = 'dockerspawner.DockerSpawner'
c.DockerSpawner.image = os.environ['DOCKER_JUPYTER_CONTAINER']
c.DockerSpawner.network_name = os.environ['DOCKER_NETWORK_NAME']
# See https://github.com/jupyterhub/dockerspawner/blob/master/examples/oauth/jupyterhub_config.py
#c.JupyterHub.hub_ip = os.environ['HUB_IP']
c.JupyterHub.hub_ip = os.environ['HUB_IP']

# user data persistence
# see https://github.com/jupyterhub/dockerspawner#data-persistence-and-dockerspawner
notebook_dir = os.environ.get('DOCKER_NOTEBOOK_DIR') or '/home/jovyan'
c.DockerSpawner.notebook_dir = notebook_dir
c.DockerSpawner.volumes = { 'jupyterhub-user-{username}': notebook_dir }

# Other stuff
c.Spawner.cpu_limit = 1
c.Spawner.mem_limit = '10G'


# Services
c.JupyterHub.services = [
    {
        'name': 'cull-idle',
        'admin': True,
        'command': [sys.executable, 'cull_idle_servers.py', '--timeout=3600'],
    }
]

Expected behavior

jupyterhub       | [I 2019-08-30 08:33:35.857 JupyterHub app:1667] Using Authenticator: jhub_cas_authenticator.cas_auth.CASAuthenticator
jupyterhub       | [I 2019-08-30 08:33:35.857 JupyterHub app:1667] Using Spawner: dockerspawner.dockerspawner.DockerSpawner-0.10.0
jupyterhub       | [I 2019-08-30 08:33:35.860 JupyterHub app:1014] Loading cookie_secret from /srv/jupyterhub/jupyterhub_cookie_secret
jupyterhub       | Found database schema version 4dc2d5a8c53c != 896818069c98. Backup your database and run `jupyterhub upgrade-db` to upgrade to the latest schema.
jupyterhub exited with code 1

Desktop (please complete the following information):

  • OS: linux mint
@willingc
Copy link
Contributor

@relyativist It looks like your database should be upgraded.

Backup your database and run jupyterhub upgrade-db to upgrade to the latest schema

Backup your database and Upgrade database

@kinow
Copy link
Contributor

kinow commented Sep 22, 2019

Had the same issue after updating to 1.0, and the command above fixed it for me 👍

@willingc
Copy link
Contributor

Thanks @kinow. @relyativist I'm closing this but if you have additional difficulty, please leave a message here. Thanks.

@ealyn
Copy link

ealyn commented Apr 23, 2023

@relyativist It looks like your database should be upgraded.

Backup your database and run jupyterhub upgrade-db to upgrade to the latest schema

Backup your database and Upgrade database

This method dose not work in jupyterhub 3.0.0 (in z2jh 2.0.0).
When I upgrade kubespawner pip package, the error cames up.
After modify start up command to
jupyterhub upgrade-db && jupyterhub --config /usr/local/etc/jupyterhub/jupyterhub_config.py
it became:

[I 2023-04-23 13:14:15.615 alembic.runtime.migration migration:204] Context impl SQLiteImpl.
[I 2023-04-23 13:14:15.615 alembic.runtime.migration migration:207] Will assume non-transactional DDL.
[I 2023-04-23 13:14:15.621 alembic.runtime.migration migration:618] Running stamp_revision  -> 651f5419b74d
Loading /usr/local/etc/jupyterhub/secret/values.yaml
No config at /usr/local/etc/jupyterhub/existing-secret/values.yaml
[I 2023-04-23 13:14:16.546 JupyterHub app:2775] Running JupyterHub version 3.0.0
[I 2023-04-23 13:14:16.546 JupyterHub app:2805] Using Authenticator: jupyterhub.auth.DummyAuthenticator-3.0.0
[I 2023-04-23 13:14:16.546 JupyterHub app:2805] Using Spawner: kubespawner.spawner.KubeSpawner-4.3.0
[I 2023-04-23 13:14:16.546 JupyterHub app:2805] Using Proxy: myproxy.KubeIngressProxy
Found database schema version 0eee8c825d24 != 651f5419b74d. Backup your database and run `jupyterhub upgrade-db` to upgrade to the latest schema.

I must update alembic_version set version_num manully to fix it.

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

No branches or pull requests

4 participants