stacker.news
stacker.news copied to clipboard
'docker-compose up --build' ends in error
The displayed error is:
app | prisma:error
app | error: Error validating datasource db
: the URL must start with the protocol postgresql://
or postgres://
.
app | --> schema.prisma:6
app | |
app | 5 | provider = "postgresql"
app | 6 | url = env("DATABASE_URL")
app | |
app |
app | Validation Error Count: 1
app | event - build page: /500
app | wait - compiling...
app | event - compiled successfully
app | error - ApolloError:
app | Invalid prisma.queryRaw()
invocation:
app |
app |
app | error: Error validating datasource db
: the URL must start with the protocol postgresql://
or postgres://
.
app | --> schema.prisma:6
app | |
app | 5 | provider = "postgresql"
app | 6 | url = env("DATABASE_URL")
app | |
app |
app | Validation Error Count: 1
app | at new ApolloError (/app/node_modules/@apollo/client/errors/errors.cjs.js:34:28)
app | at /app/node_modules/@apollo/client/core/core.cjs.js:1575:47
app | at both (/app/node_modules/@apollo/client/utilities/utilities.cjs.js:981:53)
app | at /app/node_modules/@apollo/client/utilities/utilities.cjs.js:974:72
app | at new Promise (prisma.queryRaw()
invocation:
app |
app |
app | error: Error validating datasource db
: the URL must start with the protocol postgresql://
or postgres://
.
app | --> schema.prisma:6
app | |
app | 5 | provider = "postgresql"
app | 6 | url = env("DATABASE_URL")
app | |
app |
app | Validation Error Count: 1
app | at cb (/app/node_modules/@prisma/client/runtime/index.js:33822:17)
app | at runMicrotasks (
Looks to be an issue with older versions of docker-compose. https://stackoverflow.com/questions/71736148/prisma-error-validating-datasource-db-the-url-must-start-with-the-protocol
My version is 1.25.0 and as recommended by the StackOverflow article, just removing the quotes made it work:
-DATABASE_URL="postgresql://sn:password@db:5432/stackernews?schema=public"
+DATABASE_URL=postgresql://sn:password@db:5432/stackernews?schema=public
Thanks! I need to update the docker environment