Coder Social home page Coder Social logo

kernels-service's Issues

Kernel actions result in uncaught exception

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'

Access-Control-Allow-Origin header is lowercased when kernel-service is accessed via tmpnb / configurable-http-proxy

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 http://jupyter-kernel.odewahn.com:8000/user/pVLZmkH43KTT/api/kernels

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 0.0.0.0:50746/user/pVLZmkH43KTT/api/kernels

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"}]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.