I have a 2 machine setup that deploys a Rails app with the bluegreen strategy. Recently, I’ve been getting the following errors whenever I deploy. I feel like this wasn’t an issue when I was only on one machine. How would I go about fixing this?
ActiveRecord::StatementInvalid
PG::ConnectionBad: PQconsumeInput() server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request.
PG::ConnectionBad
PQconsumeInput() server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request.
Here’s my fly file:
app = "my-rails-api"
kill_signal = "SIGINT"
kill_timeout = 5
processes = []
[build]
[build.args]
BUILD_COMMAND = "bin/rails fly:build"
SERVER_COMMAND = "bin/rails fly:server"
[deploy]
release_command = "bin/rails fly:release"
strategy = "bluegreen"
[env]
PORT = "8080"
[experimental]
auto_rollback = true
[[services]]
http_checks = []
internal_port = 8080
processes = ["app"]
protocol = "tcp"
script_checks = []
auto_start_machines = false
auto_stop_machines = false
min_machines_running = 1
[services.concurrency]
hard_limit = 100
soft_limit = 90
type = "connections"
[[services.ports]]
force_https = true
handlers = ["http"]
port = 80
[[services.ports]]
handlers = ["tls", "http"]
port = 443
[[services.tcp_checks]]
grace_period = "1s"
interval = "15s"
restart_limit = 0
timeout = "2s"
[[statics]]
guest_path = "/app/public"
url_prefix = "/"