Access Workspace Web does not work with returning Code 302

Hi all, I'm trying to setup sagemath with jupyter. I got everything running and sage -n jupyter via supervisord in the background and an access via the main.tf file, but jupyter returns a 302 to the location /tree? and it seems the code-server passes that 302 towards the users freshly opened browser window resulting in the browser to got to coder.domain.com/tree? which returns a 404. How can i tell coder to follow redirects, before returning the response to the user?
10 Replies
Codercord
Codercord4w ago
<#1312088599444983808>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
SpaceMoehre-i-nator™
well i guess using the jupyter module i can still use sage, but the problem with http codes 302 persists
Phorcys
Phorcys2w ago
hello @SpaceMoehre-i-nator™, Coder is acting as a reverse-proxy for Jupyter, and redirects are always supposed to be passed down to the user following redirects on the reverse-proxy side of things is very likely to introduce unwanted behavior the issues you're encountering just means that Jupyter doesn't know its own path are you using sub-paths or a wildcard domain to proxy your apps? hey @SpaceMoehre-i-nator™, any luck?
SpaceMoehre-i-nator™
i found out that i can use the jupyter module and choose the sage interpreter in there
module "jupyterlab" {
source = "registry.coder.com/modules/jupyterlab/coder"
version = "1.0.24"
agent_id = coder_agent.main.id
subdomain = false
}
module "jupyterlab" {
source = "registry.coder.com/modules/jupyterlab/coder"
version = "1.0.24"
agent_id = coder_agent.main.id
subdomain = false
}
but for some reason i get this error for the last weeks:
502 - Bad Gateway

Failed to proxy request to application: dial context: connect tcp [fd7a:115c:a1e0:44c4:9ff1:9036:a3df:c529]:19999: connection was refused
502 - Bad Gateway

Failed to proxy request to application: dial context: connect tcp [fd7a:115c:a1e0:44c4:9ff1:9036:a3df:c529]:19999: connection was refused
weird is that i dont use ipv6 anywhere, so where is that address coming from?
Phorcys
Phorcys2w ago
this ipv6 is owned by tailscale, which is what we use to establish p2p connections to workspaces
SpaceMoehre-i-nator™
ok so the problem must originate from an incorrect tunnel to tailscale...
Phorcys
Phorcys2w ago
check the "DERP" section of the health page of your deployment, it should have some insight on this maybe it is being firewalled away
SpaceMoehre-i-nator™
ok i guess i found the issue somewhere non network related the log /tmp/jupyterlab.log showed
sh: 29: /home/simon/.local/bin/jupyter-lab: not found
sh: 29: /home/simon/.local/bin/jupyter-lab: not found
turns out juypter-lab has python3.13 in the shebang, which is not installed on my system since i need 3.9 for dependencies. is there a jupyter module version that uses python3 or <=python3.9 ?
Phorcys
Phorcys2w ago
oh yeah, the fact you sent it as text confused me this is just an error on the web ui right? the "502 - Bad Gateway" error there is nothing we can do about the shebang, but you can just install python3.13 on the side and it should work
SpaceMoehre-i-nator™
no prob, i fixed it. installing pipx via debian bookworms apt package defaulted to python3.13. installing via python -m pip install pipx fixed my issue this is why on clicking the jupyterlab button, the new window displayed coders 502 code with "connection refused", since jupyterlab was unable to start due to misconfigured pipx

Did you find this page helpful?