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: Need a better error for dev-ing Python modules when missing the python_workers compatibility flag #5479

Closed
GregBrimble opened this issue Apr 2, 2024 · 4 comments · Fixed by #6572
Labels
bug Something that isn't working

Comments

@GregBrimble
Copy link
Member

Which Cloudflare product(s) does this pertain to?

Wrangler core

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

3.43.0

What version of Node are you using?

No response

What operating system and version are you using?

macOS

Describe the Bug

If you're missing the compatibility_flags = ["python_workers"] in your wrangler.toml, you just get an opaque

✘ [ERROR] service core:user:worker: Uncaught Error: internal error


✘ [ERROR] MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.

when trying to wrangler dev.

This should be improved to instead be a useful error message prompting the user to add that flag to their config file.

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

No response

@GregBrimble GregBrimble added the bug Something that isn't working label Apr 2, 2024
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Apr 2, 2024
@Al3676
Copy link

Al3676 commented Apr 2, 2024

Good good all paranys

@irvinebroque
Copy link
Contributor

@kflansburg @dom96 @garrettgu10 @hoodmane FYI, EW-8347

@dom96
Copy link
Contributor

dom96 commented Apr 8, 2024

It looks like Wrangler is not showing the full output from workerd. When I run workerd on a Python Worker without this compat flag I get:

workerd/jsg/util.c++:291: error: e = workerd/server/workerd-api.c++:399: failed: expected featureFlags.getPythonWorkers(); The python_workers compatibility flag is required to use Python.
stack: [...long stack trace...]
service main: Uncaught Error: internal error

This possibly needs to be fixed in Wrangler. @cloudflare/wrangler thoughts?

@penalosa
Copy link
Contributor

penalosa commented Apr 8, 2024

I suspect this is being hidden because we hide some error logs that come from workerd which aren't useful to the user. Potentially we're being over zealous here, and hiding too much.

However, I wonder if it'd be a nicer experience to throw an error here much earlier in the process—when we detect that a user has a .py file without the compatibility flag. I think we could do this in readConfig(), where we currently apply the no bundling rules for python workers.

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
Archived in project
5 participants