Error 7500: not authorized: SQLITE_AUTH

Hello! Has anyone had this before? I'm running Drizzle with Cloudflare D1, when I do drizzle-kit push I get this error Which is weird because when I do drizzle-kit generate and migrate I don't see this error
(base) justinechang@Justines-MacBook-Pro deno-monorepo-test % npm run pushdb

> pushdb
> npm run pushdb --workspace=apps/hono-backend


> pushdb
> drizzle-kit push

No config path provided, using default 'drizzle.config.ts'
Reading config file '/Users/justinechang/code/deno-monorepo-test/apps/hono-backend/drizzle.config.ts'
[✓] Pulling schema from database...
Error: 7500: not authorized: SQLITE_AUTH
at remoteCallback (/Users/justinechang/code/deno-monorepo-test/node_modules/drizzle-kit/bin.cjs:64356:21)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.query (/Users/justinechang/code/deno-monorepo-test/node_modules/drizzle-kit/bin.cjs:64380:27)
at async logSuggestionsAndReturn (/Users/justinechang/code/deno-monorepo-test/node_modules/drizzle-kit/bin.cjs:26234:23)
at async sqlitePush (/Users/justinechang/code/deno-monorepo-test/node_modules/drizzle-kit/bin.cjs:81840:13)
at async Object.handler (/Users/justinechang/code/deno-monorepo-test/node_modules/drizzle-kit/bin.cjs:87295:9)
at async run (/Users/justinechang/code/deno-monorepo-test/node_modules/drizzle-kit/bin.cjs:85613:7)
(base) justinechang@Justines-MacBook-Pro deno-monorepo-test % npm run pushdb

> pushdb
> npm run pushdb --workspace=apps/hono-backend


> pushdb
> drizzle-kit push

No config path provided, using default 'drizzle.config.ts'
Reading config file '/Users/justinechang/code/deno-monorepo-test/apps/hono-backend/drizzle.config.ts'
[✓] Pulling schema from database...
Error: 7500: not authorized: SQLITE_AUTH
at remoteCallback (/Users/justinechang/code/deno-monorepo-test/node_modules/drizzle-kit/bin.cjs:64356:21)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.query (/Users/justinechang/code/deno-monorepo-test/node_modules/drizzle-kit/bin.cjs:64380:27)
at async logSuggestionsAndReturn (/Users/justinechang/code/deno-monorepo-test/node_modules/drizzle-kit/bin.cjs:26234:23)
at async sqlitePush (/Users/justinechang/code/deno-monorepo-test/node_modules/drizzle-kit/bin.cjs:81840:13)
at async Object.handler (/Users/justinechang/code/deno-monorepo-test/node_modules/drizzle-kit/bin.cjs:87295:9)
at async run (/Users/justinechang/code/deno-monorepo-test/node_modules/drizzle-kit/bin.cjs:85613:7)
15 Replies
Justine
JustineOP2mo ago
Error: 7500: not authorized: SQLITE_AUTH I couldn't find anything on it Also, I'm running this in an npm workspace
monad
monad2mo ago
I'm getting the exact same error like you. It seems drizzle-kit push is broken.
Justine
JustineOP2mo ago
I dug into the drizzle-kit code in node_modules and found that the error is thrown when trying to make this query to the database
✓] Pulling schema from database...
+ users_table table will be created
--- all table conflicts resolved ---

select count(*) as count from `_cf_KV
✓] Pulling schema from database...
+ users_table table will be created
--- all table conflicts resolved ---

select count(*) as count from `_cf_KV
It's after I select and say "user_table" is created not replaced
monad
monad2mo ago
right
Justine
JustineOP2mo ago
and I cannot downgrade to 0.25.0 because I'll get this error
This version of drizzle-kit is outdated
Please update drizzle-kit package to the latest version 👍
This version of drizzle-kit is outdated
Please update drizzle-kit package to the latest version 👍
D:
monad
monad2mo ago
It seems like a bug. Would you mind submit an issue in their repo?
Justine
JustineOP2mo ago
Sir after many hours I may have found a solution, go to your drizzle.config.ts file and add this to your config tablesFilter: ['/^(?!.*_cf_KV).*$/'] this should make the push command "ignore" the _cf_KV table, and your migrations SHOULD apply correctly i hope something else eventually goes wrong, I think I'm done for today 😄
huv1k
huv1k2mo ago
You need to add D1 for your token 🙌
Justine
JustineOP2mo ago
hmmm not sure what you mean sir 😃 have you successfully done drizzle-kit push for D1 local before? 🙏
huv1k
huv1k2mo ago
Yes 😅 but only for the first time
Justine
JustineOP2mo ago
owh! then after that you get the same error as me? SQLITE_AUTH error?
huv1k
huv1k2mo ago
I didn't have D1 scope set for my Cloudflare token if you select Worker token there is missing D1 scope for working with databases.
Justine
JustineOP2mo ago
okay okay, so after selecting D1 scope you are able to drizzzle-kit push?
shafu
shafu5w ago
any luck anyone? having same issue
Mozzy
Mozzy3w ago
This worked for me
No description
Want results from more Discord servers?
Add your server