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

🐛 BUG: fetch silently restarts server if it hangs #7289

Open
CodeFromAnywhere opened this issue Nov 19, 2024 · 2 comments
Open

🐛 BUG: fetch silently restarts server if it hangs #7289

CodeFromAnywhere opened this issue Nov 19, 2024 · 2 comments
Labels
bug Something that isn't working

Comments

@CodeFromAnywhere
Copy link

CodeFromAnywhere commented Nov 19, 2024

Which Cloudflare product(s) does this pertain to?

Wrangler

What version(s) of the tool(s) are you using?

3.87.0

What version of Node are you using?

20.17.0

What operating system and version are you using?

macOS Sonoma Version 14.6.1 (23G93)

Describe the Bug

Observed behavior

If you do a fetch request but it is blocked by a firewall (I'm using little snitch) it silently fails and restarts the server, somehow ending up in the same place again.

It restarts about 5x per second.

In my terminal, I see this:

Reloading local server...
Reloading local server...
Reloading local server...
Reloading local server...
Reloading local server...
Reloading local server...
// infinitely

Also, this is what the curl -v shows:

➜  ~ curl -v 'http://localhost:3000/repos/facebook/react' \
-H 'Authorization: Bearer kfjsdlkfjdsklfjdslkjflkdsjflkjdlkjfskljdflkjfskljdfkljskljfslkjfdskl' \
-H 'Accept: application/vnd.github.v3+json'
* Host localhost:3000 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
*   Trying [::1]:3000...
* Connected to localhost (::1) port 3000
> GET /repos/facebook/react HTTP/1.1
> Host: localhost:3000
> User-Agent: curl/8.7.1
> Authorization: Bearer kfjsdlkfjdsklfjdslkjflkdsjflkjdlkjfskljdflkjfskljdfkljskljfslkjfdskl
> Accept: application/vnd.github.v3+json
> 
* Request completely sent off

It hangs at "Request completely sent off" without any further details. The server keeps restarting.

Even after completely turning off little snitch and restarting the terminal, this problem still happens. I also tried restarting my computer without luck.

It seems to be unrelated to the firewall. Even with little snitch turned off, it still happens.

It's something introduced in the past 2 months. When I went back to npx wrangler@3.78.10 dev --port 3000 I didn't have this problem, and it works smoothly, also with little snitch.

To get started, I think it would be good to take a look what has changed around fetch in the local environment in the last 2 months. In production, it works fine.

Expected behavior

The expected behavior is that the fetch request will not silently fail and keep restarting the local server in an infinite loop.

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

No response

@CodeFromAnywhere CodeFromAnywhere added the bug Something that isn't working label Nov 19, 2024
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Nov 19, 2024
@penalosa
Copy link
Contributor

Thanks for reporting this! Would you be able to provide a reproduction repo that demonstrates the issue? In particular, it sounds like you're seeing this behaviour without a firewall as well as with one—could I confirm whether it's related to a firewall?

@CodeFromAnywhere
Copy link
Author

It doesn't seem to be related to the firewall. I thought that at first, but the issue kept happening without firewall. I'm now on wrangler@3.78.10 and there it works fine, also with little snitch enabled.

I logged in my worker and the last log happened before a fetch call , then the worker restarted.

I tried making a minimal example but when I started removing other things (such as r2) it didn't happen anymore that it restarted at the fetch. So I can't share any reproducible example. If needed however, I can maybe share you my worker code in private.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working
Projects
Status: Untriaged
Development

No branches or pull requests

2 participants