Migrated Postgres using migration tool, app now fails to deploy

I used the migration tool to go from Postgres legacy plugin to the database service. The migration completed successfully. My app now fails to deploy and errors out, with something about permissions: psycopg2.errors.InsufficientPrivilege: permission denied for schema public The application in question is a deployment of an open-source software, so I don't have detailed knowledge of the inner workings. I tried updating the env variables but it didn't seem to have any effect. Thanks in advance! Project ID: 7efe79a1-7371-4670-be20-509cfd00da3b
38 Replies
Percy
Percy6mo ago
Project ID: 7efe79a1-7371-4670-be20-509cfd00da3b
Duchess
Duchess6mo ago
Thread has been flagged to Railway team by @Brody.
mattytwoshoes
mattytwoshoes6mo ago
I connected to the underlying database tau via psql and I am not able to see the public schema with the credentials in the env variables, so it does seem like something went awry during migration.
Brody
Brody6mo ago
re-run it?
mattytwoshoes
mattytwoshoes6mo ago
Sorry, what specifically?
Brody
Brody6mo ago
the migration
mattytwoshoes
mattytwoshoes6mo ago
Not seeing how to do that in the UI, does deleting the new Postgres service give the prompt for it again?
Brody
Brody6mo ago
is there not a prompt on the legacy database?
mattytwoshoes
mattytwoshoes6mo ago
That's it unfortunately.
Brody
Brody6mo ago
might have to do a manual migration yourself with pg_dump and pg_restore
mattytwoshoes
mattytwoshoes6mo ago
I did do a pg_dump before the migration, so am considering doing this :/ Silly me to click the "migrate" button at 10pm on a Saturday 🤦
Brody
Brody6mo ago
you can always swap the variables back to the legacy ones and continue on
mattytwoshoes
mattytwoshoes6mo ago
Yes, but the legacy plugin will be deleted on January 31st, right?
Brody
Brody6mo ago
don't actually know about that, but that still give you plenty of time to perform a manual migration in the mean time
mattytwoshoes
mattytwoshoes6mo ago
Sounds like a solid plan, I don't much look forward to the pg_restore process manually...so let me try that. Thanks a ton for your help so far! 🙏
Brody
Brody6mo ago
what is the file size of the backup file?
mattytwoshoes
mattytwoshoes6mo ago
15MB or so
Brody
Brody6mo ago
oh then it should be done in a few seconds
mattytwoshoes
mattytwoshoes6mo ago
Do you know how to view what the previous environment variables were set to in my service? The migration updated them automatically, but I don't actually know how to view the previous values... This is in the app that uses my databases.
Brody
Brody6mo ago
just change the reference name space
mattytwoshoes
mattytwoshoes6mo ago
Sorry I don't follow.
mattytwoshoes
mattytwoshoes6mo ago
Alright it's back up. Thanks for your help Brody! I know you're not from the team but appreciate the help, really. Will wait for a response from the team on what to do about the new Postgres DB, for the time being I'll leave it as is.
Brody
Brody6mo ago
back up with the legacy database?
mattytwoshoes
mattytwoshoes6mo ago
Indeed. I used the reference naming as you suggested, I needed to update the names so it was clearer for me.
Brody
Brody6mo ago
where you going to try your hand at spinning up another fresh postgres database and doing pg_restore to it manually?
mattytwoshoes
mattytwoshoes6mo ago
Debating if I should nuke the new service or just pg_restore into it. I do think the data is there but the permissions got mucked up, but I cannot give myself permissions to the schema obviously.
Brody
Brody6mo ago
I think you should spin up a fresh postgres service and restore to it
mattytwoshoes
mattytwoshoes6mo ago
That's definitely an idea, but something for another day 🙂
Brody
Brody6mo ago
fair enough
mattytwoshoes
mattytwoshoes6mo ago
I'll leave this open, as the original guided migration did fail and the team might want to see that.
Brody
Brody6mo ago
true true
thomas
thomas6mo ago
I am a little unsure where you ended up on this @mattytwoshoes. The legacy plugins will indeed be removed around the 31st. If you weren't using the referenced variable, then the migration process would have left your services unconnected. We are only able to migrate services that are referencing a V1 DB via variable referencing. If you are using them now then you could just try migrating again. I don't think we block that
mattytwoshoes
mattytwoshoes6mo ago
OK thanks for the explanation! In order to try the migration again, do I just delete the new Postgres service?
thomas
thomas6mo ago
yes, and you can start the process again
mattytwoshoes
mattytwoshoes5mo ago
Have been trying to re-do this process since yesterday. There was an outage yesterday so I then went to bed. Now there seems to be another one now. I understand that I'm "late" since the deadline was communicated early enough, but this is also still somewhat unacceptable to have outages near to the deadline that prevent us from actually doing what's required :/
Brody
Brody5mo ago
do you think you could open a new thread in #🚚|db-migration-help ?
Want results from more Discord servers?
Add your server
More Posts