Thanks for the suggestion, Matt. I opened an issue 
<https://github.com/jupyterhub/jupyterhub/issues/1261> and am installing 
master as I type.

In case anyone is interested, I am running jupyterhub on Bash for Windows 
while trying to connect from Emacs on Windows, all on the same machine. 
What an interesting world...

On Saturday, July 22, 2017 at 12:09:46 PM UTC-5, Matthias Bussonnier wrote:

> Hi John, 
>
> > AttributeError: 'User' object has no attribute 'spawner' 
>
> That might be a bug in JupyterHub I would suggest opening an issue and 
> trying out master. I encountered something similar yesterday where 
> invalid credentials would raise an error and a 500, instead of 
> replying "invalid credentials". 
>
>
>
> On Sat, Jul 22, 2017 at 8:11 AM, John Miller <[email protected] 
> <javascript:>> wrote: 
> > After some additional sleuthing I realized I wasn't passing the 
> > 'Authorization' header with the contents API request. Thinking this 
> might be 
> > the problem I added the header, but then got the following response in 
> the 
> > console running jupyterhub: 
> > 
> > [E 2017-07-22 10:05:45.125 JupyterHub web:1590] Uncaught exception GET 
> > /hub/user/millejoh/api/contents/ (::ffff:127.0.0.1) 
> >     HTTPServerRequest(protocol='http', host='127.0.0.1:8000', 
> method='GET', 
> > uri='/hub/user/millejoh/api/contents/', version='HTTP/1.1', 
> > remote_ip='::ffff:127.0.0.1', headers={'X-Forwarded-Host': '
> 127.0.0.1:8000', 
> > 'X-Forwarded-Proto': 'http', 'X-Forwarded-Port': '8000', 
> 'X-Forwarded-For': 
> > '::ffff:127.0.0.1', 'Authorization': 'token 
> > bb5e49ad68dc4f5abdaccd954abb8742', 'X-Xsrftoken': 
> > '2|d136b4d2|ee8d84ef6c536241a6e09c36453a9328|1497490250', 'Cookie': 
> > '_xsrf=2|d136b4d2|ee8d84ef6c536241a6e09c36453a9328|1497490250', 
> > 'Accept-Encoding': 'deflate, gzip', 'Accept': '*/*', 'User-Agent': 
> > 'curl/7.54.0', 'Host': '127.0.0.1:8000', 'Connection': 'close'}) 
> >     Traceback (most recent call last): 
> >       File 
> > 
> "/home/millejoh/miniconda3/envs/jupyterhub/lib/python3.6/site-packages/torna 
>
> > do/web.py", line 1511, in _execute 
> >         result = yield result 
> >       File 
> > 
> "/home/millejoh/miniconda3/envs/jupyterhub/lib/python3.6/site-packages/jupyt 
>
> > erhub/handlers/base.py", line 520, in get 
> >         if current_user.spawner: 
> >     AttributeError: 'User' object has no attribute 'spawner' 
> > 
> > [E 2017-07-22 10:05:45.223 JupyterHub log:99] { 
> >       "X-Forwarded-Host": "127.0.0.1:8000", 
> >       "X-Forwarded-Proto": "http", 
> >       "X-Forwarded-Port": "8000", 
> >       "X-Forwarded-For": "::ffff:127.0.0.1", 
> >       "Authorization": "token [secret]", 
> >       "X-Xsrftoken": 
> > "2|d136b4d2|ee8d84ef6c536241a6e09c36453a9328|1497490250", 
> >       "Cookie": 
> > "_xsrf=2|d136b4d2|ee8d84ef6c536241a6e09c36453a9328|1497490250", 
> >       "Accept-Encoding": "deflate, gzip", 
> >       "Accept": "*/*", 
> >       "User-Agent": "curl/7.54.0", 
> >       "Host": "127.0.0.1:8000", 
> >       "Connection": "close" 
> >     } 
> > [E 2017-07-22 10:05:45.225 JupyterHub log:100] 500 GET 
> > /hub/user/millejoh/api/contents/ (millejoh@::ffff:127.0.0.1) 96.56ms 
> > 
> > -----Original Message----- 
> > From: John Miller [mailto:[email protected] <javascript:>] 
> > Sent: Friday, July 21, 2017 5:22 PM 
> > To: [email protected] <javascript:> 
> > Subject: Emacs IPython Notebook and Jupyterhub 
> > 
> > Getting EIN working with Jupyterhub has been a long standing request, 
> and I 
> > have been trying to get this implemented the past couple days. 
> Unfortunately 
> > I've come against a wall and wonder if someone here might be able to 
> provide 
> > some guidance. 
> > 
> > At the moment I am using the REST API as documented on the website 
> > (https://jupyterhub.readthedocs.io/en/latest/_static/rest-api/index.html) 
>
> > and things go pretty well, up to a certain point. Here is the sequence 
> of 
> > events I have programmed: 
> > 
> > 1. After supplying a url, user name, and password, ein sends a query to 
> > '/hub/api/authorizations/token'. 
> > 2. We store the token, make sure the Authorization header looks like the 
> > example code at (https://jupyterhub.readthedocs.io/en/latest/rest.html) 
> then 
> > query '/hub/api/user/[user]/server' to start a notebook server. 
> > 3. EIN queries '/hub/api/user/[user]' to get information about this 
> user, 
> > most importantly we are looking for the server path for the newly 
> started 
> > server. 
> > 4. Use the server path to use EIN's usual facilities for accessing the 
> > notebook server. 
> > 
> > Things work great up until step 4. EIN will try querying, as an example, 
> > 'http://127.0.0.1:8000/user/millejoh/api/contents' and Jupyterhub will 
> > respond by redirecting to the hub login page. Interestingly enough a 
> call to 
> > 'http://127.0.0.1:8000/user/millejoh/api' works as expected, that is it 
> will 
> > return JSON with the version of the running notebook server. 
> > 
> > Apparently authenticating via '/hub/api/authentications/token' doesn't 
> > really authenticate, at least as far as access to the contents API is 
> > concerned? Is there something else EIN needs to be doing to ingratiate 
> > itself to jupyterhub and convince the hub it really is a nice guy/gal 
> and 
> > promises to play nice with everyone? 
> > 
> > Best regards, 
> > 
> > John 
> > 
> > 
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups "Project Jupyter" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to [email protected] <javascript:>. 
> > To post to this group, send email to [email protected] 
> <javascript:>. 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jupyter/000701d302fc%24d41c6080%247c552180%24%40gmail.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/79d8c158-8444-4a4f-90e2-c5e16fcfccb5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to