Bad config encountered during initialization: The 'contents_manager_class' trait of a SingleUserLabApp instance expected a subclass of 'jupyter_server.services.contents.manager.ContentsManager', not the S3ContentsManager S3ContentsManager

Hi,
I am trying to setup s3contentsmanager to save the notebooks in s3. Have jupyter_server_config.py at /etc/jupyter.While starting the user pod, it returns the following error message:
Bad config encountered during initialization: The ‘contents_manager_class’ trait of a SingleUserLabApp instance expected a subclass of ‘jupyter_server.services.contents.manager.ContentsManager’, not the S3ContentsManager S3ContentsManager.

Here’s the jupyter_server_config.py:

# Configuration file for jupyter-notebook.

from s3contents import S3ContentsManager
import os
user = os.environ['JUPYTERHUB_USER']
# Tell Jupyter to use S3ContentsManager for all storage.

c.ServerApp.contents_manager_class = S3ContentsManager
#c.ServerApp.root_dir = '/home/jovyan'
c.S3ContentsManager.bucket = os.environ['S3_BUCKET']
c.S3ContentsManager.region_name = os.environ['AWS_REGION']
c.S3ContentsManager.prefix = "{}/{}".format(os.environ['S3_PREFIX'], user)

Any help, please?

It looks like s3contents is not compatible with jupyter-server or recent versions of jupyter-notebook (that are based on jupyter-server), only old versions of the jupyter-notebook server. You can opt-in to this with:

singleuser:
  extraEnv:
    JUPYTERHUB_SINGLEUSER_APP: "notebook.notebookapp.NotebookApp"