Librechat from template RailWay, not connect to Bases on MongoDB
invasta
PROOP

10 months ago

librechat is deployed from the Railway template , which includes LibreChat and 4 products. There are no issues with 4 products. When accessing MongoDB - Deployment - no errors - Data Mongo Data UI A custom interface into your database OK - Deployment Online This service has an active deployment OK - Required Variables This service has all the necessary variables that this UI uses to connect to the database. NOT - Database Connection Database not connected MONGO_URL is formed like this. MONGO_URL="mongodb://${{MONGO_INITDB_ROOT_USERNAME}}:${{MONGO_INITDB_ROOT_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:27017" as a result, there is no connection to the database and there is no way to view logs of user requests. Please help me figure out the variables and the correct connection. All the parameters are specified during the default build and I can't figure out what needs to be fixed. Thank you.

$10 Bounty

5 Replies

Railway
BOT

10 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


clashing
FREE

10 months ago

I am sure that you might be making some mistakes in formulating the desired URL for the MongoDB service. For your reference, you have to specify the MONGO_URL in the variables section of the service, and there is no need for the double quotes, so that you can use process.env.MONGO_URL in the server file/code to connect with the service.

Just for demo purposes, I used other railway variables, but you can use MongoDB-related ones, without the quotes! I hope that would work. You can print out (console logging) the related environment variable in the server file, so you can check its value at runtime (inside the deploy logs)


clashing

I am sure that you might be making some mistakes in formulating the desired URL for the MongoDB service. For your reference, you have to specify the MONGO\_URL in the variables section of the service, and there is no need for the double quotes, so that you can use **process.env.MONGO\_URL** in the server file/code to connect with the service. ![](https://station-server.railway.com/attachments/att_01k0ymfe67eh19nq4x1fk5f7nw) Just for demo purposes, I used other railway variables, but you can use MongoDB-related ones, without the quotes! I hope that would work. You can print out (console logging) the related environment variable in the server file, so you can check its value at runtime (inside the deploy logs)

clashing
FREE

10 months ago

Any progress using the method I provided, invasta?


clashing
FREE

10 months ago

Any update, invasta!


percyalonsos24-code
FREE

5 months ago

no se conecta a postgress base de datos


Welcome!

Sign in to your Railway account to join the conversation.

Loading...