3 months ago
I have this this service deployed "embedding-service" which is not able to access through to its private networking domain embedding-service.internal.railway there are other services in the project which are accessible on their respective internal domains but only this service is not. Although its working on public domain. Can someone please guide me whats wrong with it.
Pinned Solution
3 months ago
This is the root cause of your issue.
Railway's private Networking (.railway.internal) operates on IPv6. By binding your app to 0.0.0.0, your service only listens to IPv4 traffic. While the service requests to fetch data via embedding-service.railway.internal
- Change your app's host binding from 0.0.0.0 to ::
(Use commands depending on the python ASGI/WSGI server)
- Once app is listening on :: , internal networking will connect smoothly
33 Replies
3 months ago
This thread has been opened as a public bounty so the community can help solve it. The thread and any further activity are now visible to everyone.
Status changed to Open Railway • 3 months ago
Status changed to Awaiting Railway Response Railway • 3 months ago
3 months ago
Private network domain always end with .railway.internal not .internal.railway, use reference variable to the embedded-service.RAILWAY_PRIVATE_DOMAIN so you will always the right private endpoint
mayori
Private network domain always end with `.railway.internal` not `.internal.railway`, use reference variable to the `embedded-service.RAILWAY_PRIVATE_DOMAIN` so you will always the right private endpoint
3 months ago
yes i have it correct in the code embedding-service.railway.internal typo in the ticket
2amfusion
yes i have it correct in the code embedding-service.railway.internal typo in the ticket
3 months ago
If the domain is already correct in your code, then the issue is almost certainly how you are formatting the request regarding the port and protocol.
3 months ago
Public domains automatically route traffic to your app's port and handle HTTPS. Internal domains do not. You must explicitly append the port and use http:// (since internal traffic is already encrypted but doesn't use SSL certificates).
3 months ago
If you just try to fetch embedding-service.railway.internal, it defaults to port 80 and fails. Make sure your request looks exactly like this: http://embedding-service.railway.internal:<YOUR_APP_PORT>.
marlonwq
Public domains automatically route traffic to your app's port and handle HTTPS. Internal domains do not. You must explicitly append the port and use http:// (since internal traffic is already encrypted but doesn't use SSL certificates).
3 months ago
i am simply doing python -c "import httpx; r = httpx.get('http://embedding-service.railway.internal:8000/health', timeout=5); print(r.status_code, r.text)" and its giving connection refused error
3 months ago
Can you confirm if you are still seeing an issue? There may have been a brief internal networking issue with this service.
Status changed to Awaiting User Response Railway • 3 months ago
sam-a
Can you confirm if you are still seeing an issue? There may have been a brief internal networking issue with this service.
3 months ago
still seeing error
root@488614a5a035:/app# python -c "import httpx; r = httpx.get('http://embedding-service.railway.internal:8000/health', timeout=5); print(r.status_code, r.text)"
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/httpx/_transports/default.py", line 69, in map_httpcore_exceptions
yieldFile "/usr/local/lib/python3.11/site-packages/httpx/_transports/default.py", line 233, in handle_request
resp = self._pool.handle_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/httpcore/_sync/connection_pool.py", line 256, in handle_request
raise exc from NoneFile "/usr/local/lib/python3.11/site-packages/httpcore/_sync/connection_pool.py", line 236, in handle_request
response = connection.handle_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/httpcore/_sync/connection.py", line 101, in handle_request
raise excFile "/usr/local/lib/python3.11/site-packages/httpcore/_sync/connection.py", line 78, in handle_request
stream = self._connect(request)
^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/httpcore/_sync/connection.py", line 124, in _connect
stream = self._network_backend.connect_tcp(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/httpcore/_backends/sync.py", line 207, in connect_tcp
with map_exceptions(exc_map):File "/usr/local/lib/python3.11/contextlib.py", line 158, in exit
self.gen.throw(typ, value, traceback)File "/usr/local/lib/python3.11/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exchttpcore.ConnectError: [Errno 111] Connection refused
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.11/site-packages/httpx/_api.py", line 198, in get
return request(
^^^^^^^^File "/usr/local/lib/python3.11/site-packages/httpx/_api.py", line 106, in request
return client.request(
^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 827, in request
return self.send(request, auth=auth, follow_redirects=follow_redirects)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 914, in send
response = self._send_handling_auth(
^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 942, in _send_handling_auth
response = self._send_handling_redirects(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 979, in _send_handling_redirects
response = self._send_single_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1015, in _send_single_request
response = transport.handle_request(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "/usr/local/lib/python3.11/site-packages/httpx/_transports/default.py", line 232, in handle_request
with map_httpcore_exceptions():File "/usr/local/lib/python3.11/contextlib.py", line 158, in exit
self.gen.throw(typ, value, traceback)File "/usr/local/lib/python3.11/site-packages/httpx/_transports/default.py", line 86, in map_httpcore_exceptions
raise mapped_exc(message) from exchttpx.ConnectError: [Errno 111] Connection refused
Status changed to Awaiting Railway Response Railway • 3 months ago
mayori
where are you executing it? in a project sandbox?
3 months ago
from other service console
sam-a
Can you confirm if you are still seeing an issue? There may have been a brief internal networking issue with this service.
3 months ago
any thoughts?
3 months ago
Still seeing the issue as of July 11. The service is confirmed listening on port 8000 (verified in logs and with localhost test). Public domain works perfectly. Internal DNS timeout only happens for this specific service. This is blocking production. Need escalation to Railway's engineering team.
2amfusion
Still seeing the issue as of July 11. The service is confirmed listening on port 8000 (verified in logs and with localhost test). Public domain works perfectly. Internal DNS timeout only happens for this specific service. This is blocking production. Need escalation to Railway's engineering team.
3 months ago
Since the service is confirming it's listening on port 8000, responding to localhost requests only, it might be bound to 127.0.0.1 instead of 0.0.0.0, which is preventing connections from other services on the private network.
Check your application's network configuration to ensure it's listening on all interfaces.
3 months ago
- Ensure your app is configured to listen on all interfaces by binding it to 0.0.0.0
- Verify that the request is formatted by http://, the correct internal domain (ending in .railway.internal), and the port.
3 months ago
same
h701h
1. Ensure your app is configured to listen on all interfaces by binding it to 0.0.0.0 2. Verify that the request is formatted by http://, the correct internal domain (ending in .railway.internal), and the port.
3 months ago
Did you verify the correct internal domain?
Ending in .railway.internal
3 months ago
yeah everything was verified, i typo in the the original post
3 months ago
service is running like
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
2amfusion
application startup at http://0.0.0.0:8000
3 months ago
This is the root cause of your issue.
Railway's private Networking (.railway.internal) operates on IPv6. By binding your app to 0.0.0.0, your service only listens to IPv4 traffic. While the service requests to fetch data via embedding-service.railway.internal
- Change your app's host binding from 0.0.0.0 to ::
(Use commands depending on the python ASGI/WSGI server)
- Once app is listening on :: , internal networking will connect smoothly
3 months ago
good catch let me test this
2amfusion
service is running like INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
3 months ago
So you are using uvicorn(fastApi)
Just run this command: uvicorn main:app --host :: --port 8000
3 months ago
Worked! Thank you, accepted your solution. Enjoy the bounty!
2amfusion
Worked! Thank you, accepted your solution. Enjoy the bounty!
3 months ago
Good to hear that your issue is resolved.
2amfusion
Worked! Thank you, accepted your solution. Enjoy the bounty!
3 months ago
Kindly mark the thread as solved
3 months ago
its saying "Awaiting Conductor Response"
2amfusion
its saying "Awaiting Conductor Response"
3 months ago
Yes. Sam-a is the conductor for this.
h701h
Just click on green resolve thread button if you see any
3 months ago
there is no green button to mark resolve, just had accept solution which I did on your comment
2amfusion
there is no green button to mark resolve, just had accept solution which I did on your comment
3 months ago
Do you see this button in the bottom of the chat thread?
Attachments
2amfusion
there is no green button to mark resolve, just had accept solution which I did on your comment
3 months ago
If not, Then we wait for any moderators to mark it solved.
Status changed to Solved uxuz • 3 months ago

