question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

500 : Internal Server Error

See original GitHub issue

and I can’t figure out what is causing it. This is what I get in the logs:

[I 2015-06-08 06:37:31.845 JupyterHub log:100] 302 GET /user/nicolas (@192.168.0.114) 1.10ms
[E 2015-06-08 06:37:31.859 JupyterHub web:1496] Uncaught exception GET /hub/user/nicolas (192.168.0.114)
    HTTPServerRequest(protocol='http', host='qucitserver:8000', method='GET', uri='/hub/user/nicolas', version='HTTP/1.1', remote_ip='192.168.0.114', headers={'Host': 'qucitserver:8000', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'X-Forwarded-Port': '8000', 'Cookie': 'jupyter-hub-token="2|1:0|10:1433513499|17:jupyter-hub-token|44:MzI3YmNjODNmYTM3NDFmODk3N2Y5ZjJlMmQ5YjkwNGU=|bfaa7de51740b5d383ed9cb7e40f3dcf3204c62b35a3361d37e6664c23baf68a"', 'Connection': 'close', 'X-Forwarded-Proto': 'http', 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/41.0.2272.76 Chrome/41.0.2272.76 Safari/537.36', 'X-Forwarded-For': '192.168.0.114', 'Accept-Encoding': 'gzip, deflate, sdch', 'Accept-Language': 'en-US,en;q=0.8,fr;q=0.6,it;q=0.4'})
    Traceback (most recent call last):
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/tornado/web.py", line 1415, in _execute
        result = yield result
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/jupyterhub/handlers/base.py", line 416, in get
        status = yield current_user.spawner.poll()
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/dockerspawner/dockerspawner.py", line 219, in poll
        container = yield self.get_container()
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/dockerspawner/dockerspawner.py", line 245, in get_container
        'inspect_container', self.container_name
      File "/usr/lib/python3.4/concurrent/futures/_base.py", line 395, in result
        return self.__get_result()
      File "/usr/lib/python3.4/concurrent/futures/_base.py", line 354, in __get_result
        raise self._exception
      File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
        result = self.fn(*self.args, **self.kwargs)
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/dockerspawner/dockerspawner.py", line 207, in _docker
        return m(*args, **kwargs)
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/docker/utils/decorators.py", line 15, in wrapped
        return f(self, resource_id, *args, **kwargs)
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/docker/client.py", line 745, in inspect_container
        self._get(self._url("/containers/{0}/json".format(container))),
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/docker/client.py", line 106, in _get
        return self.get(url, **self._set_request_timeout(kwargs))
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/requests/sessions.py", line 477, in get
        return self.request('GET', url, **kwargs)
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/requests/sessions.py", line 465, in request
        resp = self.send(prep, **send_kwargs)
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/requests/sessions.py", line 573, in send
        r = adapter.send(request, **kwargs)
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/requests/adapters.py", line 415, in send
        raise ConnectionError(err, request=request)
    requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

Beside, after that I needed to delete my ~/.ipython/profile_default, otherwise I would get

[E 2015-06-08 06:32:09.094 JupyterHub orm:376] Unhandled error starting nicolas's server: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
[E 2015-06-08 06:32:09.096 JupyterHub orm:384] Failed to cleanup nicolas's server that failed to start
    Traceback (most recent call last):
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/jupyterhub/orm.py", line 380, in spawn
        yield self.stop()
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/jupyterhub/orm.py", line 434, in stop
        status = yield self.spawner.poll()
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/dockerspawner/dockerspawner.py", line 219, in poll
        container = yield self.get_container()
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/dockerspawner/dockerspawner.py", line 245, in get_container
        'inspect_container', self.container_name
      File "/usr/lib/python3.4/concurrent/futures/_base.py", line 395, in result
        return self.__get_result()
      File "/usr/lib/python3.4/concurrent/futures/_base.py", line 354, in __get_result
        raise self._exception
      File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
        result = self.fn(*self.args, **self.kwargs)
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/dockerspawner/dockerspawner.py", line 207, in _docker
        return m(*args, **kwargs)
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/docker/utils/decorators.py", line 15, in wrapped
        return f(self, resource_id, *args, **kwargs)
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/docker/client.py", line 745, in inspect_container
        self._get(self._url("/containers/{0}/json".format(container))),
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/docker/client.py", line 106, in _get
        return self.get(url, **self._set_request_timeout(kwargs))
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/requests/sessions.py", line 477, in get
        return self.request('GET', url, **kwargs)
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/requests/sessions.py", line 465, in request
        resp = self.send(prep, **send_kwargs)
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/requests/sessions.py", line 573, in send
        r = adapter.send(request, **kwargs)
      File "/opt/jupyterhub/env3/lib/python3.4/site-packages/requests/adapters.py", line 415, in send
        raise ConnectionError(err, request=request)
    requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

It’s a cool project, by the way! 😃

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
martijnthecommented, Jul 17, 2015

I had the same issue.

I guess you’re running the jupyterhub in a docker container itself, correct? I solved this by adding -v /var/run/docker.sock:/var/run/docker.sock to the docker run invocation of the jupyterhub container. This links the socket file of the docker server into the docker container itself, so it can talk to the server through it.

I doubt whether their setup is running jupyterhub in a docker container…

0reactions
anumvarghesecommented, Apr 24, 2020

@willingc Can you please look this I am creating conda virtual env on openshft and running jupyterhub and getting following error on docker spwaner. Request to check and help to resolve

[E 2020-04-23 16:53:07.919 JupyterHub user:626] Unhandled error starting anu server: Error while fetching server API version: (‘Connection aborted.’, FileNotFoundError(2, ‘No such file or directory’))

| [D 2020-04-23 16:53:07.920 JupyterHub user:724] Stopping anu   | [D 2020-04-23 16:53:07.920 JupyterHub dockerspawner:777] Getting container ‘jupyter-anu’   | [E 2020-04-23 16:53:07.932 JupyterHub user:638] Failed to cleanup anu’s server that failed to start   | Traceback (most recent call last):   | File “/opt/app-root/conda-base/lib/python3.6/site-packages/jupyterhub/user.py”, line 632, in spawn   | await self.stop(spawner.name)   | File “/opt/app-root/conda-base/lib/python3.6/site-packages/jupyterhub/user.py”, line 728, in stop   | status = await spawner.poll()   | File “/opt/app-root/conda-base/lib/python3.6/site-packages/dockerspawner/dockerspawner.py”, line 755, in poll   | container = yield self.get_object()   | File “/opt/app-root/conda-base/lib/python3.6/site-packages/dockerspawner/dockerspawner.py”, line 779, in get_object   | obj = yield self.docker(“inspect_%s” % self.object_type, self.object_name)   | File “/opt/app-root/conda-base/lib/python3.6/concurrent/futures/_base.py”, line 425, in result   | return self.__get_result()   | File “/opt/app-root/conda-base/lib/python3.6/concurrent/futures/_base.py”, line 384, in __get_result   | raise self._exception   | File “/opt/app-root/conda-base/lib/python3.6/concurrent/futures/thread.py”, line 56, in run   | result = self.fn(*self.args, **self.kwargs)   | File “/opt/app-root/conda-base/lib/python3.6/site-packages/dockerspawner/dockerspawner.py”, line 742, in _docker   | m = getattr(self.client, method)   | File “/opt/app-root/conda-base/lib/python3.6/site-packages/dockerspawner/dockerspawner.py”, line 79, in client   | client = docker.APIClient(**kwargs)   | File “/opt/app-root/conda-base/lib/python3.6/site-packages/docker/api/client.py”, line 190, in init   | self._version = self._retrieve_server_version()   | File “/opt/app-root/conda-base/lib/python3.6/site-packages/docker/api/client.py”, line 215, in _retrieve_server_version   | ‘Error while fetching server API version: {0}’.format(e)   | docker.errors.DockerException: Error while fetching server API version: (‘Connection aborted.’, FileNotFoundError(2, ‘No such file or directory’))

Read more comments on GitHub >

github_iconTop Results From Across the Web

500 Internal Server Error - HTTP - MDN Web Docs - Mozilla
The HyperText Transfer Protocol (HTTP) 500 Internal Server Error server error response code indicates that the server encountered an ...
Read more >
HTTP 500 Internal Server Error: What It Means & How to Fix It
A 500 internal server error is, as the name implies, a general problem with the website's server. More than likely, this means there's...
Read more >
How to Fix a 500 Internal Server Error - Lifewire
The 500 Internal Server Error is a very general HTTP status code that means something has gone wrong on the website's server, but...
Read more >
How to Fix a 500 Internal Server Error on Your WordPress Site
The 500 (Internal Server Error) status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the ...
Read more >
What Is a 500 Internal Server Error, and How Do I Fix It?
A 500 Internal Server error means that the website you were trying to connect to has experienced a problem and can't provide a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found