Coder.comC
Coder.com3y ago
10 replies
hippiehacker

latest coder server + wgtunnel currently giving 404 errors

I created an https://github.com/coder/coder/issues/9480 with the full configuration details, as it may be that I'm missing something obvious to others:

rm -rf ~/Library/Application\ Support/coderv2/{url,devtunnel,postgres/data}
coder server --wg-tunnel-host try.sharing.io

Coder v0.25.0+d843735 - Your Self-Hosted Remote Development Platform

Started HTTP listener at http://127.0.0.1:3000
Using built-in PostgreSQL (/Users/hh/Library/Application Support/coderv2/postgres)
Opening tunnel so workspaces can connect to your deployment. For production scenarios, specify an external access URL
Using tunnel in Unknown with latency 51.205ms .
Stopping built-in PostgreSQL...
Stopped built-in PostgreSQL

running command "coder server": create tunnel:
github.com/coder/coder/cli.(RootCmd).Server.func1
/home/runner/actions-runner/_work/coder/coder/cli/server.go:339
- initial client registration:
github.com/coder/wgtunnel/tunnelsdk.(
Client).LaunchTunnel
/home/runner/go/pkg/mod/github.com/coder/wgtunnel@v0.1.5/tunnelsdk/tunnel.go:191
- POST https://try.sharing.io/api/v2/clients: unexpected status code 404: Not found.
GitHub
TLDR: tunneld and coder server most recent versions don't seem to work together (OR I'm missing something obvious to others in the configuration of them) code server attempt to use try.shar...
coder server --wg-tunnel-host causes tunneld to return 404 · Issue ...
Solution
As well as having all the usual annotations for websockets:
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: try
  namespace: coder
  annotations:
    nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
    nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
    nginx.ingress.kubernetes.io/server-snippets: |
      location / {
      proxy_set_header Upgrade $http_upgrade;
      proxy_http_version 1.1;
      proxy_set_header X-Forwarded-Host $http_host;
      proxy_set_header X-Forwarded-Proto $scheme;
      proxy_set_header X-Forwarded-For $remote_addr;
      proxy_set_header Host $host;
      proxy_set_header Connection "upgrade";
      proxy_cache_bypass $http_upgrade;
      }
spec:
  ingressClassName: nginx
  rules:
    - host: "try.sharing.io"
      http:
        paths:
          - backend:
              service:
                name: tunneld-api
                port:
                  name: http
            path: /
            pathType: ImplementationSpecific
    - host: "*.try.sharing.io"
      http:
        paths:
          - backend:
              service:
                name: tunneld-api
                port:
                  name: http
            path: /
            pathType: ImplementationSpecific
  tls:
    - hosts:
        - "try.sharing.io"
        - "*.try.sharing.io"
      secretName: try-tls
Was this page helpful?