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: wrangler dev --remote fails with Error 1104, Script not found when using Queue bindings #855

Open
AlexDicy opened this issue Jan 2, 2023 · 16 comments
Labels
bug Something isn't working local dev

Comments

@AlexDicy
Copy link

AlexDicy commented Jan 2, 2023

What version of Wrangler are you using?

2.6.2

What operating system are you using?

Windows

Describe the Bug

  1. Add a queue binding in your wrangler.toml, in my case:
[[queues.producers]]
queue = "emails"
binding = "EMAILS"
  1. Run wrangler dev
  2. Wrangler outputs: ▲ [WARNING] worker failed to prewarm: Service Temporarily Unavailable
  3. Open http://localhost:8787
  4. The page loads with Error 1104

WRANGLER_LOG=debug wrangler dev does not output any debug info (apart from a .env error) in my case

@AlexDicy AlexDicy added the bug Something isn't working label Jan 2, 2023
@WalshyDev
Copy link
Member

Trace: /trace/00163570bb46ab64

@AlexDicy
Copy link
Author

Still a problem in v2.7.1

@estrattonbailey
Copy link

estrattonbailey commented Jan 21, 2023

+1 in v2.8.0 on macOS 12.6.1

@mrbbot
Copy link
Contributor

mrbbot commented Jan 27, 2023

Hey! 👋 I tried to reproduce this and noticed wrangler dev also logs another Queues are currently in Beta and are not supported in wrangler dev remote mode. warning before worker failed to prewarm: Service Temporarily Unavailable. So I guess queues aren't quite supported in the remote dev service. You should be able to use wrangler dev --local for the time being.

@estrattonbailey
Copy link

Thanks for looking into it 🙏

Local definitely works, but doesn't have full-API parity with other offerings like Durable Objects, right? Totally fair if that's a compromise we need to make right now. If it's possible, it'd be great for Wrangler to simply ignore queue config locally for now and let the rest of the architecture run as is.

@madawei2699
Copy link

Any update?

@penalosa
Copy link
Collaborator

penalosa commented Jul 11, 2023

It looks like this should work in local mode (v3's local mode uses the open-source Workers runtime and so has full behaviour parity with Cloudflare APIs like Durable Objects).

However, I'll transfer this issue to the workerd repo to track supporting Queues in the Edge Preview service (wrangler dev --remote)

@penalosa penalosa transferred this issue from cloudflare/workers-sdk Jul 11, 2023
@CharlieBurnett
Copy link

Hey folks!

This is a known issue with Queues and Wrangler and is something we're tracking a fix for on our end.

For now, we recommend using the local dev wrangler env to test out Queues, as the remote dev environment does not function correctly.

Will keep everyone in the loop as this is resolved.

@omarkhairy21
Copy link

Hey, @CharlieBurnett what is the current status of that issue do you still work on it?

@a-robinson
Copy link
Member

Sorry @omarkhairy21 , there have been no changes in our (lack of) support for queues in wrangler dev --remote.

@a-robinson a-robinson changed the title 🐛 BUG: wrangler dev fails with Error 1104, Script not found when using Queue bindings 🐛 BUG: wrangler dev --remote fails with Error 1104, Script not found when using Queue bindings Nov 7, 2023
@NadimHallaq
Copy link

Hey there! Spent hours troubleshooting HonoJS, messing with my setup, even pulled the classic move of deleting and redoing my workers project. Guess what? Turns out Cloudflare queues doesn't support wrangler dev --remote. Just sharing the laughs and lessons learned!

But Seriously tho! I'm already sold on the entire ecosystem, of D1, R2, Workers AI and now Queues so simple and beautiful when it all works together! Any update or workaround on how to run Queues locally?

Any advice is appreciated!

@mrbbot
Copy link
Contributor

mrbbot commented Jan 18, 2024

Hey! 👋 D1, R2, Workers AI and Queues should be supported when running wrangler dev without the --remote flag. As of Wrangler 3, this runs your code locally using pretty much the same workerd runtime as when your code is deployed. Your code, D1, R2 and Queues run fully locally. Note this means you can't access production D1 and R2 data during development. Workers AI local support proxies to remote models, and still requires a login.

@NadimHallaq
Copy link

@mrbbot, many many thanks!

I relied on --remote to avoid manually setting up everything locally, particularly with R2 and D1. I hadn't realized it became automatic in Wrangler 3! Now that I'm running everything locally, it's much cleaner this way.

@mrbbot mrbbot removed this from workers-sdk Jan 23, 2024
@KrisBraun
Copy link

Hey! 👋 D1, R2, Workers AI and Queues should be supported when running wrangler dev without the --remote flag. As of Wrangler 3, this runs your code locally using pretty much the same workerd runtime as when your code is deployed. Your code, D1, R2 and Queues run fully locally. Note this means you can't access production D1 and R2 data during development. Workers AI local support proxies to remote models, and still requires a login.

I think (based on the docs and some testing) that Workers AI isn't supported locally. So my challenge is there's no configuration that works with both queues and Workers AI.

@ChristianJacobsen
Copy link

So my challenge is there's no configuration that works with both queues and Workers AI.

Suffering from the same @KrisBraun, only for me it's cloudflare:email. Hopefully this will be supported when we have GA Queues.

@ceddybi
Copy link

ceddybi commented Aug 30, 2024

@AlexDicy @mrbbot @ChristianJacobsen it's easy, you can define two different environments, each with it's own main script pointing to two different workers,

e.g for dev where queues cannot work with --remote, you export everything but queues

[env.dev]
vars = { ENVIRONMENT = "dev" }
workers_dev = true
main = "src/_dev.ts"
// src/_dev.ts

export default {
	fetch: router.fetch,
}

to run dev wrangler dev -e dev --remote


on prod env you export all

[env.production]
vars = { ENVIRONMENT = "production" }
main = "src/_prod.ts"
workers_dev = false
// src/_prod.ts

export default {
	fetch: router.fetch,
	queue: browserQueue,
}

to run prod wrangler dev -e production --local

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working local dev
Projects
None yet
Development

No branches or pull requests