rgbkrk / kernels-service Goto Github PK
View Code? Open in Web Editor NEW:corn: Launch Jupyter Kernels over HTTP
License: BSD 3-Clause "New" or "Revised" License
:corn: Launch Jupyter Kernels over HTTP
License: BSD 3-Clause "New" or "Revised" License
I'm trying the various functions on the just_the_kernels branch, and kernel actions (restart or interrupt) seem to be throwing uncaught exceptions. For example, hitting this endpoint:
http://192.168.59.103:8000/api/kernels/27535e31-6b5e-48f0-b493-e92dc5548ac9/restart
Throws this error:
[E 150111 01:57:17 web:931] Uncaught exception in write_error
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/tornado/web.py", line 1332, in _execute
result = method(_self.path_args, *_self.path_kwargs)
File "/usr/local/lib/python3.4/dist-packages/tornado/web.py", line 212, in get
raise HTTPError(405)
tornado.web.HTTPError: HTTP 405: Method Not Allowed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/tornado/web.py", line 929, in send_error
self.write_error(status_code, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/IPython/html/base/handlers.py", line 293, in write_error
html = self.render_template('%s.html' % status_code, **ns)
File "/usr/local/lib/python3.4/dist-packages/IPython/html/base/handlers.py", line 234, in render_template
template = self.get_template(name)
File "/usr/local/lib/python3.4/dist-packages/IPython/html/base/handlers.py", line 230, in get_template
return self.settings['jinja2_env'].get_template(name)
KeyError: 'jinja2_env'
It seems like the Access-Control-Allow-Origin header is being set to lowercase when it is run through the configurable-http-proxy. Although this is no problem in Chrome, it causes the Safari browser to not recognize the header.
Here's an example. When I access the kernel service over the proxy, not the lower-cased value for Access-Control-Allow-Origin.
HTTP/1.1 200 OK
access-control-allow-origin: *
connection: close
content-length: 67
content-security-policy:
content-type: text/html; charset=UTF-8
date: Wed, 14 Jan 2015 20:03:13 GMT
etag: "93ee31e7d5a26e434153a8cb61633602a0d273cb"
server: TornadoServer/4.0.2
set-cookie: ignored=; expires=Tue, 14 Jan 2014 20:03:13 GMT; Path=/
x-frame-options: SAMEORIGIN
[{"id": "cea89cc0-55a5-42bb-b926-755e5786d8ef", "name": "python2"}]
When I run this directly on the host, though, and bypass the proxy, here's the result. Note that the header is mixed case, which is what is expected:
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Length: 67
Content-Security-Policy:
Content-Type: text/html; charset=UTF-8
Date: Wed, 14 Jan 2015 20:05:04 GMT
Etag: "93ee31e7d5a26e434153a8cb61633602a0d273cb"
Server: TornadoServer/4.0.2
Set-Cookie: ignored=; expires=Tue, 14 Jan 2014 20:05:04 GMT; Path=/
X-Frame-Options: SAMEORIGIN
[{"id": "cea89cc0-55a5-42bb-b926-755e5786d8ef", "name": "python2"}]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.