Unable to use internal PostgreSQL hostname (external works fine)

Hi all,

I am attempting to deploy a Spring Boot application via a Blueprint. The app requires a connection to a database. This works fine on local. But if I define a Blueprint with the database and web service, the deployment fails with:

Caused by: java.net.UnknownHostException: <internal url>

Curiously, if I manually update the hostname to the external one, the service is able to connect. This would be fine, but it does not seem that RENDER_EXTERNAL_HOSTNAME is available for databases.

Any guidance on how to resolve/workaround this issue is greatly appreciated.


My render.yaml looks a bit like this:

  - type: web
    name: my-app
    env: docker
      - key: DATABASE_HOST
          name: db
          property: host
      - key: DATABASE_SCHEMA
          name: db
          property: database
      - key: DATABASE_USER
          name: db
          property: user
          name: db
          property: password

  - name: db

application.yml like this:

    url: jdbc:postgresql://${DATABASE_HOST:localhost}:5432/${DATABASE_SCHEMA:postgres}
    username: ${DATABASE_USERNAME:postgres}
    password: ${DATABASE_PASSWORD:postgres}
    driver-class-name: org.postgresql.Driver

And Dockerfile for the service looks like this:

FROM maven:3.8.6-eclipse-temurin-19-alpine AS maven
WORKDIR /usr/src/app
COPY . /usr/src/app
RUN mvn package -Dmaven.test.skip

FROM eclipse-temurin:19-jdk-alpine
ARG JAR_FILE=my-app.jar
WORKDIR /opt/app
COPY --from=maven /usr/src/app/target/*.jar /opt/app/${JAR_FILE}
ENTRYPOINT ["java","-jar","my-app.jar"]

Hi there,

An internal database URL not working usually points to the services being in different regions. To use the internal/private network the services need to be in the same team/account and region.

Although it’s hard to diagnose when all the real information has been redacted, if you still require assistance, please feel free to raise a ticket from the “Contact Support” link at the bottom of the Dashboard.


Different regions was indeed the problem. I had my web service set to the ohio region but neglected to add one to the database, which defaulted to oregon.

I can see this in the official documentation. Wish I had seen that before.

Anywho, thank you for the help!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.