Skip to content

./contrib docs, theia: Theia proxy hangs, where Thiea on own port works correctly #332

Closed
@matthew-brett

Description

@matthew-brett

Summary

I'm trying to install and run Theia via these instructions.

I have what I believe to be a minimal installation of JupyterHub / Theia working, via this Dockerfile. The image is at https://hub.docker.com/r/matthewbrett/minimal-theia-proxy.

I can get the Theia interface when running Theia from the terminal, but not when executed via jupyter_theia_proxy.

Detail

I can show that Theia is working correctly outside the JupyterHub Theia proxy by doing the following:

docker run -ti --rm -p 8888:8888 -p 3000:3000 matthewbrett/minimal-theia-proxy:82534d5

This gives the JupyterLab interface available on localhost with the link advertised in the terminal. Using the JupyterLab terminal launcher, I run the following command (see below for the theia running script):

theia start . --hostname 0.0.0.0 --port=3000

At that point, I can get a functional Theia interface at http://localhost:3000 .

However, if instead, I click on the Theia launcher, I see that the browser is trying to load http://127.0.0.1:8888/theia/ - but this hangs at what appears to be the Theia loading stage, with a dark background and spinning gray semicircle - the same thing that very briefly preceeds the successful loading of Theia above. However, in this case, the browser hangs there, and never reaches the Theia interface.

Meanwhile, in the console from which I ran the Docker run command, I get repeated messages of form:

[I 2022-03-09 17:24:11.223 ServerApp] 302 GET /socket.io/?EIO=4&transport=polling&t=NzljQir (172.17.0.1) 0.54ms
[W 2022-03-09 17:24:11.233 ServerApp] 404 GET /socket.io?EIO=4&transport=polling&t=NzljQir (172.17.0.1) 4.17ms referer=http://127.0.0.1:8888/theia/

Can you point me to where I am going wrong in using the Theia proxy here? How can I further debug?

Theia loading command

I found that the instructions at https://jupyter-server-proxy.readthedocs.io/en/latest/convenience/packages/theia.html could not work for my installation, in that the command <my-theia-build-path>/node_modules/.bin/theia will not start Theia from an arbitrary directory. I had to wrap the theia command in a shell wrapper, in order to run the command from a location where it could find the package.json file:

https://github.com/nipraxis/nipraxis-images/blob/e2dcf0ad749c7bee80a99f1fd4cbbdaf548090de/nipraxis-hub/theia-bin

Theia hostname

The command being run by jupyter_theia_proxy appears to be:

['theia', 'start', '.', '--hostname 127.0.0.1', '--port=' + str(port)]

This differs from my command run from the terminal, in that the terminal command uses --hostname 0.0.0.0.

I've tried replacing --hostname 0.0.0.0 into the jupyter_theia_proxy command, with no benefit.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions