Hi there,
I recently realised that my postgres-ha app hasn’t had any volumes attached since I transitioned from Nomad to the Machines architecture and I am trying to remedy that.
I’ve verified I have the appropriate mount:
[[mounts]]
source = 'pg_data_machines'
destination = '/data'
And matching volumes:
➜ fly volumes list -a orchestrate-db
ID STATE NAME SIZE REGION ZONE ENCRYPTED ATTACHED VM CREATED AT
vol_7vzoxd2pk6n671q4 created pg_data_machines 3GB syd 8fbc true 39 minutes ago
vol_q4q1md8kk5nme1gv created pg_data_machines 3GB syd 843a true 39 minutes ago
However, when I fly deploy
to get a machine with the attached volume FLY_CONSUL_URL
doesn’t seem to be set:
Updating existing machines in 'orchestrate-db' with rolling strategy
Smoke checks for 6e824532a20758 failed: the app appears to be crashing
Check its logs: here's the last lines below, or run 'fly logs -i 6e824532a20758':
Pulling container image registry-1.docker.io/flyio/postgres:14.6
Successfully prepared image registry-1.docker.io/flyio/postgres:14.6 (1.192850135s)
Setting up volume 'pg_data_machines'
Opening encrypted volume
Configuring firecracker
[ 0.035372] Spectre V2 : WARNING: Unprivileged eBPF is enabled with eIBRS on, data leaks possible via Spectre v2 BHB at
tacks!
[ 0.038879] PCI: Fatal: No config space access function found
INFO Starting init (commit: bfa79be)...
INFO Mounting /dev/vdb at /data w/ uid: 0, gid: 0 and chmod 0755
INFO Resized /data to 3204448256 bytes
INFO Preparing to run: `docker-entrypoint.sh start` as root
INFO [fly api proxy] listening at /.fly/api
2024/02/02 00:10:25 listening on [fdaa:0:47b5:a7b:233:be1b:1ef5:2]:22 (DNS: [fdaa::3]:53)
Machine created and started in 3.307s
panic: FLY_CONSUL_URL or CONSUL_URL are required
goroutine 1 [running]:
main.main()
/go/src/github.com/fly-examples/postgres-ha/cmd/start/main.go:34 +0x1c13
INFO Main child exited normally with code: 2
INFO Starting clean up.
INFO Umounting /dev/vdb from /data
WARN hallpass exited, pid: 314, status: signal: 15 (SIGTERM)
2024/02/02 00:10:26 listening on [fdaa:0:47b5:a7b:233:be1b:1ef5:2]:22 (DNS: [fdaa::3]:53)
[ 2.244624] reboot: Restarting system
machine did not have a restart policy, defaulting to restart
Consul should be enabled because of:
[experimental]
enable_consul = true
So I am unsure of what is going on. Short of recreating the cluster, is there anything I’m doing wrong? (I plan to move to postgres-flex some time soon, but want this fixed in the meantime!)
Thanks!