a month 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
a month 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?
a month ago
This also is preventing backups from being restored
a month 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
a month ago
Did you unmount volumes associated with both services first?
a month ago
I could not find a button to do it
a month ago
Nevermind. You need to delete the service to unmount the volume, as the service requires a volume.
a month ago
I think I fixed btw
a month ago
Creating a new postgres service and drag and dropping the volume to it seems to work
a month ago
But using the button doesn't
Attachments
a month ago
nvm, did't work
a month ago
(You might get password errors)
a month ago
Which part didn't work?
a month ago
Attachments
a month ago
you were right btw
a month ago
Attachments
a month 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
a month ago
That work and now the new service actually works
a month ago
Now it should be just changing the env vars
a month ago
Well, everything is now working. Thank you very much and God bless :3
a month 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
a month ago
np
Status changed to Solved 0x5b62656e5d • about 1 month ago