tornado.httpclient.HTTPError: HTTP 401: Unauthorized

#1

Hi guys, I launched binder on Google Cloud, I see binder page, but when I try to add repository - Im getting Internal Server Error.
I checked the logs and found this one

[I 190208 08:39:41 repoproviders:441] Using cached ref for https://api.github.com/repos/minrk/ligo-binder/commits/master: b8259dac9eb4aa5f2d65d8881f2da94a4952a195
[E 190208 08:39:41 web:1621] Uncaught exception GET /build/gh/minrk/ligo-binder/master (234.234.23.23)
    HTTPServerRequest(protocol='http', host='binder.givemefive.in', method='GET', uri='/build/gh/minrk/ligo-binder/master', version='HTTP/1.1', remote_ip='234.234.23.23')
    Traceback (most recent call last):
      File "/usr/local/lib/python3.6/site-packages/tornado/web.py", line 1543, in _execute
        result = yield result
      File "/usr/local/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
        value = future.result()
      File "/usr/local/lib/python3.6/site-packages/binderhub/builder.py", line 273, in get
        image_manifest = await self.registry.get_image_manifest(*'/'.join(image_name.split('/')[-2:]).split(':', 1))
      File "/usr/local/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run
        yielded = self.gen.throw(*exc_info)
      File "/usr/local/lib/python3.6/site-packages/binderhub/registry.py", line 199, in get_image_manifest
        auth_resp = yield client.fetch(auth_req)
      File "/usr/local/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
        value = future.result()
    tornado.httpclient.HTTPError: HTTP 401: Unauthorized

I got stuck.
I will appreciate any help!

#2

hey - could you post a link (or copy/paste the text of) your config.yml and secret.yml file? (make sure to redact the sensitive info). Usually errors and such are a result of something in one of those files!

#3

config.yaml

config:
  BinderHub:
    use_registry: true
    image_prefix: gcr.io/binder-mybinder5/binder-prod-
config:
  BinderHub:
    hub_url: http://external_ip_that_I_got_from_get_svc_proxy-public_command

secret.yaml

jupyterhub:
  hub:
    services:
      binder:
        apiToken: xxxxxxx
  proxy:
    secretToken: xxxxxxx

registry:
  url: https://gcr.io
  password: |
    {
      "type": "service_account",
      "project_id": "xxxxx",
      "private_key_id": "xxxxxx",
      "private_key": "xxxxxx"
      "client_email": "xxxxx@xxxxxx",
      "client_id": "xxxxxxx",
      "auth_uri": "https://accounts.google.com/o/oauth2/auth",
      "token_uri": "https://oauth2.googleapis.com/token",
      "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
      "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/xxxxx
    }

config:
  GitHubRepoProvider:
    access_token: my_github_token
#4

I tried Docker also, but had the same error

#5

@sharypovandrey Recently I am also facing the same problem which you are facing.
Please tell me how did you solve this. It will be much appreciated.

1 Like
#6

Hey! I dont remember certain steps but what helped me is CORS settings.
Please try to add

cors: &cors
  allowOrigin: '*'

to secret.yaml

and then helm upgrade binder jupyterhub/binderhub --version=0.2.0-6bfd93b -f secret.yaml -f config.yaml

but it beware its not secure way

#7

and also check that you have set IP addresses correct