2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

「deploy: could not read the pending D1 migrations for "my-app" before applying them (exit 1).」の解決方法【GitHub Actions/Cloudflare】

2
Posted at

はじめに

GitHub Actionsを使ってCDパイプラインを作成し、Cloudflareにデプロイしようとしたところエラーが発生しました。

問題

deploy: could not read the pending D1 migrations for "my-app" before 
  applying them (exit 1). Refusing to migrate without knowing whether a restore 
  point is needed. Rerun once Cloudflare can be reached.
  Cloudflare: ┌ APIError
  │ [code: 7403] The given account is not valid or is not authorized to access 
  this service

解決方法

APIトークンのpermissionにD1のwrite権限を追加する

おわりに

D1も使用するアプリだったのでworkersだけでなくD1の権限も必要でした。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?