Redis not working

Need help with redis
99 Replies
Percy
Percyā€¢6d ago
Project ID: N/A
Flipping Pal
Flipping PalOPā€¢6d ago
N/A
Erisa
Erisaā€¢6d ago
You'll need to provide a lot more information than that
Flipping Pal
Flipping PalOPā€¢6d ago
This is the error I am getting on the back
No description
Flipping Pal
Flipping PalOPā€¢6d ago
This is my backend code
No description
Flipping Pal
Flipping PalOPā€¢6d ago
Nevermind I found the issue
Flipping Pal
Flipping PalOPā€¢6d ago
I have an issue where the front end is trying to connect to this backend endpoint, but is throwing a weird error
No description
Erisa
Erisaā€¢6d ago
As it says, youre missing an Access-Control-Allow-Origin header to allow requests between the two
Erisa
Erisaā€¢6d ago
MDN Web Docs
Access-Control-Allow-Origin - HTTP | MDN
The HTTP Access-Control-Allow-Origin response header indicates whether the response can be shared with requesting code from the given origin.
PrivateScript
PrivateScriptā€¢6d 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.
PrivateScript
PrivateScriptā€¢6d ago
So we are allowing cors from everywhere in the code as well
No description
PrivateScript
PrivateScriptā€¢6d ago
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
Brody
Brodyā€¢6d ago
open the backend url directly in your web browser
PrivateScript
PrivateScriptā€¢6d ago
which one, my own backend server or the one from FlippingPal (my customer) ?
Brody
Brodyā€¢6d ago
the one you are having issues with
PrivateScript
PrivateScriptā€¢6d ago
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
PrivateScript
PrivateScriptā€¢6d ago
No description
PrivateScript
PrivateScriptā€¢6d ago
although the console gives me that error and probably thats not so normal anymore, right?
Brody
Brodyā€¢6d ago
502 bad gateway check your http logs on the deployment
PrivateScript
PrivateScriptā€¢6d ago
oh, yeah, i guess i will have to wait until hes back for that, dont have his railway access
Brody
Brodyā€¢6d ago
going forward you should probably both be on the same railway team
PrivateScript
PrivateScriptā€¢6d ago
yeah I saw that and told him I didnt know how to use that yet but we will probably use it is it hard to setup? I have never ever used that can he just add my railway user to it or something like that?
Brody
Brodyā€¢6d ago
you already have a team on Railway, just add them to it
PrivateScript
PrivateScriptā€¢6d ago
hes the one who will pay the bill tho so i assume he should be the owner of the team
Brody
Brodyā€¢6d ago
whatever works best for you
PrivateScript
PrivateScriptā€¢6d ago
yeah we will do like that, when hes back we get to talk about this āœ…
PrivateScript
PrivateScriptā€¢6d ago
i just checked, error cannot be that because it also appears in my working backend:
No description
PrivateScript
PrivateScriptā€¢6d ago
so its gotta me something else I guess I will just add some console.logs and be pushing so I can see whats going on, thats also a way
Brody
Brodyā€¢6d ago
check the http logs first when he is back
PrivateScript
PrivateScriptā€¢6d ago
ah right, so you recommend me to wait for him before trying stuff, right? otherwise the http logs gonna scroll up and disappear eventually i think idk
Brody
Brodyā€¢6d ago
my gut feeling is that your backend is crashing
PrivateScript
PrivateScriptā€¢5d ago
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
Flipping Pal
Flipping PalOPā€¢5d ago
No description
PrivateScript
PrivateScriptā€¢5d ago
thats the error we are getting
Flipping Pal
Flipping PalOPā€¢5d ago
@PrivateScript is helping me with the project
PrivateScript
PrivateScriptā€¢5d ago
yes 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 its basically as if it was not receiving the request even we really need help here I got no idea how to debug it
Attacler/Bart
Attacler/Bartā€¢5d ago
jup, did that a few times any error on the backend side?
PrivateScript
PrivateScriptā€¢5d ago
Thats nice! 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
Attacler/Bart
Attacler/Bartā€¢5d ago
can you try setting the header "Access-Control-Allow-Origin" with the value *?
PrivateScript
PrivateScriptā€¢5d ago
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
Attacler/Bart
Attacler/Bartā€¢5d ago
rn it seems like its screaming about cors, that happends in one of the following 3 cases: - No Cors header being set at all - Webserver crashing/not reachable (the cors header is not being sent to the client thus chrome sees it as no cors header being set) - Some other setting regarding cors is incorrect
PrivateScript
PrivateScriptā€¢5d ago
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
Attacler/Bart
Attacler/Bartā€¢5d ago
sounds weired tbh, i have never seen the same is the webserver actually reachable?
PrivateScript
PrivateScriptā€¢5d ago
me neither and i have been programming for few years already, no idea lets do some test with my postman
PrivateScript
PrivateScriptā€¢5d ago
No description
PrivateScript
PrivateScriptā€¢5d ago
with correct token as well, but like, it just doesnt reach anything
No description
Attacler/Bart
Attacler/Bartā€¢5d ago
i guess the webserver is either not listening on the right port or smth else goes wrong
PrivateScript
PrivateScriptā€¢5d ago
oh sorry i made accidentally post request with postman, its a get let me try again yeah something weird like that could be no idea
PrivateScript
PrivateScriptā€¢5d ago
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
No description
PrivateScript
PrivateScriptā€¢5d ago
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 wait wtf mine isnt working either now
PrivateScript
PrivateScriptā€¢5d ago
and this one was working 2 days ago last time i deployed, i havent changed anything
No description
PrivateScript
PrivateScriptā€¢5d ago
somethings weird here, any support available? oh I found an issue, about external APIs im using, could be that
Brody
Brodyā€¢4d ago
just to clear any possible confusion, this is not an issue with the platform.
PrivateScript
PrivateScriptā€¢4d ago
okey so now the external APIs are working and i get it working on my own backend deployment but not on the customers deployment
Brody
Brodyā€¢4d ago
check the http logs for it
PrivateScript
PrivateScriptā€¢4d ago
@Brody Hold on we got to fix small step due to env variable so thats 1 thing 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?
Brody
Brodyā€¢4d ago
connect to it and delete the keys
PrivateScript
PrivateScriptā€¢4d ago
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?
Brody
Brodyā€¢4d ago
have you checked the http logs yet?
PrivateScript
PrivateScriptā€¢4d ago
yes sorry i was talking with customer
Brody
Brodyā€¢4d ago
this is not a platform issue
PrivateScript
PrivateScriptā€¢4d ago
we checked like 50 times http logs, deploy logs, we getstrange errors
Brody
Brodyā€¢4d ago
please send a link to the service in question
PrivateScript
PrivateScriptā€¢4d ago
yeah the customer service or my working service?
Brody
Brodyā€¢4d ago
the service with the domain from the cors errors
PrivateScript
PrivateScriptā€¢4d ago
yeah the customer service... he just went to sleep :S 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/
Brody
Brodyā€¢4d ago
thats a different url than whats in the screenshot?
PrivateScript
PrivateScriptā€¢4d ago
oh sorry i manually changed it because i hsd copied the front thing yeah numbers are different i will copy correct one got it on postman i think 1 sec ye https://back-production-0201.up.railway.app/ can you find the project somehow with the url?
Brody
Brodyā€¢4d ago
yes
PrivateScript
PrivateScriptā€¢4d ago
šŸ™‚ 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
Brody
Brodyā€¢4d ago
you havent checked the http logs
PrivateScript
PrivateScriptā€¢4d ago
wait http logs you mean the network logs in the frontend?
Brody
Brodyā€¢4d ago
backend
PrivateScript
PrivateScriptā€¢4d ago
i havent seen those, you see anything strange there? dont know where they are i double check now on my backend tho dont have his now he was screensharing with me but went to sleep cause we different timezones
PrivateScript
PrivateScriptā€¢4d ago
No description
PrivateScript
PrivateScriptā€¢4d ago
i see mines im blind i never see that so do you see anything to strange in those? 304 is fine i dont have stripe setup thats normal
Brody
Brodyā€¢4d ago
i see /market/ah-data-new/us giving a 502
PrivateScript
PrivateScriptā€¢4d ago
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
Brody
Brodyā€¢4d ago
that would be an issue with your backend code
PrivateScript
PrivateScriptā€¢4d ago
but in my railway it works and its same code, so how can him fail then šŸ˜¢ 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
Brody
Brodyā€¢4d ago
you need better logging, your app is failing to respond to a request
PrivateScript
PrivateScriptā€¢4d ago
im not using asia region, why is that there? im using us region where it says edgeRegion whats that none of us are from asia neither our railway server
Brody
Brodyā€¢4d ago
thats the region the request was made from
PrivateScript
PrivateScriptā€¢4d ago
none of us are from asia we dont using VPNs or proxies, wtfunk?
Brody
Brodyā€¢4d ago
i dont make the rules haha
PrivateScript
PrivateScriptā€¢4d ago
ah Im thinking one thing, domain has numbers, I believe only china domains usually have numbers therefore railway is thinking its coming from China
Brody
Brodyā€¢4d ago
no, again, this is not a platform issue
PrivateScript
PrivateScriptā€¢4d ago
then i got some chinese hacker or something lol nothing to hack there tho idk what he looking for šŸ˜„
Brody
Brodyā€¢4d ago
it doesnt mean its someone from china thats just the closest region we own for that ip
PrivateScript
PrivateScriptā€¢4d ago
ah right, i can imagine then
Brody
Brodyā€¢4d ago
geoip on that ip places it in Australia
PrivateScript
PrivateScriptā€¢4d ago
that makes sense hes from there and im from europe right, yeah 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
Brody
Brodyā€¢4d ago
ip addresses are not sensitive info fwiw
PrivateScript
PrivateScriptā€¢4d ago
i told him this as well, will screenshot this for proof xd
Brody
Brodyā€¢4d 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
PrivateScript
PrivateScriptā€¢4d ago
yeah i will try to fight that on my own i guess see what i can do
Brody
Brodyā€¢4d ago
i wish you the best of luck
PrivateScript
PrivateScriptā€¢4d ago
thank ā¤ļø one platform question this time tho 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?
Brody
Brodyā€¢4d ago
yes as long as he adds you as an adminn to his team, you have full access
Want results from more Discord servers?
Add your server