prisma-templates icon indicating copy to clipboard operation
prisma-templates copied to clipboard

503 Service Temporarily Unavailable when using Fargate

Open chrisbull opened this issue 7 years ago • 9 comments

So I keep following all the instructions here ... it gets created successfully, but whenever I access the externalUrl I get a 503 service temp unavail error.

I'm using an already existing Postgres database hosted on AWS, instead of using the templates. The logs show a connection error with the db. Is there a reason you guys haven't created a aws/postgres.yml version yet? I'm not too familiar with Fargate (yet), so any help with how to connect Prisma to my existing db while using Fargate would be very appreciated.

Thanks in advance for the help!

Btw - would be really great if you guys (the Prisma team) could create a more simple way to deploy Prisma Server on AWS. Maybe could add something to the cli?

chrisbull avatar Nov 07 '18 12:11 chrisbull

I am having this same issue with MongoDB, we are using Atlas to host our MongoDB clusters. Any support here @prisma???

danwetherald avatar Feb 08 '19 17:02 danwetherald

Couple of things that have killed my day but hopefully will help someone else that comes across this:

  1. You need to set the SSL flag to true. This isn't in the database connector for some reason, but the top level prisma config... jesus. It's a postgres specific flag. anyway. I also added the connectionLimit but i'm guessing that's optional?
          Environment:
            - Name: PRISMA_CONFIG
              Value: !Sub 
                - |
                  port: 60000
                  managementApiSecret: ${ManagementApiSecret}
                  databases:
                    default:
                      connector: ${DbConnector}
                      host: ${DbHost}
                      port: ${DbPort}
                      user: ${DbUser}
                      password: ${DbPassword}
                      connectionLimit: ${DbConnectionLimit}
                      migrations: true
                      ssl: true
                  ssl: true
  1. This template sets up a non-SSL public endpoint to your prisma server. I would convert that to SSL. It involves having a cert and a CNAME but you should certainly protect the traffic on the public net side of things.

haruska avatar Feb 27 '19 20:02 haruska

@haruska First time with AWS Fargate and my deployment fail with a "ROLLBACK_COMPLETE" status, without more detail. Is this because I didn't set up any SSL cert ?

sirojinadias avatar Feb 27 '19 23:02 sirojinadias

Having the same issue with mySQL, I tried adding the ssl param but nothing changed? Anyone found a solution to this?

tafelito avatar May 24 '19 20:05 tafelito

I have the same issues and this is the way how I to solve it:

I used PostgreSQL on RDS, for the first deploy, I forgot to allow IP of Fargate to connect that database. Then I check my security group of that RDS, make sure security group allow any IP to connect that database(just for testing, I have changed to Fargate ip created for security ) image And this is my fargate.yml for PostgreSQL fargate.zip

Now everything is working fine. This is result: image

ncbinh98 avatar Jun 17 '19 02:06 ncbinh98

adding HealthCheckGracePeriodSeconds: 30 in AWS::ECS::Service will be the solution. Check my template.

https://github.com/tonyfromundefined/prisma-aws-cloudformation

tonyfromundefined avatar Jun 19 '19 04:06 tonyfromundefined

I am having this same issue with MongoDB, we are using Atlas to host our MongoDB clusters. Any support here @prisma???

@dan003400 I'm also in the same situation. We also have MongoDB hosted on Atlas. Did you ever figure out the right config?

Dev-Dipesh avatar Jun 27 '19 18:06 Dev-Dipesh

For mongodb atlas you need to perform few changes in template. Environment: - Name: PRISMA_CONFIG Value: !Sub - | port: 60000 managementApiSecret: ${ManagementApiSecret} databases: default: connector: ${DbConnector} host: ${DbHost} user: ${DbUser} password: ${DbPassword} uri: ${DbUri} migrations: true - {} - Name: JAVA_OPTS Value: !Ref JvmOpts

sumitra19jha avatar Aug 05 '20 05:08 sumitra19jha

This has worked fine for me.

sumitra19jha avatar Aug 05 '20 05:08 sumitra19jha