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] Error not causing a stack trace, code appears to hang instead #706

Open
1 task done
holderl5 opened this issue Feb 13, 2025 · 1 comment
Open
1 task done

Comments

@holderl5
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

What version of workers-rs are you using?

0.5.0

What version of wrangler are you using?

3.108.1

Describe the bug

A legitimate error in my code shows no error and does not appear to run the statement after the error line (hanging?). It seems like a reasonable assumption that something in the worker environment is amiss, but it is hard to assert this without more information. I am of course running this locally at present in miniflare.

I have isolated the code so that I have 2 git repos:

  • The original repo hangs when running the service
  • The fail reproduction repo copies the code from the first repo so that we can see the error works as expected at least in some instances

I will keep working at this and post anything else I find.

Steps To Reproduce

For the FAIL REPRODUCTION:

  1. pull the repo
  2. run npx wrangler dev
  3. in another terminal, run wget localhost:8787 to hit the cloudflare fetch
  4. an ERROR will show in the terminal, see fail-repro-logs.txt

For the actual hang, do the following:

  1. pull service-monitor
  2. run npx wrangler dev
  3. in another terminal, run wget localhost:8787 to hit the cloudflare fetch
  4. The same logs as from above will print, but no error will be shown. I included just the relevant portion in hang-relevant-logs.txt
  5. Make sure you are on commit cfb563b21ae5c06c755ff36f7271f6f9295be55e for this test

hang-relevant-logs.txt

fail-repro-logs.txt

@holderl5
Copy link
Author

The simple error in the original code is bad JSON.

I finally got to sit down and continue on this. Fixing the JSON so that the error goes away, I found there was another error a few lines later in the same function. Specifically:

v["content"]["value"] = serde_json::to_value(notification_text)?;

This statement is missing a [0] after ["content"]. Could the two errors in close succession be causing the bad behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant