Skip to content

JupyterHub 4 deprecation warning  #306

@cmd-ntrf

Description

@cmd-ntrf

After spawning a job with batchspawner 1.3.0 and JupyterHub 4.1.4, the following deprecation warning is logged:

[I 2024-04-04 15:55:26.989 JupyterHub log:192] 200 POST /hub/api/batchspawner ([email protected]) >
[W 2024-04-04 15:55:27.093 JupyterHub spawner:172]
     The shared database session at Spawner.db is deprecated, and will be removed.
     Please manage your own database and connections.

     Contact JupyterHub at https://github.com/jupyterhub/jupyterhub/issues/3700
     if you have questions or ideas about direct database needs for your Spawner.

This warning is triggered when a Spawner access the property db. In the case of BatchSpawner, it happens only here:

self.db.commit()

And base on git blame, this line was added 9 years ago as it was recommended by JupyterHub doc at the time.
88b6a4f

Based on this JupyterHub commit jupyterhub/jupyterhub@ac3ef1e , db has been depecrated since JupyterHub 3. So we either remove it entirely if it serves no purpose for any of the supported JupyterHub versions, or we check if JupyterHub version is smaller than 3 before executing the db commit line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions