ZottelchenšŸ­
ZottelchenšŸ­ā€¢10mo ago

Unable to use Assistants - (WARNING:tornado.access:404)

I seem to be unable to use the assistants. When I click the reload button nothing happens in the frontend and in the docker logs it shows this:
lsp-1 | WARNING:tornado.access:404 GET /pyright (172.19.0.5) 1.48ms
lsp-1 | WARNING:tornado.access:404 GET /ruff (172.19.0.5) 0.45ms
lsp-1 | WARNING:tornado.access:404 GET /diagnostic (172.19.0.5) 0.45ms
lsp-1 | WARNING:tornado.access:404 GET /pyright (172.19.0.5) 1.48ms
lsp-1 | WARNING:tornado.access:404 GET /ruff (172.19.0.5) 0.45ms
lsp-1 | WARNING:tornado.access:404 GET /diagnostic (172.19.0.5) 0.45ms
I am using caddy, but through https://github.com/lucaslorentz/caddy-docker-proxy. The labels are:
windmill_server:
...
labels:
caddy: "windmill.example.org"
caddy.tls.dns: "cloudflare <snip>"
caddy.tls.resolvers: 1.1.1.1
caddy.handle_path: /*
caddy.handle_path.0_reverse_proxy: "{{upstreams 8000}}"

lsp:
...
labels:
caddy: "windmill.example.org"
caddy.tls.dns: "cloudflare <snip>"
caddy.tls.resolvers: 1.1.1.1
caddy.handle_path: /ws/*
caddy.handle_path.0_reverse_proxy: "{{upstreams 3001}}"
windmill_server:
...
labels:
caddy: "windmill.example.org"
caddy.tls.dns: "cloudflare <snip>"
caddy.tls.resolvers: 1.1.1.1
caddy.handle_path: /*
caddy.handle_path.0_reverse_proxy: "{{upstreams 8000}}"

lsp:
...
labels:
caddy: "windmill.example.org"
caddy.tls.dns: "cloudflare <snip>"
caddy.tls.resolvers: 1.1.1.1
caddy.handle_path: /ws/*
caddy.handle_path.0_reverse_proxy: "{{upstreams 3001}}"
which result in the Caddyfile:
windmill.example.org {
handle_path /* {
reverse_proxy 172.19.0.13:8000
}
handle_path /ws/* {
reverse_proxy 172.19.0.12:3001
}
tls {
dns cloudflare <snip>
resolvers 1.1.1.1
}
}
windmill.example.org {
handle_path /* {
reverse_proxy 172.19.0.13:8000
}
handle_path /ws/* {
reverse_proxy 172.19.0.12:3001
}
tls {
dns cloudflare <snip>
resolvers 1.1.1.1
}
}
So to my knowledge this should work fine. What am I missing?
3 Replies
rubenf
rubenfā€¢10mo ago
I unfortunately do not know but would advise trying a simpler setup first to isolate if it's truly coming from your config
Tiago Serafim
Tiago Serafimā€¢10mo ago
I'd guess that the LSP expects /ws/* and your Caddyfile config is re-writing the paths as / (i.e, without the /ws prefix that comes from the proxy server).
ZottelchenšŸ­
ZottelchenšŸ­OPā€¢10mo ago
Ah, seems like you are right, that seems to be the case. Will have to read up on how to fix thatšŸ˜… The way I did test that was opening a local windmill with the default values. Production (https://windmill.example.org/ws/) returns OK -> this does not work Testing (http://localhost/ws/) returns 404: Not Found -> this works Maybe instead of returning OK consider to return a page "Hey, it seems you've configured this wrong"? Oh no, wait a second, that can't be. If that was the case, I would not get the logs above as the requests would not reach the lsp container. I very much overthunk it. The working labels are:
windmill_server:
...
labels:
caddy: "windmill.example.org"
caddy.tls.dns: "cloudflare <snip>"
caddy.tls.resolvers: 1.1.1.1
caddy.reverse_proxy: "{{upstreams http 8000}}"

lsp:
...
labels:
caddy: "windmill.example.org"
caddy.tls.dns: "cloudflare <snip>"
caddy.tls.resolvers: 1.1.1.1
caddy.@ws.0_header: Connection *Upgrade*
caddy.@ws.1_header: Upgrade websocket
caddy.0_reverse_proxy: "@ws {{upstreams 3001}}"
caddy.1_reverse_proxy: /ws/*
windmill_server:
...
labels:
caddy: "windmill.example.org"
caddy.tls.dns: "cloudflare <snip>"
caddy.tls.resolvers: 1.1.1.1
caddy.reverse_proxy: "{{upstreams http 8000}}"

lsp:
...
labels:
caddy: "windmill.example.org"
caddy.tls.dns: "cloudflare <snip>"
caddy.tls.resolvers: 1.1.1.1
caddy.@ws.0_header: Connection *Upgrade*
caddy.@ws.1_header: Upgrade websocket
caddy.0_reverse_proxy: "@ws {{upstreams 3001}}"
caddy.1_reverse_proxy: /ws/*

Did you find this page helpful?