I set up a fly pg instance and then configured it to replicate from my master outside of fly (via wireguard peer). This worked well, but now the fly logs are spewing lots of stuff about not being able to create users, I guess because all the users and passwords come from the master now and not the default config. Any way around this?
@singpolyma Hey there, could you run fly image show --app <pg-app-name>
and paste the image details for me?
Current image details
Registry = registry-1.docker.io
Repository = flyio/postgres-standalone
Tag = 13.5
Version = v0.0.5
Digest = sha256:6d2901e1bc124fdf758e5995ccd3fff2f71761a0dc6c0015f4ed110022607300
Latest image details
Registry = registry-1.docker.io
Repository = flyio/postgres-standalone
Tag = 13.5
Version = v0.0.6
Digest = sha256:5c2ef7cb3752d34fdb71c3f8238a09ca124f24b949e452765f2d586ad75507d6
Awesome, thanks!
This worked well, but now the fly logs are spewing lots of stuff about not being able to create users, I guess because all the users and passwords come from the master now and not the default config. Any way around this?
So the main issue is that the postgres-standalone
configuration wasn’t created with replication in mind. On boot, if the required credentials haven’t been created we will work to create them. If the standalone instance is turned into a replica, this particular process will fail.
The upside is that this is all open source and you are free to fork and tweak the boot process to be compatible with your setup!
If you have any other questions on this, let me know!
What is flypgadmin
used for? Is it a problem at all that this is not present? Everything is working fine except for the log noise.
Is it a problem at all that this is not present? Everything is working fine except for the log noise.
That’s the user we use whenever our internal services need to make a connection. E.G. Health checks, metric gathering, flyctl, etc.
I’ve made some progress here, after creating flypgadmin and setting the required password on postgres user I now get this:
Failed to create required users: failed to list current users: can't scan into dest[2]: cannot scan null into *string
That seems to be coming from postgres-standalone/admin.go at master · fly-apps/postgres-standalone · GitHub but when I run that query myself in psql is works fine, and also flyctl pg users list mycluster
works fine also.
Whoops, looks like you found a bug. You can work around this by making sure all users have a password. I’ll work to get this patched.
UPDATE: The issue is fixed in v0.0.7
Cool! What’s the procedure to update one of these?
@singpolyma You can see which version you’re on by running fly image show --app <app-name>
. If there’s an update available, you can run fly image update --app <app-name>
.