Error when deploying migrations with GH Action in Cloudflare D!

I'm trying to run migrations within a turborepo against a Cloudflare D1 instance. The command to run is this: wrangler d1 migrations apply d1_turbolang --preview I can run it from local (VS code) but when put it into an Github Action I get this error

Run pnpm preview:d1:migrations:apply

> @turbolang/root@ preview:d1:migrations:apply /home/runner/work/turbolang/turbolang
> pnpm --filter remix-admin preview:d1:migrations:apply


> @turbolang/remix-admin@ preview:d1:migrations:apply /home/runner/work/turbolang/turbolang/apps/remix-admin
> wrangler d1 migrations apply d1_turbolang --preview

▲ [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
--------------------

undefined
/home/runner/work/turbolang/turbolang/apps/remix-admin:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @turbolang/remix-admin@ preview:d1:migrations:apply: `wrangler d1 migrations apply d1_turbolang --preview `
Exit status 1
 ELIFECYCLE  Command failed with exit code 1.
Error: Process completed with exit code 1.

Run pnpm preview:d1:migrations:apply

> @turbolang/root@ preview:d1:migrations:apply /home/runner/work/turbolang/turbolang
> pnpm --filter remix-admin preview:d1:migrations:apply


> @turbolang/remix-admin@ preview:d1:migrations:apply /home/runner/work/turbolang/turbolang/apps/remix-admin
> wrangler d1 migrations apply d1_turbolang --preview

▲ [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
--------------------

undefined
/home/runner/work/turbolang/turbolang/apps/remix-admin:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @turbolang/remix-admin@ preview:d1:migrations:apply: `wrangler d1 migrations apply d1_turbolang --preview `
Exit status 1
 ELIFECYCLE  Command failed with exit code 1.
Error: Process completed with exit code 1.
The code in GH Action is :
- name: Deploying migrations to Staging
if: ${{ github.ref == 'refs/heads/dev' }}
run: pnpm preview:d1:migrations:apply
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
- name: Deploying migrations to Staging
if: ${{ github.ref == 'refs/heads/dev' }}
run: pnpm preview:d1:migrations:apply
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
Any ideas what might be wrong?
4 Replies
rodrigo
rodrigoOP15mo ago
I've tried to install drizzle-orm in the root folde as said in other comments ... but not success! @Andrew Sherman Not sure if you've aware of this issue.. There is a github issue opened about it
rodrigo
rodrigoOP15mo ago
GitHub
🐛 BUG: D1 migration doesn't work on Github Actions · Issue #3598 · ...
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 migr...
rodrigo
rodrigoOP15mo ago
The issue is on cloudflare' s github... Not sure where is the bug
Andrii Sherman
Andrii Sherman15mo ago
I guess it's cloudflare issue
Want results from more Discord servers?
Add your server