If anyone here was succesful in connecting a Prism...
# orm-help
r
If anyone here was succesful in connecting a Prisma server to digital ocean hosted db, please let me know!
h
Hi, What kind of errors are you getting?
r
I went through the flow of prisma init but when I try to deploy a service and I check the logs, I keep seeing postgres errors appear
this was the last one
Copy code
Encountered exception while applying migration. Rolling back. org.postgresql.util.PSQLException: ERROR: schema "defaultdb" does not exist
  Position: 24
org.postgresql.util.PSQLException: ERROR: schema "defaultdb" does not exist
h
can you please share you docker-compose file
r
Copy code
version: "3"
services:
  prisma:
    image: prismagraphql/prisma:1.26
    restart: always
    ports:
      - "4466:4466"
    environment:
      PRISMA_CONFIG: |
        port: 4466
        # uncomment the next line and provide the env var PRISMA_MANAGEMENT_API_SECRET=my-secret to activate cluster security
        # managementApiSecret: my-secret
        databases:
          default:
            connector: postgres
            host: <http://db-postgresql-ams3-09753-do-user-3740727-0.db.ondigitalocean.com|db-postgresql-ams3-09753-do-user-3740727-0.db.ondigitalocean.com>
            database: defaultdb
            user: doadmin
            password: ****
            rawAccess: true
            port: '25060'
            migrations: true
            ssl: true
h
you shared you password, please change it asap šŸ™‚
remove it from this as well
r
no worries, its a unpopulated recently added db
but I removed it just in case
h
try removing the database option
r
That removed the error I got for defaultdb!
but I still get the follwing:
Copy code
{
  "key": "error/handled",
  "requestId": "local:cjsbrp3b200010769gyac8oov",
  "payload": {
    "exception": "com.prisma.deploy.schema.InvalidProjectId: No service with name 'switchdaily' and stage 'dev' found",
    "query": "\n      query($name: String! $stage: String!) {\n        project(name: $name stage: $stage) {\n          name\n          stage\n        }\n      }\n    ",
    "variables": "{\"name\":\"switchdaily\",\"stage\":\"dev\"}",
    "code": "4000",
    "stack_trace": "com.prisma.deploy.schema.SchemaBuilderImpl.$anonfun$projectField$3(SchemaBuilder.scala:140)\\n scala.Option.getOrElse(Option.scala:121)\\n com.prisma.deploy.schema.SchemaBuilderImpl.$anonfun$projectField$2(SchemaBuilder.scala:140)\\n scala.util.Success.$anonfun$map$1(Try.scala:251)\\n scala.util.Success.map(Try.scala:209)\\n scala.concurrent.Future.$anonfun$map$1(Future.scala:287)\\n scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)\\n scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)\\n scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)\\n akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)\\n akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:91)\\n scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)\\n scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:81)\\n akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:91)\\n akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40)\\n akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:43)\\n akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)\\n akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)\\n akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)\\n akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)",
    "message": "No service with name 'switchdaily' and stage 'dev' found"
  }
}
It seems it expects a service and stage?
h
you ran prisma deploy ?
please run it before trying to query
r
I did
h
prisma deploy will create tables and store migrations in a separate schema.
r
this is the result of prisma deploy
h
Please run it again šŸ™‚
r
Deploying service
switchdaily
to stage
dev
to server
default
1.2s Service is already up to date.
h
ok run prisma delete
I assume that your database has no data
and run deploy again
r
It doesnt
h
ok run prisma delete
you ran docker-compose up -d again?
r
yup
same error though
h
please run prisma delete -f and prisma deploy
then try again
r
still the same error
a
Please let us know if you figure out the solution. šŸ™ŒšŸ½ I am planning to do this soon and it would be nice to know how to fix it just in case šŸ––šŸ½
h
@antonbramsen It is working fine, the problem in @rein’s case was that he was running the commands locally and docker machine was not referencing the droplet
šŸ‘ 1