Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NodeJS demo fails #38

Open
dockter-84 opened this issue Oct 19, 2016 · 3 comments
Open

NodeJS demo fails #38

dockter-84 opened this issue Oct 19, 2016 · 3 comments

Comments

@dockter-84
Copy link
Contributor

When following the instruction on https://github.com/jupyter/kernel_gateway_demos/blob/master/node_client_example/README.md, the following error is returned:

$  docker-compose up
Creating network "nodeclientexample_default" with the default driver
Creating nodeclientexample_kernel_gateway_1
Creating nodeclientexample_nginx_1
Creating nodeclientexample_client_1
Attaching to nodeclientexample_kernel_gateway_1, nodeclientexample_nginx_1, nodeclientexample_client_1
client_1          | Targeting server: http://nginx/jupyter/v1/12345678-1234-1234-1234-123456789012
client_1          | Using example code: example.py
client_1          | ajaxSettings:  { user: 'fakeuser', password: 'fakepass' }
nginx_1           | 2016/10/19 13:46:50 [error] 12#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.18.0.4, server: kernel_gateway, request: "GET /jupyter/v1/12345678-1234-1234-1234-123456789012/api/kernelspecs?1476884810574 HTTP/1.1", upstream: "http://172.18.0.2:8888/api/kernelspecs?1476884810574", host: "nginx"
nginx_1           | 172.18.0.4 - fakeuser [19/Oct/2016:13:46:50 +0000] "GET /jupyter/v1/12345678-1234-1234-1234-123456789012/api/kernelspecs?1476884810574 HTTP/1.1" 502 172 "-" "node-XMLHttpRequest"
client_1          | Error fetching kernel specs: null
nodeclientexample_client_1 exited with code 1
kernel_gateway_1  | [KernelGatewayApp] The Jupyter Kernel Gateway is running at: http://0.0.0.0:8888
@dockter-84
Copy link
Contributor Author

However, the following did work:

docker-compose run -e DEMO_LANG=python client

@parente
Copy link
Member

parente commented Jan 22, 2017

I remember writing a response here, but now that I'm going around cleaning up open issues, I see I must have never hit the submit button.

The nodejs client example does work for me, but not on the first run. There's a timing issue between the KG server being ready to receive requests and the client making the request. Running the client after the other containers are ready always works.

I don't think docker-compose supports bringing up two out of three containers in the initial up. That would be the simplest fix. Other potential approaches include documenting this behavior, adding a (flaky) sleep to the client, having the client retry the request some number of times.

@nscozzaro
Copy link

The node_client_example is giving me the following error:

Nicolass-MacBook-Pro:node_client_example nicolasscozzaro$ docker-compose up
Creating network "node_client_example_default" with the default driver
Creating node_client_example_kernel_gateway_1 ... error

ERROR: for node_client_example_kernel_gateway_1  Cannot start service kernel_gateway: b'driver failed programming external connectivity on endpoint node_client_example_kernel_gateway_1 (58d04c3cf7a16107cf9a681097d004f96d188120a7688dfed9bccaf35d3de153): Bind for 0.0.0.0:8888 failed: port is already allocated'

ERROR: for kernel_gateway  Cannot start service kernel_gateway: b'driver failed programming external connectivity on endpoint node_client_example_kernel_gateway_1 (58d04c3cf7a16107cf9a681097d004f96d188120a7688dfed9bccaf35d3de153): Bind for 0.0.0.0:8888 failed: port is already allocated'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants