nitrojs / nitro

Next Generation Server Toolkit. Create web servers with everything you need and deploy them wherever you prefer.
https://nitro.build
MIT License
6.29k stars 519 forks source link

503 Server Unavailable issue (mostly on windows) #1454

Open pi0 opened 1 year ago

pi0 commented 1 year ago

Related:

Fix attempts:

This issue has been mentioned by several users (mostly on Windows) that the dev server socket might go unavailable with 503 when having concurrency.

Right now there is no solid minimal reproduction with Nitro alone in order to isolate and resolve the root cause of the issue but it is certainly a valid issue that has been reported several times and needs to be resolved.

mrniamster commented 1 year ago

@pi0 Pooya - just to update, i'm using mac and windows both, getting this on both of them

pi0 commented 1 year ago

Related: I am planning to replace old http-proxy used in dev server with a better implementation. I will try to reproduce the issue with old package anyway but at the moment i think it is the most likely source of the issues.

mrniamster commented 1 year ago

@pi0

https://githubxuwmq6-kyyz--3000--c53ab388.local-credentialless.webcontainer.io/

Minimal demo to produce the error

  1. From home page try visiting /login directly the server doesn't responds , since you are still on home page , try click on "login" it will still not redirect.
  2. try npm generate, the crawler stops at pre-render itself
svekke commented 11 months ago

Any update on this?

carbdias commented 11 months ago

Hello, is there any news on this? For me it is very wierd that a get call directly in the browser works, and then with useFetch inside a plugin, it returns this error. I've already try not using useFetch but only $fetch in the plugin (in case this composable didn't work here), but the error is the same

it seems something is blocking the http call or returning a bad response (503)

Ena-Heleneto commented 11 months ago

I encountered the same problem, is there any solution? thanks ​

The server seems to be working normally in my case, but there is a problem with the display of devtool

carbdias commented 11 months ago

I've also had a probñem there. I had to redo the project from scratch with the devtools always on, to be sure it didn't crash anytime.

Ena-Heleneto commented 11 months ago

I encountered the same problem, is there any solution? thanks​

The server seems to be working normally in my case, but there is a problem with the display of devtool

It should be added that this problem currently only occurs in the Windows development environment, and does not have this problem in the Linux server environment.

cmcnicholas commented 9 months ago

Surprised there isn't bigger noise around this issue, I encounter this every day working on a smallish nuxt app

tbarus commented 8 months ago

same issue I am having

lucas-santosP commented 7 months ago

Im facing this problem too using Nuxt, and as a workaround I could solve it using yarn dev --host and accessing the website using the network address.

The problem only occurs to me when using a specific public WIFI network with my company's computer which has firewall configurations. So I have my suspicions that this issue has something to do with security and permissions.

carbdias commented 5 months ago

I have here the same issue in this reproduction it is a most recently created project, with little code, but it is taking forever loading the page, and before it was giving 503 error, then I installed npm@latest globally, and not it is just taking forever and not leading. I just checked, 503 fetching loclahost. https://stackblitz.com/edit/github-4zdfkx?file=package.json

carbdias commented 5 months ago

for me this was solved with npm cache verify and opening the app in incognito mode. somehow nuxt framework is generating too much temp files or files in cache (I asume the idea was to improve performance) but it is blocking things. somehow older and larger applications I had didn't present this problem. just fresh started projects.

dan-hammond commented 3 months ago

I just wanted to add that we're still experiencing this a lot in our Nuxt 3 site which proxies a few routes to an old SPA (which is quite heavy with lots of requests). On Windows, some of the proxied requests will fail with an error 503. It's completely random as to which ones. I don't experience it while developing the same site on my Mac. It is definitely related to there being lots of concurrent requests though - it doesn't do it if there's only a few at once.

The workarounds listed above of trying via different network addresses don't seem to help. If we switch to an alternative proxy solution, such as nginx in a Docker container, that works fine. We'd prefer to use Nuxt as our proxy while developing though, as it's quicker and easier, with fewer dependencies.

kdydesign commented 3 weeks ago

Is there any temporary way to address this issue?

poziminski commented 2 hours ago

We are facing this issue since we started new project with Nuxt 3. It works fine on production build, but we cannot develop (or it requires multiple restarts, clearing docker, etc.). Happens on Macbook in Docker containers. Refer to my comment here: https://github.com/nuxt/nuxt/issues/23832#issuecomment-2494468441

Here's a reproduction code: https://github.com/poziminski/nuxt-bug-reproduction