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
Project ID:
7efe79a1-7371-4670-be20-509cfd00da3b
Thread has been flagged to Railway team by @Brody.
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.re-run it?
Sorry, what specifically?
the migration
Not seeing how to do that in the UI, does deleting the new Postgres service give the prompt for it again?
is there not a prompt on the legacy database?
That's it unfortunately.
might have to do a manual migration yourself with pg_dump and pg_restore
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 🤦
you can always swap the variables back to the legacy ones and continue on
Yes, but the legacy plugin will be deleted on January 31st, right?
don't actually know about that, but that still give you plenty of time to perform a manual migration in the mean time
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!
🙏
what is the file size of the backup file?
15MB or so
oh then it should be done in a few seconds
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.
just change the reference name space
Sorry I don't follow.
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.
back up with the legacy database?
Indeed.
I used the reference naming as you suggested, I needed to update the names so it was clearer for me.
where you going to try your hand at spinning up another fresh postgres database and doing pg_restore to it manually?
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.
I think you should spin up a fresh postgres service and restore to it
That's definitely an idea, but something for another day 🙂
fair enough
I'll leave this open, as the original guided migration did fail and the team might want to see that.
true true
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
OK thanks for the explanation! In order to try the migration again, do I just delete the new Postgres service?
yes, and you can start the process again
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 :/
do you think you could open a new thread in #🚚|db-migration-help ?