Closed shimahi closed 1 year ago
I got the exact same error running D1 migrations with GithHub Actions. (I'm using Drizzle-Kit to generate the migration files)
- name: Deploying migrations to Staging
if: ${{ github.ref == 'refs/heads/dev' }}
run: |
cd ./apps/remix-admin
npx wrangler d1 migrations apply d1_turbolang --preview --experimental-backend
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
shell: bash
Hm, I ran into this as well with wrangler@3.4.0, Remix, and Drizzle. Rolling wrangler back to 3.1.1 didn't fix the issue. I'm wondering if it's GH-runner related.
I can still deploy locally into CF with the same command.
Same here with wrangler 3.4.0
. Using yes Y | wrangler ...
got yes: standard output: Broken pipe
Same with wrangler@3.5.0. Just error, without any description
▲ [WARNING] Processing wrangler.toml configuration:
--------------------
🚧 D1 is currently in open alpha and is not recommended for production data and traffic
🚧 Please report any bugs to https://github.com/cloudflare/workers-sdk/issues/new/choose
🚧 To request features, visit https://community.cloudflare.com/c/developers/d1
🚧 To give feedback, visit https://discord.gg/cloudflaredev
--------------------
- D1 Bindings are currently in alpha to allow the API to evolve before general availability.
Please report any issues to https://github.com/cloudflare/workers-sdk/issues/new/choose
Note: Run this command with the environment variable NO_D1_WARNING=true to hide this message
For example: `export NO_D1_WARNING=true && wrangler <YOUR COMMAND HERE>`
- D1 Bindings are currently in alpha to allow the API to evolve before general availability.
Please report any issues to https://github.com/cloudflare/workers-sdk/issues/new/choose
Note: Run this command with the environment variable NO_D1_WARNING=true to hide this message
For example: `export NO_D1_WARNING=true && wrangler <YOUR COMMAND HERE>`
Error: Process completed with exit code 1.
The error persists in wrangler@3.6.0
.
The error still persists in wrangler@3.7.0.
I would like to apply D1 migrations in the CF Pages deploy script like
npm run build && npx wrangler d1 migrations apply db-name
.
First I got the error that I needed to use a token... after creating and adding a token to the env. variable, I got an error:
Failed: Error while executing user command. Exited with error code: 1
Failed: build command exited with code: 1
Failed: error occurred while running build command
Can be migrations run in the CF Pages "deploy script"? If yes is this a bug mentioned here?
Could the reason be that we have to press Y
to apply the migration, and it errors out because of this?
Could the reason be that we have to press
Y
to apply the migration, and it errors out because of this?
Unfortunately, no; when in CI environment, wrangler will not ask to press Y.
I had a similar issue and apparently, I had to add 'D1:Edit' permission to the token I was using for the app. Here is a repo for reproduction and you can see that the migration step of the deployment flow was successful. I am using wrangler@3.10.1
Hey! 👋 It seems like this is no longer an issue? I'm going to close this, but feel free to re-open if I'm mistaken. 👍
I am receiving this error with wrangler 3.68.0 with a token that includes D1:Edit scope
I also struggling to get this running. Token has correct permissions and trying to run: "wrangler d1 migrations apply DB-NAME --remote", which works when run locally from terminal.
THIS PROBLEM HAS BEEN RESOLVED.
Thx for✨ → https://github.com/cloudflare/workers-sdk/issues/3598#issuecomment-1742059834
Which Cloudflare product(s) does this pertain to?
D1
What version of
Wrangler
are you using?3.1.2
What operating system are you using?
Linux
Describe the Bug
When I try to apply a d1 database migration using
wrangler d1 migrations apply {dbName}
command on GitHub Actions, the action fails with the errorELIFECYCLE Command failed with exit code 1.
migrations
directory in the same directory, and that the same command succeeds in the local CLI (logged in with thewrangler login
command).wrangler deploy
command succeeds.↓ Logs
★
https://github.com/studioreah/d1_migration_test You can see that all the sources are in this repository and that the migration has failed from the ACTIONS. (If you are to try, please set up your own d1 environment wrangler.toml)
Is it possible to resolve this or at least show the error content?