Prisma1: Starting with docker-compose does not work

Created on 24 Feb 2018  路  11Comments  路  Source: prisma/prisma1

I've tried to start Prisma with docker-compose using compose file from docs (providing env data from examples and trying prisma:1.0 and prisma:1.1).

And it does not work: when Prisma tries to connect to mysql, on the side of mysql I get: Aborted connection 11 to db: 'unconnected' user: 'root' host: '172.21.0.2' (Got an error reading communication packets).

The same happens when recreating docker setup with docker api programmatically.

Network seems to be fine: telnet from prisma container on 3306 port of mysql container works ok, also cli mysql client (after installing it on prisma container) connects to db ok. But not the Prisma server.

But with prisma deploy local this problems doesn't happen.

So it seems native deployment does something more or there is a difference in setups, but I've spent three hard days on debugging and reverse engineering with no luck.

Most helpful comment

Hi @terion-name, I had success starting Prisma with docker-compose. That is why I created an example setup which I'm happy to share 馃槃 https://github.com/akoenig/prisma-docker-compose

All 11 comments

Hi @terion-name, I had success starting Prisma with docker-compose. That is why I created an example setup which I'm happy to share 馃槃 https://github.com/akoenig/prisma-docker-compose

@akoenig thank you! it is still a question, why setup from docs doesn't work, but your example seems to be working! I'l use it as starting point for programmatic setup

Thanks for your input @terion-name @akoenig!

Did you find the problem in the documentation? 馃檪Let's improve it together!

@akoenig Your example is great, just one quick question though.
Now that we've ejected out to our own docker-compose.yml setup. How do we deploy changes via prisma?

@hailwood Thanks! Glad that you like it 馃槉 - I added a new section in the readme about how to connect your Prisma CLI to the new cluster and deploy your database schema. See: https://github.com/akoenig/prisma-docker-compose#connecting-to-the-cluster-via-prisma-cli

@marktani Ya, I think the problem is that the MYSQL_DATABASE is defined in the environment of the mysql container. From my experience this leads to a creation of the internal database by mysql, whereas Prisma server seems to do that as well. I think the most confusing part is the configuration of the environment variables, because you can mess things up pretty quickly in there. My suggestion is to separate them as I did in my example. I will compile a PR for proposing changes there.

@akoenig recreating your compose setup via docker api also works. Thank you very much, I've spent tons of time trying to bring it up

@terion-name Awesome! Glad that everything works fine 馃槉

@akoenig @marktani as I see, SQL_INTERNAL_DATABASE can be only graphcool, otherwise nothing works. That's not proper behaviour, I suspect

also, if I don't provide BUGSNAG_API_KEY variable at all, server (1.3-beta) errors:

key not found: BUGSNAG_API_KEY
java.util.NoSuchElementException: key not found: BUGSNAG_API_KEY
    at scala.collection.MapLike.default(MapLike.scala:232)
    at scala.collection.MapLike.default$(MapLike.scala:231)
    at scala.collection.AbstractMap.default(Map.scala:59)
    at scala.collection.MapLike.apply(MapLike.scala:141)
    at scala.collection.MapLike.apply$(MapLike.scala:140)
    at scala.collection.AbstractMap.apply(Map.scala:59)

@terion-name Ah, right. This has to be an empty string BUGSNAG_API_KEY="".

Thanks for the contribution, @akoenig. With that I am closing this issue.

Feel free to open a new issue here or a discussion in the Forum if you have further questions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sorenbs picture sorenbs  路  3Comments

marktani picture marktani  路  3Comments

tbrannam picture tbrannam  路  3Comments

schickling picture schickling  路  3Comments

MitkoTschimev picture MitkoTschimev  路  3Comments