20 days ago
Hi, I get this error when trying to swap the volumes:
Service already has a volume attached in this environment (VolumeInstance d437b901-f365-462d-bb1c-ff1b256c192d, Volume d9c855a8-f918-4d73-a15a-90f2b84b09f6). A service can only have one volume.
(We fucked up a migration xd)
21 Replies
20 days ago
Viewing the IDs, we need to swap the volume d9c855a8-f918-4d73-a15a-90f2b84b09f6 for the a75b751e-adbf-47bc-bc54-c6a0b9e70998. The volume with the ID d437b901-f365-462d-bb1c-ff1b256c192d actually doesn't exist?
20 days ago
This also is preventing backups from being restored
20 days ago
I tried to create a new postgres service, then set the volume it to and then change the connection string, but it stills fails to do the swap in new postgres services
20 days ago
Did you unmount volumes associated with both services first?
20 days ago
I could not find a button to do it
20 days ago
Nevermind. You need to delete the service to unmount the volume, as the service requires a volume.
20 days ago
I think I fixed btw
20 days ago
Creating a new postgres service and drag and dropping the volume to it seems to work
20 days ago
But using the button doesn't
Attachments
20 days ago
nvm, did't work
20 days ago
(You might get password errors)
20 days ago
Which part didn't work?
20 days ago
Attachments
20 days ago
you were right btw
20 days ago
Attachments
20 days ago
Try this:
- Disable all public networking on the database if you have any, as the following steps will disable user authentication
- SSH into your database service (right click your service and select
Copy SSH Command) - Run this command:
sed -i 's/host all all all scram-sha-256/host all all ::\/0 trust/' /var/lib/postgresql/data/pgdata/pg_hba.conf(This will bypass user authentication) - Redeploy your database
- SSH again, and run the command
psql - Run
ALTER USER postgres with password '';where `` is the value of the variablePGPASSWORDin your Railway dashboard - Type
exit - Run
sed -i 's/host all all ::\/0 trust/host all all all scram-sha-256/' /var/lib/postgresql/data/pgdata/pg_hba.conf(This will re-enable user authentication) - Redeploy your database
20 days ago
That work and now the new service actually works
20 days ago
Now it should be just changing the env vars
20 days ago
Well, everything is now working. Thank you very much and God bless :3
20 days ago
I will not delete the original database and volume if some railway admin wants to check them later, may find the root of the issue
20 days ago
np
Status changed to Solved 0x5b62656e5d • 20 days ago