R
Railway4mo ago
Zeus

Guys, when i upload a bot using database of railway, i need to put private database address, sure?

But i'm having a stupid crash (when i commit my bot to railway): Traceback (most recent call last): File "/app/main.py", line 2, in <module> import discordModules.auth as auth File "/app/discordModules/auth.py", line 1, in <module> import asyncio, clientCommands File "/app/clientCommands.py", line 1, in <module> import clientModules.events.on_message File "/app/clientModules/events/on_message.py", line 5, in <module> from database import connection as db File "/app/database/connection.py", line 19, in <module> conn = psycopg2.connect( ^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.11/site-packages/psycopg2/init.py", line 122, in connect conn = _connect(dsn, connection_factory=connection_factory, **kwasync) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ psycopg2.OperationalError: could not translate host name "postgres.railway.internal" to address: Name or service not known
20 Replies
Percy
Percy4mo ago
Project ID: e8ff4539-1a96-47e7-9a34-64bcaf87d9b1
Zeus
ZeusOP4mo ago
e8ff4539-1a96-47e7-9a34-64bcaf87d9b1
Brody
Brody4mo ago
is the database in the same project as the bot?
Zeus
ZeusOP4mo ago
Yes it is
Zeus
ZeusOP4mo ago
No description
Zeus
ZeusOP4mo ago
:cat_happy:
Brody
Brody4mo ago
make sure you are on the v2 runtime
Zeus
ZeusOP4mo ago
how can i do it
Brody
Brody4mo ago
in the service settings
Zeus
ZeusOP4mo ago
here?
No description
Brody
Brody4mo ago
of the bot service
Zeus
ZeusOP4mo ago
What this means runtime v2
Brody
Brody4mo ago
please see this docs page - https://docs.railway.app/reference/runtime
Zeus
ZeusOP4mo ago
When did that change? I guess that's why I was paying so much for my bills 💀
Brody
Brody4mo ago
the runtime wouldnt have anything to do with billing
Zeus
ZeusOP4mo ago
Isn't using the “Internal” version the right thing to do? Isn't the public one that if a lot of people use it, it costs a lot?
Brody
Brody4mo ago
correct, you are using the internal host and port so you are good
Zeus
ZeusOP4mo ago
I made a statement in try to automatically connect to the internal, and if it couldn't, to use the standard connection, and as railway simply put it as “v2”, all my clients were accessing the public version, instead of the internal one 🤡
Brody
Brody4mo ago
im not sure i follow
Zeus
ZeusOP4mo ago
:thinkies:
Want results from more Discord servers?
Add your server