8 months ago
Backend instantly crashing when I deploy the build. First time trying to make an app and honestly vibe coded the project. Any ideas normally when a backend just loads up and crashes right away? I checked all the .env vairables and they are the same as when I was testing locally and it was working. I changed all my frontend api's to point at my backend in railway so I'm not sure what the issue is.
45 Replies
8 months ago
seems like it runs for at least a few seconds before crashing. More logging would be helpful
8 months ago
What stack is it? Can you share a repo?
Sure. I'm new to all this and my repo is private on github. Am I able to add you as a collaborator or do I need to make it public. Using Node.js, express.js, MongoDB, React Native
I think I have updates but I don't want to send too much before you respond
8 months ago
Send as much as you want!
so I turned on the replica and I saw that the container stopping was actually the past replica and the newest instance I believe hasn't crashed and is still going
8 months ago
making your repo public would be best. I likely won’t be the one helping you out with this, but I’m teeing up the thread for someone else to solve.
so its just the fact that I can't actually do anything in the app like I put with the http requests not working I've just been looking it up and since I'm using nodemailer would gmail be blocking the login from railway even though I'm using an app password and maybe thats what's causing this?
I am not that knowledgable but I at least think that the last picture I sent means my backend is receiving the request from my frontend then something is happening after that
8 months ago
502 is a timeout, your app seems to be processing the request without returning an error code. this usually happens when your code crashes ungracefully after receiving a request
8 months ago
Adding more logging is what you need to do at this point
I don't know if I just don't know where the logging is or whatnot but I've tried to add console logging and still my logs only say what I've sent
also I made my repo public : https://github.com/djugovic2003/AddLife
8 months ago
yes, any console.log() calls your app makes will show up there
8 months ago
Seems like your app is crashing on startup. Starting by adding logging to whatever processes it runs when starting is a good first step
I got no idea the console logs all logged up until after it start it won't send a single request to the express app tho so idk whats going on. backend is listening on port 8080. the container is running and not crashing. No logs from route handlers. 502 errors for all requests in http logs with long timeouts. IDK is it a deployment/platform config issue. This is my first time trying to deploy an app so maybe I did something wrong or didn't do something altogether. Not sure what to try

I'm going to sleep though hopefully someone much smarter than I will fix this tomorrow 😄
8 months ago
Looks like the container was stopped, that means it crashed. More logs! What happened 6 seconds after connecting to MongoDB?
the new instance never stopped it appears so it doesn't seem like its crashing its just not processing any requests
8 months ago
Ah my mistake, I see that now
8 months ago
Best to turn off replicas for now. That’s just complicating the logging and which service your requests are getting sent to. Simplify the problem so it can be solved easier, then you can add replicas back
Yeah I just turned them on and noticed it was a different replica stopping because it was there whether I had replicas clicked or not
Or do you mean should I go to the specific build log for my most current build so I don’t see any of the old stuff
8 months ago
for now, turn off replicas until we get your problem fixed
okay thank you for the help do you have any idea the sort of timeline these tidkcets are fixed at
wow took way too many hours for that to be the issue I figured htat one out I think

8 months ago
This is not a ticket for the team, this is community support. Given that this is a code issue, not a platform issue, we will not be raising this to the team
8 months ago
It’s extremely possible that your frontend (that I’m assuming you vibe coded as well?) is double sending requests
8 months ago
that’s what happens when you vibe code lol
8 months ago
gotta pay attention to what you’re “coding” otherwise you’ll be lost
8 months ago
When using AI, you learn general concepts, not how to code. You might learn how to debug, but you won't learn how to write your own code
8 months ago
It's not a learning tool, you're skipping many many foundational steps
yah i'm taking some cs courses here in the future to actaully learn how to code right now I'm just learning about how everything interacts in app making and getting familiar with the different softwares

