Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

配置为sqlite后启动服务器失败 #39

Open
eureka176 opened this issue Mar 4, 2024 · 3 comments
Open

配置为sqlite后启动服务器失败 #39

eureka176 opened this issue Mar 4, 2024 · 3 comments

Comments

@eureka176
Copy link

在app/server/.env里面配置

DATABASE_URL="file:../data/wewe-rss.db"
DATABASE_TYPE="sqlite"

启动后报错:

PrismaClientInitializationError: error: Error validating datasource db: the URL must start with the protocol mysql://.
--> schema.prisma:3
|
2 | provider = "mysql"
3 | url = env("DATABASE_URL")
|

Validation Error Count: 1
at r (/home/kali/Downloads/wewe-rss-20240303043604/node_modules/.pnpm/@prisma+client@5.10.1_prisma@5.10.2/node_modules/@prisma/client/runtime/library.js:113:2493)
at async Proxy.onModuleInit (/home/kali/Downloads/wewe-rss-20240303043604/apps/server/dist/prisma/prisma.service.js:14:9)
at async Promise.all (index 0)
at async callModuleInitHook (/home/kali/Downloads/wewe-rss-20240303043604/node_modules/.pnpm/@nestjs+core@10.3.3_@nestjs+common@10.3.3_@nestjs+platform-express@10.3.3_reflect-metadata@0.2.1_rxjs@7.8.1/node_modules/@nestjs/core/hooks/on-module-init.hook.js:43:5)
at async NestApplication.callInitHook (/home/kali/Downloads/wewe-rss-20240303043604/node_modules/.pnpm/@nestjs+core@10.3.3_@nestjs+common@10.3.3_@nestjs+platform-express@10.3.3_reflect-metadata@0.2.1_rxjs@7.8.1/node_modules/@nestjs/core/nest-application-context.js:223:13)
at async NestApplication.init (/home/kali/Downloads/wewe-rss-20240303043604/node_modules/.pnpm/@nestjs+core@10.3.3_@nestjs+common@10.3.3_@nestjs+platform-express@10.3.3_reflect-metadata@0.2.1_rxjs@7.8.1/node_modules/@nestjs/core/nest-application.js:100:9)
at async NestApplication.listen (/home/kali/Downloads/wewe-rss-20240303043604/node_modules/.pnpm/@nestjs+core@10.3.3_@nestjs+common@10.3.3_@nestjs+platform-express@10.3.3_reflect-metadata@0.2.1_rxjs@7.8.1/node_modules/@nestjs/core/nest-application.js:169:33)
at async bootstrap (/home/kali/Downloads/wewe-rss-20240303043604/apps/server/dist/main.js:32:5) {
clientVersion: '5.10.1',
errorCode: 'P1012'
}

@anuxs
Copy link

anuxs commented Mar 4, 2024

估计没改对或者没改全,还是走的mysql

@gtfvool
Copy link

gtfvool commented Mar 26, 2024

我也遇到过,看了下Dockerfile发现其中有这么一步
cd /app-sqlite &&
rm -rf ./prisma &&
mv prisma-sqlite prisma &&
pnpm exec prisma generate
我执行了上述命令后就没问题了

@howie-chen
Copy link

用 Zeabur + sqlite 方案部署,我是 fork 之后用 apps/server/prisma-sqlite 替换 prisma 目录,然后再 deploy。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants