Deploying with wrangler.toml with a Service Binding stuck in Queued state
I have a Next.js app I'm trying to deploy to Pages, that has a Service Binding. The only problem is that when I run
wrangler deploy [...]
it all shows successfully in my CLI, but in the Pages Deployments list page, the new deployment shows up in the "Queued" state forever. There are no errors as far as I can tell, and the UI doesn't really show any useful information. If I deploy without the Service Binding - that deployment goes through fine. Then if I go to the settings and manually add the Service Binding (which also requires me to have done the deploy without the wrangler.toml
file btw), and then deploy again (because for some reason the bindings don't apply to current deployment - I assume for some good reason, but it was a little annoying to discover that haha, anyways), then the latest deployment gets the Service Binding just fine. I think I've tried everything I can to diagnose this problem... but now I need help from somebody with a little more visibility π The only reason I didn't tag next-on-pages
is because I also deployed a Remix app last week and, from memory, it did the exact same thing. At the time I just assumed it was a problem with Remix, hence switching to Next.js. But it just appears to be a wrangler.toml issue, maybe?10 Replies
I've just re-replicated it with the Remix app I was playing with a week or so ago. Same exact behaviour.
Something else of potentially significant importance is that the service I'm binding to exposes a default RPC (aka.
export default class extends WorkerEntrypoint { ... }
) which does implement fetch
but also implements a whole bunch of other RPC methods.
I thought I'd try to see what would happen if I swapped out the service binding for a KV namespace (using the wrangler.toml file)... and that works just fine. So hopefully I'm helping to narrow the problem haha. But yeah, it feels more and more like the issue is related to Service Bindings with everything I try.
Also I tried using a Service Binding that doesn't have any Worker Entrypoints defined (no RPC), and that failed too. Just to try and rule out RPC related stuff (given they're so new).What's your Wrangler.toml?
^ a repro wrangler.toml would be great π
The same thing happened to me because my service bindings were defined more than once in my wrangler.toml file (can't use the same BINDING_NAME twice for service bindings) - not sure if that's intented though
Oh yeah, my bad. I should have supplied my
wrangler.toml
file to begin with π€¦ββοΈ
This config is just the standard one that gets generated when I ran npm create cloudflare@latest 2014-04-14-my-remix-app -- --framework=remix
minus all the boilerplate comments.
I also tried the other syntax:
And that yields the exact same thing.As you can see... not much going on in the wrangler.toml file π
Is anybody able to confirm this is not intended behaviour? Iβm pretty sure my config is correct.
can you try to add environment="production"
Omg thank you @thanhle, you are a legend! I really hope they fix this because itβs been very frustrating to work around.
i am glad this helps