164 Replies
a year ago
You'll need to provide a lot more information than that
I have an issue where the front end is trying to connect to this backend endpoint, but is throwing a weird error

a year ago
As it says, youre missing an Access-Control-Allow-Origin header to allow requests between the two
a year ago
Hi, Im the developer working for FlippingPal (hes out for now, he went to sleep) but I will ask some stuff about this error we were having
So these CORS errors happened to me the other day too, I realised it was some other error that I ended up fixing and that got fixed automatically. So the CORS error seems to be misleading sometimes or at least gets caused right in coincidence with other unrelated error.
What seems strange is that I already had this deployed on my server before help him getting setup the backend on his own railway, and code is same but in mine is working, its quite strange
I guess we will double check env variables when hes around again but until then I wonder what else could it be, no idea tbh
a year ago
open the backend url directly in your web browser
which one, my own backend server or the one from FlippingPal (my customer) ?
a year ago
the one you are having issues with
right, the customer one: https://back-production-0201.up.railway.app
it says it cannot get /, which seems normal because I dont have any route in my code pointing to the base url
although the console gives me that error and probably thats not so normal anymore, right?
a year ago
502 bad gateway
a year ago
check your http logs on the deployment
oh, yeah, i guess i will have to wait until hes back for that, dont have his railway access
a year ago
going forward you should probably both be on the same railway team
yeah I saw that and told him I didnt know how to use that yet but we will probably use it
a year ago
you already have a team on Railway, just add them to it
a year ago
whatever works best for you
i just checked, error cannot be that because it also appears in my working backend:

I guess I will just add some console.logs and be pushing so I can see whats going on, thats also a way
a year ago
check the http logs first when he is back
ah right, so you recommend me to wait for him before trying stuff, right?
a year ago
my gut feeling is that your backend is crashing
yeah, whats crazy is that we managed to register a user and still throws us an error but database working fine
i know theres a payment processor thingy we dont have setup correctly yet but it should not crash the entire thing
but yeah i will just check when hes back, we see the logs on his railway then
Btw out of curiosity for future projects, does Railway support a backend running on Rust?
@Flipping Pal So we are having issues with the login-with-token endpoint now for some reason, it throws a CORS error. But the normal register and login seem to work fine
so we added some console.logs to that endpoint to see if theres like any errors and it wont even show the 1st console.log which is right at the start of the endpoint
theres no logs on the backend when I hit the endpoint although I did place few console.logs, none of that appears as if basically the endpoint is just not getting hit, which seems extremely strange to me and basically impossible to debug
i will take note and whenever my customer is available I will tell him to try this, but I will tell you one strange thing: I do have this same backend deployed on my own railway, and it works without any error. Makes me think theres an error somewhere thats not code related.
And btw some of the endpoint in the same router going through the same cors() middleware are not throwing that cors error, so I dont believe its actually anything CORS related but rather cors error being a side effect of some other error
i wonder if its something server related, because as i said code is exactly same code in my own railway and it works perfect, if it was purely cors error why would the same code work on one place and not the other, right?
maybe some settings on the railway service, idk, something like that, no idea tbh
seems like the token is different because is customer database, its whatever, but i get a proper error so the endpoint in theory its working

when hes back i will check his backend service logs after doing a get request with my postman hopefully through the console.logs maybe something appears, idk
and this one was working 2 days ago last time i deployed, i havent changed anything

a year ago
just to clear any possible confusion, this is not an issue with the platform.
a year ago
check the http logs for it
now we need to delete redis storage so that our backend re-fetches data again, how can we do a flush all of the redis service?
a year ago
connect to it and delete the keys
yeah we did, im just so surprised that some data fetchs that are not even using env variables are literally coming undefined while in my backend deployment with the same exact thing it wont, it makes 0 sense to me, makes me think maybe numeric domains are blocked automatically due to security or something like that
because my domain is https://service-backend-project-ah-production.up.railway.app/
but customer domain is https://back-production-43b4.up.railway.app/
which is the main difference i see here, code is same. env variables are same. (except for reference ones like backend/frontend where we checked like 5 times they are the correct ones for each)
have you ever heard of anything like this, Brody? maybe some people are blocking domains with numbers on it due to usually coming from non-trusted places?
a year ago
have you checked the http logs yet?
a year ago
this is not a platform issue
a year ago
please send a link to the service in question
a year ago
the service with the domain from the cors errors
thats why im writing here now we were trying to debug looking at the logs and my console.logs
this is the url thats only thing i got for now: https://back-production-43b4.up.railway.app/
a year ago
thats a different url than whats in the screenshot?
a year ago
yes
so basically, on the logs im logging some length of some stuff im fetching, some cases it shows undefined but i double check the urls they give me undefined (its just a json file) and i can see it right away on the browser, like, the endpoint is not failing, and my code on my project is exactly the same and it will work but how the same code on his domain wont work then? this seems like black magic to me
a year ago
you havent checked the http logs
a year ago
backend
on my backend tho dont have his now he was screensharing with me but went to sleep
a year ago
i see /market/ah-data-new/us giving a 502
i saw that as well just from the frontend network and console errors when he was screensharing, but code is identical and env variables as well, which makes me completely lost
a year ago
that would be an issue with your backend code
i guess next day we will just redo the entire backend setup, its only thing I can even think of, something cursed there i cant figure out so just re-launch the entire thing on different service
a year ago
you need better logging, your app is failing to respond to a request
a year ago

a year ago
thats the region the request was made from
a year ago
i dont make the rules haha
Im thinking one thing, domain has numbers, I believe only china domains usually have numbers
a year ago
no, again, this is not a platform issue
a year ago
it doesnt mean its someone from china
a year ago
thats just the closest region we own for that ip
a year ago
geoip on that ip places it in Australia
please remove his ip from the image or delete the image, he takes security very seriously. but thanks for the help attempt i will just look further with him and try to figure out a way to debug this
a year ago
ip addresses are not sensitive info fwiw
a year ago
either way, theres not much more we can help with as these issues you are facing are not platform issues, but issues with your own code
a year ago
i wish you the best of luck
can he just make a team and i fight the project on my own without him having to be on call, do i get like full access to the services?
a year ago
yes as long as he adds you as an adminn to his team, you have full access







