2016-10-03 11 views
0

jupyterダッシュボードサーバーのどの部分が機能しないのか理解できません。 ダッシュボードサーバーが動作しているようで、カーネルゲートウェイが動作していてカーネルが起動しているようですが、何らかの理由で起動後にカーネルへのwebsocketトラフィックが応答として404を取得します。Jupyterダッシュボードサーバー - スタックの一部またはトラフィックが機能しない

私はカーネルゲートウェイ上でカール要求を実行しようとしましたが、カールは 'ws'プロトコルをサポートしていません。

これをさらにデバッグするにはどうすればよいですか?以下のすべての詳細。

私はこのApache構成とVM(Debianのジェシー)を有する:

ProxyPreserveHost on 
ProxyPass "/" "http://127.0.0.1:3000/" 
ProxyPassReverse "/" "http://127.0.0.1:3000/" 

Iが応答しているダッシュボードサーバを有する:

GET /dashboards/Environment_variables 200 39.408 ms - 2400 
GET /css/style.css 200 1.688 ms - 186626 
GET /components/require.js 200 3.943 ms - 86262 
GET /components/dashboard.js 200 1.351 ms - 788654 
GET /components/fonts/fontawesome-webfont.woff2?v=4.6.3 304 0.689 ms - - 
GET /components/dashboard.js.map 304 0.621 ms - - 
POST /api/kernels?1475506860562 201 923.933 ms - 62 
GET /api/kernels/d7681c2f-b8f9-4b19-9893-6bd6022d0e77/channels?session_id=ad17021f13dd752eb2e687b4a78fee64 404 2.936 ms - 1021 
GET /api/kernels/d7681c2f-b8f9-4b19-9893-6bd6022d0e77/channels?session_id=ad17021f13dd752eb2e687b4a78fee64 404 3.703 ms - 1021 

いえ端404と。

それから私は、カーネルゲートウェイを実行している:

[KernelGatewayApp] The Jupyter Kernel Gateway is running at: http://127.0.0.1:8888 
[KernelGatewayApp] Native kernel (python3) available from /opt/anaconda3/lib/python3.5/site-packages/ipykernel/resources 
[KernelGatewayApp] Starting kernel: ['/opt/anaconda3/bin/python', '-m', 'ipykernel', '-f', '/home/sandman/.local/share/jupyter/runtime/kernel-d7681c2f-b8f9-4b19-9893-6bd6022d0e77.json'] 
[KernelGatewayApp] Connecting to: tcp://127.0.0.1:52565 
[KernelGatewayApp] Kernel started: d7681c2f-b8f9-4b19-9893-6bd6022d0e77 
[KernelGatewayApp] Kernel args: {'kernel_name': 'python3'} 
[I 161003 16:01:01 web:1971] 201 POST /api/kernels (127.0.0.1) 917.05ms 

カーネルの要求を見て、私の知る限り理解し、それを開始します。

しかし、ブラウザがそれを見ていません。

Environment_variables 200 document Other 1.2 KB 365 ms 
style.css 200 stylesheet Environment_variables:7 29.2 KB 259 ms 
require.js 200 script Environment_variables:64 21.0 KB 325 ms 
dashboard.js 200 script Environment_variables:65 214 KB 989 ms 
fontawesome-webfont.woff2?v=4.6.3 304 font Environment_variables:64 216 B 82 ms 
kernels?1475506860562 201 xhr index.js:178 395 B 1.01 s 
cursor.png 200 png middlemouse.js:53 (from cache) 2 ms  
channels?session_id=ad17021f13dd752eb2e687b4a78fee64 404 websocket Other 0 B 82 ms 
channels?session_id=ad17021f13dd752eb2e687b4a78fee64 404 websocket Other 0 B 82 ms 

enter image description here

私もHTTPモードでカーネルゲートウェイを起動しようとしたが、それはちょうど私にエラーを与えた:

$ jupyter kernelgateway --KernelGatewayApp.api=kernel_gateway.notebook_http --debug 
Traceback (most recent call last): 
    File "/opt/anaconda3/bin/jupyter-kernelgateway", line 11, in <module> 
    sys.exit(launch_instance()) 
    File "/opt/anaconda3/lib/python3.5/site-packages/jupyter_core/application.py", line 267, in launch_instance 
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs) 
    File "/opt/anaconda3/lib/python3.5/site-packages/traitlets/config/application.py", line 652, in launch_instance 
    app.initialize(argv) 
    File "/opt/anaconda3/lib/python3.5/site-packages/kernel_gateway/gatewayapp.py", line 298, in initialize 
    self.init_configurables() 
    File "/opt/anaconda3/lib/python3.5/site-packages/kernel_gateway/gatewayapp.py", line 352, in init_configurables 
    self.personality = func(parent=self, log=self.log) 
    File "/opt/anaconda3/lib/python3.5/site-packages/kernel_gateway/notebook_http/__init__.py", line 144, in create_personality 
    return NotebookHTTPPersonality(*args, **kwargs) 
    File "/opt/anaconda3/lib/python3.5/site-packages/kernel_gateway/notebook_http/__init__.py", line 25, in __init__ 
    self.api_parser = func(parent=self, log=self.log, kernelspec=self.parent.kernel_manager.seed_kernelspec, notebook_cells=self.parent.seed_notebook.cells) 
AttributeError: 'NoneType' object has no attribute 'cells' 

答えて

1

それを見つけました。

ProxyPreserveHost on 

    ProxyPassMatch "/api/kernels/(.*)/channels" "ws://127.0.0.1:3000/api/kernels/$1/channels" 
    ProxyPassReverse "/api/kernels" "ws://127.0.0.1:3000/api/kernels" 

    ProxyPass "/" "http://127.0.0.1:3000/" 
    ProxyPassReverse "/" "http://127.0.0.1:3000/" 

ポイントは、私は最後の2行でHTTPトラフィックへのWebSocketのトラフィックを翻訳されたということでした。もちろん、それは動作しませんでした。

追加された中間線パターンは、websocketリクエストと一致し、それらをws:protocolに渡します。

また、ProxyPass "/"はすべてに一致し、一致するものが見つかるまでApacheはリストを通過するため、行の順序が重要です。だから、 "すべてを一致させる"という行は最後でなければなりません。

関連する問題