Hey, <https://bit.ly/migrate-prisma-yml> is dead. ...
# orm-help
k
Hey, https://bit.ly/migrate-prisma-yml is dead. Where did this go originally? It's telling me "warning prisma.yml: "cluster", "service" and "stage" are deprecated and will be replaced with "endpoint"." -- also I've totally ruined my prisma server since I randomly decided to update to 1.7.0 / 1.7.1 - I imagine something funky happened.
what funky things are happening?
k
First I'll preface and say that thankfully I'm just doing personal experiments using Prisma so I have no worry nuking everything and restarting - I have dataseed that'll get me through a total reset.
I just deleted my prisma 1.7 image totally and docker-compose up'd the fella
and I get this error
Copy code
kyleg@kmgmbp:~/git/javrater-webapp/server-prisma/database$ docker-compose up
Pulling prisma (prismagraphql/prisma:1.7)...
1.7: Pulling from prismagraphql/prisma
ff3a5c916c92: Already exists
b2573fe715ab: Already exists
5512626b3241: Already exists
a29d24a28775: Already exists
12b344b6b5be: Already exists
e4961dac57aa: Already exists
e4bc74c68b3d: Already exists
d6272350bd2c: Already exists
44409604134f: Already exists
Digest: sha256:aceeef33818d6220901bd9ef84f4fcca97f6f36f9ce01b325e0712696348994a
Status: Downloaded newer image for prismagraphql/prisma:1.7
pt 1
Copy code
Starting database_prisma_1 ... done
Attaching to database_prisma_1
prisma_1  | Exception in thread "main" java.lang.RuntimeException: Unable to load Prisma config: com.prisma.config.InvalidConfiguration: Expected hash under 'databases' to be non-empty
prisma_1  |   at scala.sys.package$.error(package.scala:27)
prisma_1  |   at com.prisma.config.ConfigLoader$.load(ConfigLoader.scala:38)
prisma_1  |   at com.prisma.local.PrismaLocalDependencies.<init>(PrismaLocalDependencies.scala:38)
prisma_1  |   at com.prisma.local.PrismaLocalMain$.delayedEndpoint$com$prisma$local$PrismaLocalMain$1(PrismaLocalMain.scala:15)
prisma_1  |   at com.prisma.local.PrismaLocalMain$delayedInit$body.apply(PrismaLocalMain.scala:12)
prisma_1  |   at scala.Function0.apply$mcV$sp(Function0.scala:34)
prisma_1  |   at scala.Function0.apply$mcV$sp$(Function0.scala:34)
prisma_1  |   at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
prisma_1  |   at scala.App.$anonfun$main$1$adapted(App.scala:76)
prisma_1  |   at scala.collection.immutable.List.foreach(List.scala:389)
prisma_1  |   at scala.App.main(App.scala:76)
prisma_1  |   at scala.App.main$(App.scala:74)
prisma_1  |   at com.prisma.local.PrismaLocalMain$.main(PrismaLocalMain.scala:12)
prisma_1  |   at com.prisma.local.PrismaLocalMain.main(PrismaLocalMain.scala)
database_prisma_1 exited with code 1
pt2/2
Exception in thread "main" java.lang.RuntimeException: Unable to load Prisma config: com.prisma.config.InvalidConfiguration: Expected hash under 'databases' to be non-empty
n
have you run
docker kill $(docker ps -aq)
and
docker rm $(docker ps -aq)
?
Also how does your docker-compose file look like
k
I'm fairly new to writing my own dockerfiles and docker-compose files but I'm in the mindset to be learning a lot today. Well, I went ahead and killed and rm'd like you suggested - I'm a little worried about how my mysql server container is gone (but again, thankfully I can nuke stuff without worry)
As a tiny bit of background I'm having a fun bit of self-teaching this week to dockerize my client and my server.
So I've been pretty weirded-out how prisma does docker stuff without any publicly facing dockerfile or docker-compose.
So the new docker-compose.yml magically appearing is a welcome addition of information. And it currently looks like this:
👍 1
Copy code
version: '3'
services:
  prisma:
    image: prismagraphql/prisma:1.7
    restart: always
    ports:
    - "4466:4466"
    environment:
      PRISMA_CONFIG: |
        port: 4466
Ahh, right right. Killing and removing the processes != deleting the image - so my mysql data is safe for now.
n
ah I see, your docker-compose file misses the databases key, which should be handled more gracefully in the future
for now, please add the databases key. you can run prisma init ~> create new database in a new folder to see how that looks like
k
Cool, cool. progress... Init'n gave me:
Copy code
version: '3'
services:
  prisma:
    image: prismagraphql/prisma:1.7
    restart: always
    ports:
    - "4466:4466"
    environment:
      PRISMA_CONFIG: |
        port: 4466
        databases:
          default:
            connector: mysql
            active: true
            host: db
            port: 3306
            user: root
            password: prisma
  db:
    image: mysql:5.7
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: prisma
Took that databases: section and pasted it in.
But how do I restart my mysql db container?
Copy code
Exception in thread "main" java.sql.SQLTransientConnectionException: database - Connection is not available, request timed out after 5002ms.
AAAAAA
Haha, I think I see my mistake, one sec
n
the restart always should actually take care of that
k
(I had not copied the line
db:
and below - I had only copied what was under
databases:
)
I might have another issue, fiddling around with it. Give me a few
Hmm. I cannot get into the mysql instance with user
root
and password
graphcool
- was that changed?
Trying to test some queries direct into the database using the playground I get the notice
Copy code
"Project not found: 'server-prisma@dev'"
("server-prisma" is the very generic name of my server, so originally my database was called server-prisma@dev)
Ah, right under my nose. Password is now
prisma
I see.
Okay. Okay. After a prisma local nuke here and there, a couple of docker kills and docker rms, a prisma deploy to re-seed the database working correctly... I now have a seeded mysql db with
server-prisma@default
instead of
server-prisma@dev
and I'm still getting the
Copy code
"Project not found: 'server-prisma@dev'"
error. Suggestion on how to change that
dev
to a
default
?
Also I wanna definitely say I am very appreciative of the help you've give me so far!
Ahhh, figured that one out, too. I was getting a surprising error while using
prisma deploy
about my .env file not being read. Realized I needed to run
prisma deploy
from the server's root directory and not from ./database (where I was located while running docker-compose up). Deploy read
PRISMA_STAGE
correctly and now I have a properly named database and things are working again!
n
hey @KyleG, are you all good now?