N8N Fails to Retrieve Postgres IP from Environment Variable in Jelastic JPS

Deploying automation via JPS, DB_HOST remains unset because the Postgres node hasn’t launched. How can its IP be assigned later?

DB_HOST: ${db.server.ip}

I encountered a similar issue in a past project. The approach that eventually proved successful involved deferring the assignment of the DB_HOST variable until after the Postgres node was confirmed to be running. A custom post-deployment routine that actively waited for the database service to come online was the key. Although this adds another step to the process, it ensures that the environment variable isn’t set until the necessary service is operational, avoiding issues with undefined values during the initial launch.

try a trigger that reruns the env var update after the database is up. i had a similar issue and a simple polling routine on the db readiness script worked well. it restarts the service once ip becomes available, avoiding the unset var error.

I once faced a very similar problem where the dependency service was taking longer than expected to launch. My workaround was to insert an initialization script that verified the readiness of the Postgres node before updating the environment variable dynamically. Although it added an extra check in the deployment process, it guaranteed that the DB_HOST variable was correctly set only when the database service was running. This method offered a reliable way to mitigate timing issues without significantly impacting the overall device bootstrap timing.