R
Railway17mo ago
duncan

When to run Database Migrations and Seed?

I am creating a template but the template always fails because the RAILWAY_STATIC_URL is undefined which breaks next.js and it always fails during the database seed This is a GitHub gist of the errors https://gist.github.com/dephraiim/b82fe06248d72496f2297e693504d7d7
Gist
railway error
railway error. GitHub Gist: instantly share code, notes, and snippets.
19 Replies
Percy
Percy17mo ago
Project ID: 235891b1-c0ef-4dda-b8e8-ee34548ea614
duncan
duncanOP17mo ago
235891b1-c0ef-4dda-b8e8-ee34548ea614
Brody
Brody17mo ago
these errors are from the build stage, correct? and are you using a dockerfile?
duncan
duncanOP17mo ago
They’re from the build stage. I’m not using a custom docker file
Brody
Brody17mo ago
interesting, I will do some testing and get back to you
duncan
duncanOP17mo ago
The build was working before and I had a DATABASE_URL error I reported earlier and when that was fixed, I got this error
Brody
Brody17mo ago
can I see a screenshot of your service variables
duncan
duncanOP17mo ago
Brody
Brody17mo ago
i can reproduce this bug, those variables would just turn into https:// after the template is deployed, this is solved by deleting and re-adding them after the service has deployed, but i will flag the team on this issue
Percy
Percy17mo ago
Flagging this thread. A team member will be with you shortly.
Faraz
Faraz17mo ago
If I understand correctly, the RAILWAY_STATIC_URL not being available during the build phase is the issue? Did you try deploying a second time and seeing if it was available during the build? I wonder if it simply doesn't exist during the first build as the URL hasn't been created yet.
Brody
Brody17mo ago
it renders to https:// during build and while the app runs, same across rebuilds, remove the variable, cancel the redeploy, and then add it back and let the redeploy happen is what fixed it for me I am using that same variable in the exact same way they are in my chatwoot template, once deployed any links provided by chatwoot would end up being broken because it thought the domain was https
jr
jr17mo ago
Do you have a template where this happens? I am unable to reproduce it
Brody
Brody17mo ago
ill try to set something up i created this template in hopes of reproducing it https://railway.app/template/eagBhc but it worked fine, the template variable rendered just fine
duncan
duncanOP17mo ago
i'll look into this @Brody I recreated the same template with the exact variables and it works this time. I think the issue is from my end, I didn't check the Attach Domain checkbox when I was creating template. I checked it on the second template and I had no issue
Brody
Brody17mo ago
well that's good that it's no longer a problem! solved then
duncan
duncanOP17mo ago
Thank you. I couldn’t find any documentation on the Attach Domain checkbox, maybe it could be added in the future?
Faraz
Faraz17mo ago
duncan
duncanOP17mo ago
Sure, I'll do that
Want results from more Discord servers?
Add your server