Application is not responding?

Hi guys! I'm trying to deploy my personal project using Railway and I'm running into some trouble. It was working perfectly fine and then.. it's not responding anymore and giving me an error sign. Github repo: https://github.com/marchingkoala/Doggle Project ID: 1efb1a40-f8f8-4c10-9633-10f48a4d8e7e If you see my history, you can see I went back and forth using the full railway psql url and .env way. It would work when I used process.env instead of the full url WITH commented out url underneath for some reason but when I remove the commented out line, it would break. That's probably purely coincidental and not the real problem. Anyway, after all that, it was working and now it's broken again. I'm really stumped on this. Can someone take a look and help out a newb? Thank you
GitHub
GitHub - marchingkoala/Doggle
Contribute to marchingkoala/Doggle development by creating an account on GitHub.
63 Replies
Percy
Percy•2y ago
Project ID: 1efb1a40-f8f8-4c10-9633-10f48a4d8e7e
Brody
Brody•2y ago
1. you do not want to use nodemon when running your app on railway 2. please show me a screenshot of your railway service variables
marchingkoala
marchingkoalaOP•2y ago
Hi Brody. Thank you for commenting. Oof, I did not know that I could not use nodemon 😦 I checked the variable option and I have none. Is this the main source of problem?
Brody
Brody•2y ago
well you can use nodemon, but on railway it's just a pure waste of resources and can cause instabilities. it's only meant for local development purposes show me a screenshot of your full browser window of the railway project
marchingkoala
marchingkoalaOP•2y ago
Sorry I'm not sure what screenshot you are asking for... screenshot browser screenshot of the same thing?
Brody
Brody•2y ago
omg I'm sorry fixed
marchingkoala
marchingkoalaOP•2y ago
like this?
Brody
Brody•2y ago
yeah that's it okay so where's the database lol
marchingkoala
marchingkoalaOP•2y ago
oh.. it's..in a different project. in 'glistening-bikes' God these names are horrible lol
marchingkoala
marchingkoalaOP•2y ago
I...can't do that?
Brody
Brody•2y ago
you can change the names lol but yeah you want the database in the same project
marchingkoala
marchingkoalaOP•2y ago
OH I am an idiot sandwich
Brody
Brody•2y ago
and then you will want to setup the variable references for the database https://docs.railway.app/develop/variables#reference-variables
marchingkoala
marchingkoalaOP•2y ago
I didn't know you can add the database in the same project
marchingkoala
marchingkoalaOP•2y ago
is it there you can add the database? '+environment'?
Brody
Brody•2y ago
not quite, close the service and there will be a New button at the top right
marchingkoala
marchingkoalaOP•2y ago
omg OMG THANK YOU ok so this is why 😂
Brody
Brody•2y ago
so show me a screenshot of the service variables now?
marchingkoala
marchingkoalaOP•2y ago
marchingkoala
marchingkoalaOP•2y ago
does it look correct? i selected DATABASE_URL and then pasted in the url in the value slot
Brody
Brody•2y ago
it's not correct unfortunately you will want to setup the variable references for the database https://docs.railway.app/develop/variables#reference-variables but you do have the database in the same project now, so that's progress
marchingkoala
marchingkoalaOP•2y ago
when you say set up the variable references, you mean I just add that in without changing anything? I don't have to copy paste the url where `${{}}' is?
marchingkoala
marchingkoalaOP•2y ago
I'm sorry for asking so many questions
Brody
Brody•2y ago
if you used the drop-down on the left to achieve that result, then yes that's correct. with variable references you do not need to copy paste anything no worries at all, that's what this channel is for! railway help 🙂
marchingkoala
marchingkoalaOP•2y ago
OH. ok. last time, I used the drop-down and copy pasted the url let me try this and see what happens
Brody
Brody•2y ago
just as a sanity check, screenshot again please
marchingkoala
marchingkoalaOP•2y ago
marchingkoala
marchingkoalaOP•2y ago
haha i love a sanity check
marchingkoala
marchingkoalaOP•2y ago
Brody
Brody•2y ago
second screenshot is good now are you using that same name for the database variable in code?
marchingkoala
marchingkoalaOP•2y ago
yes
Brody
Brody•2y ago
perfect
marchingkoala
marchingkoalaOP•2y ago
huh. I'm still getting an error at least it's a different error tho
marchingkoala
marchingkoalaOP•2y ago
marchingkoala
marchingkoalaOP•2y ago
my db in raiway has no tables for some reason
Brody
Brody•2y ago
well yeah you just made a brand new database
marchingkoala
marchingkoalaOP•2y ago
is there a way to move my already set up local db into it?
Brody
Brody•2y ago
not from within railways ui, you want to use the two cli tools pg_dump and pg_restore, but I don't know the exact commands you would need to run surrounding those cli tools, however I'm sure someone has made a friendly guide for those two tools just do a little searching and I'm sure you will find a good tutorial
marchingkoala
marchingkoalaOP•2y ago
ahhh ok. yeah I really don't want to start from the scratch thank you so much Brody! I will dig around!
Brody
Brody•2y ago
dbgate also has a data exporter tool that may be able to copy tables from one database to another, but i still don't know the exact procedure for that, it may be an option if you want a gui based tool instead of a cli tool
marchingkoala
marchingkoalaOP•2y ago
sounds good. I'm sure either here or stackoverflow will have an answer for me Thank you 🙂 I do have a small question. it's weird because the previous db I set up in the separate project did have all my tables I did set that up a long time ago. maybe I did some kind of data dump and forgot...
Brody
Brody•2y ago
oh you have a seed command
marchingkoala
marchingkoalaOP•2y ago
i used npm run seed on my local
Brody
Brody•2y ago
that would create your tables at least now you will want to use the railway cli railway run npm run seed no local .env files needed
marchingkoala
marchingkoalaOP•2y ago
do i need to set up a script command? or just copy paste railway run npm run seed straight into the terminal?
Brody
Brody•2y ago
the railway cli command I gave you would be just ran in the terminal
marchingkoala
marchingkoalaOP•2y ago
ok.. I'm getting an error in my terminal
Brody
Brody•2y ago
well you do need to install the railway cli https://docs.railway.app/develop/cli#installation rename your current start script to dev and add a new start script node server/index.js
marchingkoala
marchingkoalaOP•2y ago
ok...
Brody
Brody•2y ago
and you would also need a proper build command, not sure exactly what that would be with webpack, but make sure it does not watch for file changes
marchingkoala
marchingkoalaOP•2y ago
i installed it and ran the 'railway run npm run seed' and it's asking me to login?
Brody
Brody•2y ago
of course it is
marchingkoala
marchingkoalaOP•2y ago
ugh I'm so sorry that i'm so new... this is getting harder than I thought haha
Brody
Brody•2y ago
yeah this can all be a bit much, so no worries, take your time
marchingkoala
marchingkoalaOP•2y ago
omg IT'S WORKING OMG SCREAM Brody!!! Thank you so much!!!!!
Brody
Brody•2y ago
now just fix up your scripts, add a proper build and start command
marchingkoala
marchingkoalaOP•2y ago
right now I have this.
marchingkoala
marchingkoalaOP•2y ago
so instead of 'build-watch', just do 'build'?
Brody
Brody•2y ago
no build-watch is for local development, leave that you need a new build script
marchingkoala
marchingkoalaOP•2y ago
...I'm gonna have to google to learn how to properly build that I have to go help make dinner now but I will come back to this
Brody
Brody•2y ago
it's probably just webpack lol without the -w flag, since I'm guessing that starts some type of file watcher, and you don't want to run a file watcher on railway because of the whole using unnecessary resources and instability thing
marchingkoala
marchingkoalaOP•2y ago
Lol that was so simple. Thank you. I learned so much with you
Brody
Brody•2y ago
im not sure thats just a guess, id never use webpack myself or at least directly like you are
Want results from more Discord servers?
Add your server