workers-sdk
workers-sdk copied to clipboard
🐛 BUG: wrangler tail does not recover or exit when websocket disconnects
Which Cloudflare product(s) does this pertain to?
Wrangler core
What version(s) of the tool(s) are you using?
3.7.0
What version of Node are you using?
No response
What operating system are you using?
macOS
Describe the Bug
I've had this issue for awhile:
When I have an active wrangler tail running, and my internet disconnects and reconnects, logs stop coming in, but the command keeps on "running" as if it was still connected to Cloudflare.
I end up running like:
while sleep 1 ; do wrangler tail ; done
and then ctrl+c every few hours to make sure it's still working. This is obviously not a great developer experience.
Question: is there any sort of a "watchdog" on wrangler tail that's supposed to detect when a connection is disconnected?
Please provide a link to a minimal reproduction
No response
Please provide any relevant error logs
There's no error logs when the disconnect happens; the "bug" is the lack of error logs.
I tried reproducing this. I deployed a simple Worker and started tailing it. Made a number of requests. Saw the logs coming through. I turned off my Internet connection; Wrangler did not exit or log any message about being disconnected. I turned on my Internet connection. Made another request. Wrangler displayed the logs from that request and then exited.
This is not quite what is described here. Has the behaviour changed since this issue was created?
Clearly this is also not ideal. We should handle the websocket disconnect and reconnect when it becomes available again.
hi @Manouchehri :) are you still running into this issue?
hi @Manouchehri :) we haven't heard from you in a while, so we’re going to close this issue for now. if this is still a problem, please feel free to open a new issue referencing this one. please be sure to include an updated summary and any additional details and a repro and we will revisit and investigate further. thanks!
Sorry, I'm still having this issue.
@Manouchehri could you follow up on @petebacondarwin 's comment above with additional details?
This is not quite what is described here. Has the behaviour changed since this issue was created?
Pretty sure I'm still having the same issue.
This reproduces the error I think:
while sleep 1 ; do wrangler tail -e production ; done
Then throw your MacBook into your bag, and open it when you get home. It usually doesn't reconnect or exit for me.
Confirmed, still having the issue. I started wrangler tail -e production, closed my laptop, ate lunch, and now there's no more logs showing up (yet wrangler hasn't exited or given any errors at all).
I'm still having this issue on 3.31.0. I run into it multiple times per day.
@petebacondarwin What OS are you testing on?
This is on my todo list for this week. I'll look into it and update by Friday.
OK on the current latest build of Wrangler, I now see (following the steps I used above) the Wrangler process just effectively hangs when the Internet connection goes down transiently. This concurs with the original posters experience. I'll look into fixing this.
Awesome, thank you!
@petebacondarwin Which release should this be fixed in?
I'm still having issues with dead logs sometimes.
It landed in https://github.com/cloudflare/workers-sdk/releases/tag/wrangler%403.35.0