jupyterhub / binderhub

Run your code in the cloud, with technology so advanced, it feels like magic!
https://binderhub.readthedocs.io
BSD 3-Clause "New" or "Revised" License
2.57k stars 390 forks source link

use_registry: false raises HTTP 401: Unauthorized #1645

Closed rgaiacs closed 1 year ago

rgaiacs commented 1 year ago

Bug description

Disable use of registry in HELM configuration (https://github.com/jupyterhub/binderhub/blob/main/helm-chart/binderhub/values.yaml#L50) raises HTTP 401: Unauthorized internally.

Expected behaviour

Have a functional Binder instance without use registry.

Actual behaviour

[E 230309 12:50:23 builder:394] Tornado HTTP Timeout error: Failed to get image manifest for binder-2dexamples-2djupyterlab-5b7057:be84880214e57de971825161a2cd02137de3b4ef
    Traceback (most recent call last):
      File "/usr/local/lib/python3.11/site-packages/binderhub/builder.py", line 388, in get
        image_manifest = await self.registry.get_image_manifest(
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/binderhub/registry.py", line 263, in get_image_manifest
        token = await self._get_token(
                ^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.11/site-packages/binderhub/registry.py", line 221, in _get_token
        auth_resp = await client.fetch(auth_req)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    tornado.httpclient.HTTPClientError: HTTP 401: Unauthorized

How to reproduce

Create config.yaml with

config:
  BinderHub:
    use_registry: false

In one terminal, run

$ minikube tunnel

In another terminal, run

$ helm repo add jupyterhub https://jupyterhub.github.io/helm-chart/
$ helm repo update
$ helm upgrade --cleanup-on-fail \
    --install my-local-binderhub jupyterhub/binderhub \
    --version=1.0.0-0.dev.git.3025.h276be90 \
    --namespace=binderhub \
    --create-namespace \
    --values secret.yaml \
    --values config.yaml

Your personal set up

Ubuntu 22.04 on Windows Subsystem for Linux (WSL2)

$ uname -a
Linux KOL22104 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
consideRatio commented 1 year ago