`release_command failed` while attempting to establish TLS connection

I’m trying to migrate a Postgres DB using sqlx.

I’ve added this release_command:

  release_command = "-c '/bin/sqlx migrate run --source backend/migrations'"

When I run fly deploy I get this TLS error:

➜ fly deploy
==> Verifying app config
Validating /home/solomon/Development/Websites/kpbj.fm/fly.toml
✓ Configuration is valid
--> Verified app config
==> Building image
Searching for image 'sbothwell/kpbj.fm:' remotely...
image found: img_2wokpy33wxqe43g1

Watch your deployment at https://fly.io/apps/kpbj-fm/monitoring

Running kpbj-fm release_command: -c '/bin/sqlx migrate run --source backend/migrations'

 ✖ release_command failed
Error release_command failed running on machine 148e52e7a02d18 with exit code 1.
Check its logs: here's the last 100 lines below, or run 'fly logs -i 148e52e7a02d18':
  Pulling container image docker-hub-mirror.fly.io/sbothwell/kpbj.fm:
  Successfully prepared image docker-hub-mirror.fly.io/sbothwell/kpbj.fm: (624.22722ms)
  Configuring firecracker
  [    0.036829] Spectre V2 : WARNING: Unprivileged eBPF is enabled with eIBRS on, data leaks possible via Spectre v2 BHB attacks!
  [    0.048897] PCI: Fatal: No config space access function found
   INFO Starting init (commit: d772ddd9)...
   INFO Preparing to run: `/nix/store/a1s263pmsci9zykm5xcdf7x9rv26w6d5-bash-5.2p26/bin/bash -c /bin/sqlx migrate run --source backend/migrations` as root
   INFO [fly api proxy] listening at /.fly/api
  2024/05/11 18:44:19 INFO SSH listening listen_address=[fdaa:9:1c68:a7b:235:989c:22a7:2]:22 dns_server=[fdaa::3]:53
  Machine created and started in 1.785s
  error: error occurred while attempting to establish a TLS connection: unexpected EOF
   INFO Main child exited normally with code: 1
   INFO Starting clean up.
   WARN could not unmount /rootfs: EINVAL: Invalid argument
  [    2.306738] reboot: Restarting system
  machine restart policy set to 'no', not restarting
Checking DNS configuration for kpbj-fm.fly.dev
Error: release command failed - aborting deployment. error release_command machine 148e52e7a02d18 exited with non-zero status of 1

I’m using the fly.io ‘managed’ postgres service and my app is able to connect to it when I omit the release_command.

Apparently the issue was that my DATABASE_URL needed to include ?sslmode=disable. Problem solved.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.