pull down to refresh
You used docker and got this error?
reply
on two different ubuntu docker hosts. but most of the time i am the problem. it try getting db connection right.
i ran: git clone https://github.com/stackernews/stacker.news.git sn && cd sn
maybe that is the issue.
reply
Okay, I'm trying to compose them fresh again and see if maybe something got mangled. But your error suggests, the web app isn't picking up the
.env.sample
file.reply
cool. i am more a tester. reading up code is fun but takes me a long time.
let me know i can debug here. i was in the sn app shell and nano checked the .env.sample it was fine.
5ccxxxxxxx42 sn_app "docker-entrypoint.s…" 18 minutes ago Up 18 minutes 0.0.0.0:3000->3000/tcp, :::3000->3000/tcp app
402xxxxxxxxb9a postgres "docker-entrypoint.s…" 18 minutes ago Up 18 minutes 0.0.0.0:5431->5432/tcp, :::5431->5432/tcp
reply
Doing it clean again on Mac worked for me.
Can you change the references of
.env.sample
in docker-compose.yml
to ./.env.sample
and tell me if that works? I suspect there's some implementation difference in docker across OS's but it might also be silently failing while parsing the file like @spraveenitpro is experiencing.reply
sorry i only edited one line and missed the db one. still testing
reply
i still get the same:
######################## yml ##############
nano docker-compose.yml
GNU nano 4.8 docker-compose.yml
version: "3"
services:
db:
container_name: db
image: postgres
restart: always
expose:
- "5432"
ports:
- "5431:5432"
env_file:
- ./.env.sample
app:
container_name: app
build: ./
depends_on:
- db
env_file:
- ./.env.sample
ports:
- "3000:3000"
volumes:
- ./:/app
links:
- db
############ end yml #############
############## compose shell ################
app | npm WARN @babel/plugin-syntax-jsx@7.14.5 requires a peer of @babel/core@^7.0.0-0 but none is installed. You must ins tall peer dependencies yourself.
app | npm WARN babel-plugin-inline-react-svg@2.0.1 requires a peer of @babel/core@^7.0.0 but none is installed. You must i nstall peer dependencies yourself.
app | npm WARN bootstrap@4.6.0 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependenci es yourself.
app | npm WARN bootstrap@4.6.0 requires a peer of popper.js@^1.16.1 but none is installed. You must install peer dependenc ies yourself.
app | npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-darwin-x64@11.1.2 (node_modules/@next/swc-darwin-x64):
app | npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-darwin-x64@11.1.2: wanted {"os":"da rwin","arch":"x64"} (current: {"os":"linux","arch":"x64"})
app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: x64
app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: linux
app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
app | npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
app | npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch": "any"} (current: {"os":"linux","arch":"x64"})
app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: linux
app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
app | npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-darwin-arm64@11.1.2 (node_modules/@next/swc-darwin-arm64):
app | npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-darwin-arm64@11.1.2: wanted {"os":" darwin","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: arm64
app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: linux
app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
app | npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-win32-x64-msvc@11.1.2 (node_modules/@next/swc-win32-x64-ms vc):
app | npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-win32-x64-msvc@11.1.2: wanted {"os" :"win32","arch":"x64"} (current: {"os":"linux","arch":"x64"})
app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: win32
app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: x64
app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: linux
app | npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
app |
app | audited 1100 packages in 16.272s
app |
app | 173 packages are looking for funding
app | run
npm fund
for details
app |
app | found 11 vulnerabilities (1 low, 4 moderate, 5 high, 1 critical)
app | run npm audit fix
to fix them, or npm audit
for details
app | npm verb exit [ 0, true ]
app | npm timing npm Completed in 17968ms
app | npm info ok
app | Prisma schema loaded from prisma/schema.prisma
app | Error: Get config: Schema Parsing P1012
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 |
app |
app | > stackernews@0.1.0 dev /app
app | > NODE_OPTIONS='--trace-warnings' next dev
app |
app | ready - started server on 0.0.0.0:3000, url: http://localhost:3000
app | info - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
app | event - compiled successfully
app | event - build page: /
app | wait - compiling...
app | event - compiled successfully
app | event - build page: /api/auth/[...nextauth]
app | wait - compiling...
app | event - build page: /api/auth/[...nextauth]
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: /next/dist/pages/_error
app | event - build page: /next/dist/pages/_error
app | event - compiled successfully
app | wait - compiling...
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 (<anonymous>)
app | at Object.then (/app/node_modules/@apollo/client/utilities/utilities.cjs.js:974:24)
app | at Object.next (/app/node_modules/@apollo/client/utilities/utilities.cjs.js:982:49)
app | at notifySubscription (/app/node_modules/zen-observable/lib/Observable.js:135:18)
app | at onNotify (/app/node_modules/zen-observable/lib/Observable.js:179:3)
app | at SubscriptionObserver.next (/app/node_modules/zen-observable/lib/Observable.js:235:7) {
app | graphQLErrors: [
app | Error:
app | Invalid prisma.queryRaw()
invocation:
app |reply
I think i need some more packages in package.json
i tried adding babel-core but i think i need more?
reply
No, those are just warnings. For some reason
docker-compose
isn't picking up the .env.sample
file. You are running docker-compose
aren't you?
prisma.queryRaw()
invocation:db
: the URL must start with the protocolpostgresql://
orpostgres://
. --> schema.prisma:6 | 5 | provider = "postgresql" 6 | url = env("DATABASE_URL") |