Wiki.js template not working
masaok
HOBBYOP

7 months ago

I created a vanilla Wiki.js project using the template.

However it looks like the Wiki.js part cannot connect to Postgres, even though it looks like both deployed successfully.

Please help!

$10 Bounty

3 Replies

Railway
BOT

7 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!


masaok
HOBBYOP

7 months ago

According to the Wiki.js deploy logs:

2025-08-13T12:18:22.462Z [MASTER] warn: Will retry in 3 seconds... [Attempt 8 of 10]

2025-08-13T12:18:25.465Z [MASTER] info: Connecting to database...

2025-08-13T12:18:25.465Z [MASTER] error: Database Connection Error: ERR_SOCKET_BAD_PORT undefined:undefined

2025-08-13T12:18:25.465Z [MASTER] warn: Will retry in 3 seconds... [Attempt 9 of 10]

2025-08-13T12:18:28.468Z [MASTER] info: Connecting to database...

2025-08-13T12:18:28.469Z [MASTER] error: Database Connection Error: ERR_SOCKET_BAD_PORT undefined:undefined

2025-08-13T12:18:28.469Z [MASTER] warn: Will retry in 3 seconds... [Attempt 10 of 10]

2025-08-13T12:18:31.470Z [MASTER] info: Connecting to database...

2025-08-13T12:18:31.472Z [MASTER] error: Database Initialization Error: Port should be >= 0 and < 65536. Received type number (NaN).


This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open mahmoud-railway 7 months ago


shxkm
PRO

7 months ago

If you deployed the template as is, it may be missing required environment variables. Evidently, the port is Nan (missing), while the app is expected a valid port number.

You're gonna want to set the required environment variables for it: DB_TYPE (postgres), DB_HOST (corresponding env var from your Postgres service variables), DB_USER (same, from Postgres variables), DB_PORT (same), and DB_PASS (same).


Loading...