Open davwheat opened 11 months ago
Sorry for the trouble here. It sounds like you're running into https://github.com/cloudflare/workers-sdk/issues/4078. Your API token doesn't have edit permissions for D1 so you're getting an auth error, but that wrangler d1 command doesn't properly log an error. This should be fixed in wrangler soon via https://github.com/cloudflare/workers-sdk/pull/4597.
Ahh, spot on! Thanks so much. :)
This also fails silently for me on wrangler 3.51.2
- name: 🕊️ Migrate
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
wranglerVersion: "3.51.2"
command: d1 migrations apply yupty-staging --remote --env staging
Fix
This also fails silently for me on wrangler
3.51.2
- name: 🕊️ Migrate uses: cloudflare/wrangler-action@v3 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} wranglerVersion: "3.51.2" command: d1 migrations apply yupty-staging --remote --env staging
Fix
- Go to https://dash.cloudflare.com/profile/api-tokens
- Find the token used by my action
- Click edit
- Click "add more"
- Add d1 "edit" permission
Thank you, adding the D1 edit permission fixed it for me on 3.83.0 as well with wrangler d1 migrations apply
. I've been dealing with this for months. It makes sense now, but the lack of any error message was very frustrating.
@1000hz this is still happening on wrangler 3.87.0. No error message whatsoever.
I have no idea if this is a me problem like some misconfiguration I've made, but I can't work this out for the life of me.
Excerpt from my workflow:
Deploying the worker is fine, but the migrations command returns error code 1 with no useful log output:
Running it locally works fine, with the CLI output I'd expect:
Any ideas what I might be doing wrong?