My Hobby plan expired and less than a month later I have resubscribed but my apps shows removed

Both Strapi and Postgres. How can I reactivate them?
63 Replies
Percy
Percy11mo ago
Project ID: 7f64daff-585a-4948-99d9-3722f6dfefe5
infntLoop
infntLoopOP11mo ago
7f64daff-585a-4948-99d9-3722f6dfefe5
Brody
Brody11mo ago
No description
Brody
Brody11mo ago
redeploy postgres first
infntLoop
infntLoopOP11mo ago
In progress fingers crossed Both restored, but the data is not there
Brody
Brody11mo ago
how have you verified that the data isnt there?
infntLoop
infntLoopOP11mo ago
I opened my strapi application and there is no data
Brody
Brody11mo ago
is the data in the database?
infntLoop
infntLoopOP11mo ago
No
infntLoop
infntLoopOP11mo ago
No description
Brody
Brody11mo ago
where you running strapi in development mode?
infntLoop
infntLoopOP11mo ago
The DB variables are in the application Should be linked Yes in development
Brody
Brody11mo ago
then data is not written to the database im sorry to say but the data is likely gone, you should have ran strapi in production mode
infntLoop
infntLoopOP11mo ago
Its okay, I have a db dump, is there a way I can restore it?
Brody
Brody11mo ago
how did you take the db backup?
infntLoop
infntLoopOP11mo ago
Through pg_dump -U railway -h Asking if there is a way in the ui itself
Brody
Brody11mo ago
nope no native database restore, you would need to use pg_restore
infntLoop
infntLoopOP11mo ago
Thank you @Brody Let me try that and hopefully all will be good
Brody
Brody11mo ago
going forward, please only run strapi in production mode when on railway
infntLoop
infntLoopOP11mo ago
sure thing In the pg restore, should I use the db URL starts with postgres:... or the project url?
Brody
Brody11mo ago
the database url
infntLoop
infntLoopOP11mo ago
Is it this one proxy.rlwy.net ....proxy.rlwy.net As I used this last time for the dump
Brody
Brody11mo ago
yep it would include that in the url
infntLoop
infntLoopOP11mo ago
Btw why I am getting the error in the above screenshot? While both db and app variables show in both sides
Brody
Brody11mo ago
no clue, the data tab is not reliable
infntLoop
infntLoopOP11mo ago
Understood Thanks again Got errors for all tables, already exists!
Brody
Brody11mo ago
interesting
infntLoop
infntLoopOP11mo ago
I guess it means these tables already exists and no changes made to override!? Typically pg_restore should delete existing and replace it with the dump pg_restore: from TOC entry 3392; 1259 16501 INDEX upload_files_folder_path_index railway pg_restore: error: could not execute query: ERROR: relation "upload_files_folder_path_index" already exists Command was: CREATE INDEX upload_files_folder_path_index ON public.files USING btree (folder_path);
Brody
Brody11mo ago
then what is going on with strapi
infntLoop
infntLoopOP11mo ago
Weird Did a rollback to the previous last month's deployment Let's see Same same 😦
Brody
Brody11mo ago
check the database's table manually with desktop software like dbgate restarting starpi could have just caused it to create a migration with empty tables, you might need to overwrite them
infntLoop
infntLoopOP11mo ago
Checking now
infntLoop
infntLoopOP11mo ago
No description
Brody
Brody11mo ago
is your data in them
infntLoop
infntLoopOP11mo ago
Yes
Brody
Brody11mo ago
run strapi in production mode then
infntLoop
infntLoopOP11mo ago
Man I love railway, very efficient. The only challenge I am facing is in the environments, tried setting up both environments but ran into many issues
Brody
Brody11mo ago
it may be more intuitive with staged changed turned on https://railway.app/account/feature-flags
infntLoop
infntLoopOP11mo ago
Still no data in production mode
Brody
Brody11mo ago
is strapi connecting to the correct database?
infntLoop
infntLoopOP11mo ago
It should be, last time it ran it was connected On graphql playground, I can't find my data queries So its not
Brody
Brody11mo ago
then I'm not actually sure what's going on, I don't use strapi myself maybe strapi has a community you could ask in? railway isn't adding any real magic to the setup, it's a postgres docker image and strapi running in a container
infntLoop
infntLoopOP11mo ago
I am sure there is a problem in connecting both services But as you said, it probably from strapi configurations side
Brody
Brody11mo ago
well are there any error logs in the strapi deployment?
infntLoop
infntLoopOP11mo ago
No!
Brody
Brody11mo ago
im out of ideas
infntLoop
infntLoopOP11mo ago
No description
infntLoop
infntLoopOP11mo ago
Its allright, let me playaround and figure it out
Brody
Brody11mo ago
sounds good, let me know if you find out anything!
infntLoop
infntLoopOP11mo ago
@Brody my dump is very good and contains all the required data. The only issue is I am unable to restore it as there is no “railway role” which was the user who created the dump Is there a way to change a postgres service role/user name?
Attacler/Bart
Attacler/Bart11mo ago
if you application works without, you can leave it at that
infntLoop
infntLoopOP11mo ago
The db created has a role called postgres, I want to change that role name, is there a way? When I edited through the variables view, it throws authentication error But still success with connecting using the postgres, which means changing the role name didn't take effect
Attacler/Bart
Attacler/Bart11mo ago
imports will display errors because it could not execute the line that changes the owner/role but the other parts wont fail bcause of that
infntLoop
infntLoopOP11mo ago
Didn't get you tbh Is there a way to change the roles for a postgres deployed service?
Attacler/Bart
Attacler/Bart11mo ago
if you run an import/restore it will execute all lines in the provided file it will continue the job eventho errors occure so if you have a role change or something, it will just give you an error and continue with the next line of the import resulting in no dataloss or anything weired its probably fine to leave it like this other option is to make the desired role(s) yourself within postgres but it wont do much
infntLoop
infntLoopOP11mo ago
Ok Thank you
infntLoop
infntLoopOP11mo ago
No description
infntLoop
infntLoopOP11mo ago
All errors Restored the db on other postgres instances and restored successfully Even locally, restored without a single error or warning
Attacler/Bart
Attacler/Bart11mo ago
seems like the db is not empty, the restore will asume that there is nothing blocking in its way so you have 2 options, create a new DB and restore it into there
infntLoop
infntLoopOP11mo ago
and no data
Attacler/Bart
Attacler/Bart11mo ago
seems like there is data, otherwise it would not say that the fk relation already exists
infntLoop
infntLoopOP11mo ago
Oh let me try that Yes created a new one and restored successfully I was nervous because of this 'role doesn't exist' error and thought it would jeobradaize (however its spelled :D) the data integrity
Attacler/Bart
Attacler/Bart11mo ago
i get it but lucky it doesnt 🙂
Want results from more Discord servers?
Add your server