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

502 Bad Gateway running locally since OAuth PR merged #875

Closed
rmunn opened this issue Jun 11, 2024 · 5 comments
Closed

502 Bad Gateway running locally since OAuth PR merged #875

rmunn opened this issue Jun 11, 2024 · 5 comments
Labels
Svelte owner: Robin

Comments

@rmunn
Copy link
Contributor

rmunn commented Jun 11, 2024

Ever since #847 was merged, I've been getting 502 Bad Gateway errors when connecting to http://localhost/. Checking out the commit before #847 was merged, everything builds.

When I look at the ingress logs with docker logs -f ingress-nginx-controller-b6c6944f4-gxwd4 I can see why the ingress controller is reporting Bad Gateway:

2320 upstream prematurely closed connection while reading response header from upstream, client: 192.168.65.9, server: localhost, request: "GET / HTTP/1.1", upstream: "http://10.1.8.168:3000/", host: "localhost"

10.1.8.168 is the current IP address of the Vite dev server (confirmed by looking at the logs for the ui-7f8d755587-8mkvv pod).

I have not yet been able to track down which change in #847 is causing Vite to stop responding to HTTP requests from the ingress controller, but it's definitely the commit that merged #847 (commit 55c846e) that's causing my issues.

P.S. This appears to be unrelated to #871, as the Bad Gateway errors are occurring both before and after the fix to #871 was pushed to develop.

@rmunn
Copy link
Contributor Author

rmunn commented Jun 11, 2024

I've tried resetting the Kubernetes cluster in my local Docker Desktop, and running docker system prune -a to ensure there aren't any leftover container layers that somehow got corrupted; no change in behavior. Commit 55c846e produces Bad Gateway, the commit before 55c846e works normally.

I also updated my Docker Desktop version from 4.30.0 to 4.31.0; still no change.

@hahn-kev @myieye Can you reproduce this on Windows, or is this Linux-only behavior so far?

@hahn-kev
Copy link
Collaborator

hahn-kev commented Jun 11, 2024

I was seeing this today, but it's actually only a UI container issue. If you go to localhost/API/swagger it returns just fine. So it's purely a Svelte issue.

Taking a look at the code it's probably because I switched on the expose server and that turned on ssl. Now that I remember Tim mentioned something to me and I forgot to look into it today.

As a workaround you can set exposeServer to false in the Vite file.

@hahn-kev hahn-kev added the Svelte owner: Robin label Jun 11, 2024
@megahirt
Copy link
Contributor

I don't know if this is relevant, but there was a change to the vite config in #847

I don't know why the vite config changed - couldn't find any relevant info in the PR itself

@rmunn
Copy link
Contributor Author

rmunn commented Jun 11, 2024

Confirmed, changing exposeServer to false in the vite config makes the Bad Gateway errors go away.

@myieye
Copy link
Contributor

myieye commented Jun 11, 2024

I took the liberty of reverting the vite changes (that were made to get oauth to work) for now.

Feel free to reopen if anyone has any more problems with the latest develop.

@myieye myieye closed this as completed Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Svelte owner: Robin
Projects
None yet
Development

No branches or pull requests

4 participants