yuvipanda / jupyterhub-ssh

SSH Access to JupyterHubs
BSD 3-Clause "New" or "Revised" License
96 stars 29 forks source link

KeyError when `ssh` is missing from config #80

Closed iameskild closed 1 year ago

iameskild commented 1 year ago

When using the latest version of jupyterhub-ssh, I get the following error message when jupyterhub-ssh starts up:

[JupyterHubSSH] ERROR | Exception while loading config file /srv/jupyterhub-ssh/jupyterhub_ssh_config.py
Traceback (most recent call last):
  File "/home/jovyan/.local/lib/python3.8/site-packages/traitlets/config/application.py", line 909, in _load_config_files
    config = loader.load_config()
  File "/home/jovyan/.local/lib/python3.8/site-packages/traitlets/config/loader.py", line 626, in load_config
    self._read_file_as_dict()
  File "/home/jovyan/.local/lib/python3.8/site-packages/traitlets/config/loader.py", line 659, in _read_file_as_dict
    exec(compile(f.read(), conf_filename, "exec"), namespace, namespace)  # noqa
  File "/srv/jupyterhub-ssh/jupyterhub_ssh_config.py", line 11, in <module>
    for app, cfg in config["ssh"]["config"].items():
  File "/home/jovyan/.local/lib/python3.8/site-packages/ruamel/yaml/comments.py", line 842, in __getitem__
    return ordereddict.__getitem__(self, key)
KeyError: 'ssh'

As a temporary workaround, I included the following in my values.yaml:

ssh:
  config:
    JupyterHubSSH:
      debug: true