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.56k stars 390 forks source link

Build pod doesn't start because of invalid pod name #1133

Closed jmjamison closed 4 years ago

jmjamison commented 4 years ago

I hope I am putting this in the correct place.

Bug description

I've tried using a jupyter notebook that is in a dataverse repository.

Expected behaviour

I thought the jupyter notebook would open in mybinder web interface

Actual behaviour

Seems stuck at "waiting to start"

How to reproduce

  1. Go to mybinder
  2. Copy the dataverse doi
  3. Click on launch button
  4. See error

Your personal set up

djbrooke commented 4 years ago

Hey @jmjamison, I tried with a DOI from Harvard Dataverse (10.7910/DVN/WIAEL2) and it worked as expected. What's the DOI that you're trying to use from UCLA's Dataverse?

jmjamison commented 4 years ago

This from UCLA's Dataverse: 10.25346/S6/DE95RT

betatim commented 4 years ago

Thanks for reporting this @jmjamison - it seems like this particular DOI doesn't work :-/

For me https://mybinder.org/v2/dataverse/10.25346/S6/DE95RT/ shows "waiting for build to start". Looking into the server logs I see the following:

binder-7cc47646f4-4gngd binder [E 200728 05:10:30 ioloop:763] Exception in callback functools.partial(<bound method IOLoop._discard_future_result of <tornado.platform.asyncio.AsyncIOMainLoop object at 0x7f8d28079090>>, <Future at 0x7f8d221d8090 state=finished raised ApiException>)
binder-7cc47646f4-4gngd binder     Traceback (most recent call last):
binder-7cc47646f4-4gngd binder       File "/usr/local/lib/python3.7/site-packages/tornado/ioloop.py", line 743, in _run_callback
binder-7cc47646f4-4gngd binder         ret = callback()
binder-7cc47646f4-4gngd binder       File "/usr/local/lib/python3.7/site-packages/tornado/ioloop.py", line 767, in _discard_future_result
binder-7cc47646f4-4gngd binder         future.result()
binder-7cc47646f4-4gngd binder       File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 428, in result
binder-7cc47646f4-4gngd binder         return self.__get_result()
binder-7cc47646f4-4gngd binder       File "/usr/local/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
binder-7cc47646f4-4gngd binder         raise self._exception
binder-7cc47646f4-4gngd binder       File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
binder-7cc47646f4-4gngd binder         result = self.fn(*self.args, **self.kwargs)
binder-7cc47646f4-4gngd binder       File "/usr/local/lib/python3.7/site-packages/binderhub/build.py", line 287, in submit
binder-7cc47646f4-4gngd binder         ret = self.api.create_namespaced_pod(self.namespace, self.pod)
binder-7cc47646f4-4gngd binder       File "/usr/local/lib/python3.7/site-packages/kubernetes/client/apis/core_v1_api.py", line 6115, in create_namespaced_pod
binder-7cc47646f4-4gngd binder         (data) = self.create_namespaced_pod_with_http_info(namespace, body, **kwargs)
binder-7cc47646f4-4gngd binder       File "/usr/local/lib/python3.7/site-packages/kubernetes/client/apis/core_v1_api.py", line 6206, in create_namespaced_pod_with_http_info
binder-7cc47646f4-4gngd binder         collection_formats=collection_formats)
binder-7cc47646f4-4gngd binder       File "/usr/local/lib/python3.7/site-packages/kubernetes/client/api_client.py", line 334, in call_api
binder-7cc47646f4-4gngd binder         _return_http_data_only, collection_formats, _preload_content, _request_timeout)
binder-7cc47646f4-4gngd binder       File "/usr/local/lib/python3.7/site-packages/kubernetes/client/api_client.py", line 168, in __call_api
binder-7cc47646f4-4gngd binder         _request_timeout=_request_timeout)
binder-7cc47646f4-4gngd binder       File "/usr/local/lib/python3.7/site-packages/kubernetes/client/api_client.py", line 377, in request
binder-7cc47646f4-4gngd binder         body=body)
binder-7cc47646f4-4gngd binder       File "/usr/local/lib/python3.7/site-packages/kubernetes/client/rest.py", line 266, in POST
binder-7cc47646f4-4gngd binder         body=body)
binder-7cc47646f4-4gngd binder       File "/usr/local/lib/python3.7/site-packages/kubernetes/client/rest.py", line 222, in request
binder-7cc47646f4-4gngd binder         raise ApiException(http_resp=r)
binder-7cc47646f4-4gngd binder     kubernetes.client.rest.ApiException: (422)
binder-7cc47646f4-4gngd binder     Reason: Unprocessable Entity
binder-7cc47646f4-4gngd binder     HTTP response headers: HTTPHeaderDict({'Audit-Id': '94468cca-0021-47e1-947e-b013fc9a1139', 'Content-Type': 'application/json', 'Date': 'Tue, 28 Jul 2020 05:10:30 GMT', 'Content-Length': '1757'})
binder-7cc47646f4-4gngd binder     HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Pod \"build-dataverse-2ds6-2d2fde95rt-b4f9c1-20460-\" is invalid: [metadata.name: Invalid value: \"build-dataverse-2ds6-2d2fde95rt-b4f9c1-20460-\": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'), metadata.labels: Invalid value: \"build-dataverse-2ds6-2d2fde95rt-b4f9c1-20460-\": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue',  or 'my_value',  or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')]","reason":"Invalid","details":{"name":"build-dataverse-2ds6-2d2fde95rt-b4f9c1-20460-","kind":"Pod","causes":[{"reason":"FieldValueInvalid","message":"Invalid value: \"build-dataverse-2ds6-2d2fde95rt-b4f9c1-20460-\": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')","field":"metadata.name"},{"reason":"FieldValueInvalid","message":"Invalid value: \"build-dataverse-2ds6-2d2fde95rt-b4f9c1-20460-\": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue',  or 'my_value',  or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')","field":"metadata.labels"}]},"code":422}

The problem is that the name ends in a -. Not quite sure why this happens, so we will have to investigate. Unfortunately there is nothing you can do to work around this :(

jmjamison commented 4 years ago

I tried the same doi and still stick at waiting to build.