[IPython-dev] Error running JupyterHub

Clare Sloggett claresloggett at gmail.com
Mon Nov 3 02:06:07 EST 2014


Hi Doug,

I'm happy to report progress :)

I can get jupyterhub to run. I *think* that possibly our issue was another
application running on the internal (hub) port. If I start from scratch
(with updated jupyterhub) and do something like

su root
jupyterhub --port 9520  --JupyterHubApp.hub_port=8500

it works as expected.

My next step is to try to get a redirect working so I can use
http://url/jupyter instead of http://url:9520/, but I'll go back to the
thread where we were discussing that already.

Thanks for your help!

Clare




On 28 October 2014 21:54, Doug Blank <doug.blank at gmail.com> wrote:

> On Tue, Oct 28, 2014 at 3:08 AM, Clare Sloggett <claresloggett at gmail.com>
> wrote:
>
>> Hi Doug,
>>
>>
> I can confirm that attempting to run the configurable-http-proxy twice
> gives the error you describe. There are probably other reasons to get that
> error too (eg, maybe something is already listening on that port,
> permission error, etc). I would try the items related to node, listed at
> the bottom here first:
>
>
>> 1. I'm not installing ipython from source, just with pip, so a bit
>> confused by the instructions re ipython-master. Maybe I'm misunderstanding.
>> I've run `pip install ipython --upgrade`; do I really need to do ipython
>> from source?
>>
>
> I'm not 100% sure if it is necessary. Installing from master is easy, if
> that is a concern:
>
> git clone https://github.com/ipython/ipython.git
> cd ipython
> python setup.py submodules
> pip install . -U
>
> To update after initial install, just do the last two steps.
>
>
>> 2. I've just tried the jupyterhub README instructions from scratch on a
>> new machine (a new cloud instance) from the current jupyterhub master,
>> commit db5cf9cf99f68f133b... - same issues unfortunately.
>>
>
> Hmmm.... the error log shows that the error is launching the
> http-configurable-proxy...
>
>>
>> 3. I'm not sure how to check for this but it's probably addressed by
>> having launched a new machine!
>>
>
> There are two programs that are run by "root": configurable-http-proxy and
> jupyterhub, and then for each user there is a "jupyterhub-singleuser" that
> is running. You can use something like "ps aux | grep
> configurable-http-proxy" or "ps aux | grep jupyterhub" to see the
> associated processes. You can use "kill" to kill those, if necessary. But
> it sounds like it hasn't made it that far.
>
>
>>
>> 4. I'm running as root, no sudo involved. Just
>> $ su root
>> $ jupyterhub
>>
>
> If this computer is on the internet, then eventually you'll probably want
> to move to the more involved "sudo" method for better security. But this
> should be fine for testing and getting it working.
>
>
>> And I get all the same errors as previously.
>>
>> I'm mystified as I can see others posting here saying that they are using
>> it, so it must be a problem in my setup, but I really can't see what. Could
>> it possibly be a node.js issue?
>>
>
> You should be able to run this line, from your log:
>
> configurable-http-proxy --ip '' --port 8000 --api-ip localhost  --api-port
> 8001 --default-target http://localhost:8081
>
> Does that work without errors? Control+c to exit, if it does work. I can
> confirm that if you try to run this with one already running, you get
> exactly the error you describe.
>
> On the page:
>
>
> https://github.com/jupyter/jupyterhub/wiki/Using-sudo-to-run-the-server-as-non-root
>
> there is also a note needed for serving on restricted ports:
>
> sudo setcap 'cap_net_bind_service=+ep' /usr/bin/node
>
> but read that doc for warnings. You may need that too, even when running
> as root. Your issue does appear to be a problem starting the http server
> via node. Hope that helps!
>
> -Doug
>
>
>
>
>> Thanks again for the help!
>>
>> Clare
>>
>>
>> On 24 October 2014 23:58, Doug Blank <doug.blank at gmail.com> wrote:
>>
>>> On Fri, Oct 24, 2014 at 8:49 AM, Clare Sloggett <claresloggett at gmail.com
>>> > wrote:
>>>
>>>> Hi all,
>>>>
>>>> I'm getting an error running JupyterHub. Right now all I'm doing is
>>>> attempting to run it as root with no command-line options.
>>>>
>>>> A couple of weeks ago I was trying to set it up and while I was running
>>>> into issues, I wasn't getting this particular problem - I was able to at
>>>> least run the command. I'm not sure if something has changed in Jupyter.
>>>> Entirely possible that I made a mistake in my setup this time!
>>>>
>>>> Any advice would be appreciated in interpreting the below errors.
>>>>
>>>> Thanks,
>>>> Clare
>>>>
>>>> Below is the output of `jupyterhub --debug`:
>>>>
>>>> Traceback (most recent call last):
>>>>   File "/usr/lib/python2.7/logging/__init__.py", line 846, in emit
>>>>     msg = self.format(record)
>>>>   File "/usr/lib/python2.7/logging/__init__.py", line 723, in format
>>>>     return fmt.format(record)
>>>>   File
>>>> "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py",
>>>> line 121, in format
>>>>     return super(LevelFormatter, self).format(record)
>>>>   File "/usr/lib/python2.7/logging/__init__.py", line 467, in format
>>>>     s = self._fmt % record.__dict__
>>>> KeyError: u'color'
>>>> Logged from file application.py, line 247
>>>> Traceback (most recent call last):
>>>>   File "/usr/lib/python2.7/logging/__init__.py", line 846, in emit
>>>>     msg = self.format(record)
>>>>   File "/usr/lib/python2.7/logging/__init__.py", line 723, in format
>>>>     return fmt.format(record)
>>>>   File
>>>> "/usr/local/lib/python2.7/dist-packages/IPython/config/application.py",
>>>> line 121, in format
>>>>     return super(LevelFormatter, self).format(record)
>>>>   File "/usr/lib/python2.7/logging/__init__.py", line 467, in format
>>>>     s = self._fmt % record.__dict__
>>>> KeyError: u'color'
>>>> Logged from file application.py, line 248
>>>> [D 23:39:03.030 JupyterHubApp] Connecting to db:
>>>> sqlite:///jupyterhub.sqlite
>>>> [I 23:39:03.062 JupyterHubApp] Not using whitelist. Any authenticated
>>>> user will be allowed.
>>>> [D 23:39:03.064 JupyterHubApp] Loaded users:
>>>>       ubuntu admin
>>>> [I 23:39:03.072 JupyterHubApp] Starting proxy:
>>>> [u'configurable-http-proxy', '--ip', u'', '--port', '8000', '--api-ip',
>>>> u'localhost', '--api-port', '8001', '--default-target', '
>>>> http://localhost:8081']
>>>> 23:39:03.178 - info: [ConfigProxy] Proxying http://*:8000 to
>>>> http://localhost:8081
>>>> 23:39:03.180 - info: [ConfigProxy] Proxy API at
>>>> http://localhost:8001/api/routes
>>>>
>>>> events.js:72
>>>>         throw er; // Unhandled 'error' event
>>>>
>>>
>>> I think that I have had that issue when configurable-http-proxy isn't
>>> running, or maybe it is already running and you are trying to start it
>>> again.
>>>
>>> Some things that I do when updating jupyterhub:
>>>
>>> 1. Updating ipython: make sure you run "python setup.py submodule" in
>>> ipython-master to get any new dependencies. Then "git pull" and "sudo pip
>>> install . -U"
>>>
>>> 2. Updating jupyterhub: do the steps in the jupyterhub/README.md
>>> again... some dependencies may have changed. Then "sudo pip install . -U"
>>>
>>> 3. Make sure all jupyterhub-singleuser processes and
>>> configurable-http-proxy processes are killed. This is still hard to do
>>> sometimes.
>>>
>>> 4. Are you running with a sudo environment? There is an additional line
>>> in the sudoers file that is now needed to kill processes.
>>>
>>> I think that is most of what I need to do.
>>>
>>> -Doug
>>>
>>>
>>>>               ^
>>>> Error: listen EADDRINUSE
>>>>     at errnoException (net.js:904:11)
>>>>     at Server._listen2 (net.js:1042:14)
>>>>     at listen (net.js:1064:10)
>>>>     at net.js:1146:9
>>>>     at dns.js:72:18
>>>>     at process._tickCallback (node.js:419:13)
>>>>     at Function.Module.runMain (module.js:499:11)
>>>>     at startup (node.js:119:16)
>>>>     at node.js:906:3
>>>> [C 23:39:04.087 JupyterHubApp] Failed to start proxy
>>>>     Traceback (most recent call last):
>>>>       File "/usr/local/lib/python2.7/dist-packages/jupyterhub/app.py",
>>>> line 727, in start
>>>>         IOLoop().run_sync(self.start_proxy)
>>>>       File "/usr/local/lib/python2.7/dist-packages/tornado/ioloop.py",
>>>> line 389, in run_sync
>>>>         return future_cell[0].result()
>>>>       File
>>>> "/usr/local/lib/python2.7/dist-packages/tornado/concurrent.py", line 129,
>>>> in result
>>>>         raise_exc_info(self.__exc_info)
>>>>       File
>>>> "/usr/local/lib/python2.7/dist-packages/tornado/stack_context.py", line
>>>> 302, in wrapped
>>>>         ret = fn(*args, **kwargs)
>>>>       File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py",
>>>> line 574, in inner
>>>>         self.set_result(key, result)
>>>>       File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py",
>>>> line 500, in set_result
>>>>         self.run()
>>>>       File "/usr/local/lib/python2.7/dist-packages/tornado/gen.py",
>>>> line 529, in run
>>>>         yielded = self.gen.throw(*exc_info)
>>>>       File "/usr/local/lib/python2.7/dist-packages/jupyterhub/app.py",
>>>> line 556, in start_proxy
>>>>         _check()
>>>>       File "/usr/local/lib/python2.7/dist-packages/jupyterhub/app.py",
>>>> line 552, in _check
>>>>         raise e
>>>>     RuntimeError: Proxy failed to start with exit code 8
>>>>
>>>> _______________________________________________
>>>> IPython-dev mailing list
>>>> IPython-dev at scipy.org
>>>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>>>
>>>>
>>>
>>> _______________________________________________
>>> IPython-dev mailing list
>>> IPython-dev at scipy.org
>>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>>
>>>
>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20141103/d8b6cfa3/attachment.html>


More information about the IPython-dev mailing list