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

2 years ago

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
import discordModules.auth as auth
File "/app/discordModules/auth.py", line 1, in
import asyncio, clientCommands
File "/app/clientCommands.py", line 1, in
import clientModules.events.onmessage File "/app/clientModules/events/onmessage.py", line 5, in
from database import connection as db
File "/app/database/connection.py", line 19, in
conn = psycopg2.connect(
^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.11/site-packages/psycopg2/init.py", line 122, in connect
conn = connect(dsn, connectionfactory=connection_factory, **kwasync)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
psycopg2.OperationalError: could not translate host name "postgres.railway.internal" to address: Name or service not known

23 Replies

zeushay
PROOP

2 years ago

e8ff4539-1a96-47e7-9a34-64bcaf87d9b1


2 years ago

is the database in the same project as the bot?


zeushay
PROOP

2 years ago

Yes


zeushay
PROOP

2 years ago

it is


zeushay
PROOP

2 years ago

1274213149935145000


zeushay
PROOP

2 years ago

<:cat_happy:937946141717315634>


2 years ago

make sure you are on the v2 runtime


zeushay
PROOP

2 years ago

how can i do it


2 years ago

in the service settings


zeushay
PROOP

2 years ago

here?

1274213643118055400


2 years ago

of the bot service


zeushay
PROOP

2 years ago

What this means


zeushay
PROOP

2 years ago

runtime v2


2 years ago

please see this docs page -


zeushay
PROOP

2 years ago

When did that change? I guess that's why I was paying so much for my bills


zeushay
PROOP

2 years ago

💀


2 years ago

the runtime wouldnt have anything to do with billing


zeushay
PROOP

2 years 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?


2 years ago

correct, you are using the internal host and port so you are good


zeushay
PROOP

2 years 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


zeushay
PROOP

2 years ago

🤡


2 years ago

im not sure i follow


zeushay
PROOP

2 years ago

<:thinkies:1170163532973756518>


Loading...