socket.gaierror: [Errno -2] Name or service not known
I have a hypercorn app but am encountering this error: socket.gaierror: [Errno -2] Name or service not known. It works when I specify a railway.json that specifies a port, but only on a local host, not on the public domain. How can I fix this?
37 Replies
Project ID:
N/A
you want to use
Hmm same error:
show me your new railway.json please
might need to escape some of it
Same thing still
hmm that's odd, is that not how it written here?
https://github.com/vfehring/fastapi/blob/main/railway.json#L7
if it was wrong we absolutely would have heard of it by now
I can try ading the schema and build fields?
nah that's not the issue
Should I ingore this error
share your repo?
replace the railway.app domain with schema.up.railway.app and the error goes away
Are you able to view this? https://github.com/onjas-buidl/GPTs-ads-backend
nope
Let me try the new railway json
Same thing
This is what my repo looksl ike
delete the procfile
that's a heroku thing mainly
Ok
also I'd like the build logs https://bookmarklets.up.railway.app/log-downloader/
before you push this change
Oh I already pushed
But it's the same error
how can you be sure that railway is using the correct start command?
Do you mean the hypercorn command?
yes
That works locally for me, maybe it's not the correct command for railway though
I mean, it works here for fastapi
When I hard code the port to 8000, it works on railway except I can't access the API on public domain
Ya I'm using fastapi
Yup
send your dockerfile?
This is what I get when I hard code to 8000, it runs the code but not accessible on public domain
may I ask what you are using chrome for?
it's for simulating user visits to our site
was debugging something sorry
it not the ideal solution, hard code the port to 8000 and then set a PORT service variable to 8000
Got it, thanks!
let me know if that works
That worked! Thank you
no problem!