Orthocorp / orthoverse-avatars

0 stars 0 forks source link

Develop branch is broken #29

Closed kf106 closed 1 year ago

kf106 commented 1 year ago
pi | 10:41:15 🐛 graphql-server GraphQL execution started: AuthChallengeMutation
api | 10:41:15 🚨 
api | Invalid `db.user.upsert()` invocation in
api | /media/kf106/WD-0011/GIT/Orthocorp/orthoverse-avatars/api/src/services/auth/auth.js:35:17
api | 
api |   32 }) => {
api |   33   const nonce = Math.floor(Math.random() * 1000000).toString()
api |   34   const address = addressRaw.toLowerCase()
api | → 35   await db.user.upsert(
api | error: Error validating datasource `db`: the URL must start with the protocol `postgresql://` or `postgres://`.
api |   -->  schema.prisma:3
api |    | 
api |  2 |   provider = "postgresql"
api |  3 |   url      = env("DATABASE_URL")
api |    | 
api | 
api | Validation Error Count: 1
api | 10:41:15 🐛 Execution end
api | 10:41:15 🐛 undefined
api | 10:41:15 🚨 graphql-server 
api | Invalid `db.user.upsert()` invocation in
api | /media/kf106/WD-0011/GIT/Orthocorp/orthoverse-avatars/api/src/services/auth/auth.js:35:17
api | 
api |   32 }) => {
api |   33   const nonce = Math.floor(Math.random() * 1000000).toString()
api |   34   const address = addressRaw.toLowerCase()
api | → 35   await db.user.upsert(
api | error: Error validating datasource `db`: the URL must start with the protocol `postgresql://` or `postgres://`.
api |   -->  schema.prisma:3
api |    | 
api |  2 |   provider = "postgresql"
api |  3 |   url      = env("DATABASE_URL")
api |    | 
api | 
api | Validation Error Count: 1 
api | 
api | 🚨 GraphQLError Info
api | 
api | {
api |   "path": [
api |     "authChallenge"
api |   ],
api |   "locations": [
api |     {
api |       "line": 2,
api |       "column": 3
api |     }
api |   ],
api |   "extensions": {}
api | }
api |  
api | 🥞 Error Stack
api | 
api | Error: 
api | Invalid `db.user.upsert()` invocation in
api | /media/kf106/WD-0011/GIT/Orthocorp/orthoverse-avatars/api/src/services/auth/auth.js:35:17
api | 
api |   32 }) => {
api |   33   const nonce = Math.floor(Math.random() * 1000000).toString()
api |   34   const address = addressRaw.toLowerCase()
api | → 35   await db.user.upsert(
api | error: Error validating datasource `db`: the URL must start with the protocol `postgresql://` or `postgres://`.
api |   -->  schema.prisma:3
api |    | 
api |  2 |   provider = "postgresql"
api |  3 |   url      = env("DATABASE_URL")
api |    | 
api | 
api | Validation Error Count: 1
api |     at RequestHandler.handleRequestError (/media/kf106/WD-0011/GIT/Orthocorp/orthoverse-avatars/node_modules/@prisma/client/runtime/index.js:34883:13)
api |     at RequestHandler.handleAndLogRequestError (/media/kf106/WD-0011/GIT/Orthocorp/orthoverse-avatars/node_modules/@prisma/client/runtime/index.js:34841:12)
api |     at /media/kf106/WD-0011/GIT/Orthocorp/orthoverse-avatars/node_modules/@prisma/client/runtime/index.js:35387:25
api |     at processTicksAndRejections (node:internal/process/task_queues:96:5)
api |     at async PrismaClient._executeRequest (/media/kf106/WD-0011/GIT/Orthocorp/orthoverse-avatars/node_modules/@prisma/client/runtime/index.js:35955:22)
api |     at async PrismaClient._request (/media/kf106/WD-0011/GIT/Orthocorp/orthoverse-avatars/node_modules/@prisma/client/runtime/index.js:35926:16)
api |     at Object.authChallenge (/media/kf106/WD-0011/GIT/Orthocorp/orthoverse-avatars/api/src/services/auth/auth.js:35:3)
api |     at async /media/kf106/WD-0011/GIT/Orthocorp/orthoverse-avatars/node_modules/@envelop/core/cjs/orchestrator.js:380:27
api |     at async processRequest (/media/kf106/WD-0011/GIT/Orthocorp/orthoverse-avatars/node_modules/@graphql-yoga/common/cjs/processRequest.js:26:20)
api |     at async YogaServer.getResponse (/media/kf106/WD-0011/GIT/Orthocorp/orthoverse-avatars/node_modules/@graphql-yoga/common/cjs/server.js:318:28)

Readme needs instructions for database configuration and .env value

kf106 commented 1 year ago

Requires the following:

.env should contain:

DATABASE_URL="postgresql://username:password@localhost:5432/database?connection_limit=1"
TEST_DATABASE_URL="postgresql://username:password@localhost:5432/database?connection_limit=1"

Then run yarn redwood prisma migrate dev

Note that for some bizarre reason Redwood deletes all the data in all your tables.

ricp commented 1 year ago

I think we're good on this now, I close the issue.