3 months ago
I'm deploying a Django application with PostGIS on Railway, but consistently encounter connection timeouts when trying to connect my Django service to the PostGIS database. The services appear properly linked in the dashboard, and all required variables (PGHOST
, PGPORT
, DATABASE_URL
, etc.) are set. However, both public (crossover.proxy.rlwy.net
) and private (postgis.railway.internal
) connections fail with timeout errors.
(crowdmap) C:\Users\AROGO\django_projects\Church_Attendance\HealthMapper>railway run psql "$DATABASE_URL" -c "\conninfo"
←[1;32mNew version available:←[0m v←[33m4.3.0←[0m visit ←[35mhttps://docs.railway.com/guides/cli←[0m for more info
psql: error: connection to server at "crossover.proxy.rlwy.net" (64:ff9b::23d6:abeb), port 5432 failed: Connection timed out (0x0000274C/10060)
Is the server running on that host and accepting TCP/IP connections?
connection to server at "crossover.proxy.rlwy.net" (35.214.171.235), port 5432 failed: Connection timed out (0x0000274C/10060)
Is the server running on that host and accepting TCP/IP connections?
3 Replies
3 months ago
Hello,
You would want to be using the host postgis.railway.internal
and the port 5432
.
Please make sure you are using that exact combo.
Best,
Brody
Status changed to Awaiting User Response Railway • 3 months ago
3 months ago
I have my database in supabase, and I was trying to connect my web app to it, but seemingly, the web service doesn't rreach the host name of my supabase database, here is the error i get:
File "/usr/local/lib/python3.9/site-packages/django/contrib/gis/db/backends/postgis/base.py", line 101, in prepare_database
with self.cursor() as cursor:
File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 330, in cursor
return self._cursor()
File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 306, in _cursor
self.ensure_connection()
File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 289, in ensure_connection
self.connect()
File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 91, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 289, in ensure_connection
self.connect()
File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/base.py", line 270, in connect
self.connection = self.get_new_connection(conn_params)
File "/usr/local/lib/python3.9/site-packages/django/contrib/gis/db/backends/postgis/base.py", line 112, in get_new_connection
connection = super().get_new_connection(conn_params)
File "/usr/local/lib/python3.9/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/django/db/backends/postgresql/base.py", line 275, in get_new_connection
connection = self.Database.connect(**conn_params)
File "/usr/local/lib/python3.9/site-packages/psycopg2/__init__.py", line 122, in connect
conn = connect(dsn, connectionfactory=connection_factory, **kwasync)
django.db.utils.OperationalError: connection to server at "db.tpiagcexddntgxplotbt.supabase.co" (2406:da1a:6b0:f601:beda:85e0:171b:8efd), port 5432 failed: Network is unreachable
Is the server running on that host and accepting TCP/IP connections?
Status changed to Awaiting Railway Response Railway • 3 months ago
3 months ago
You need to use a supabase domain that has support for IPv4 as we do not offer public outbound support for IPv6 networking.
Status changed to Awaiting User Response Railway • 3 months ago