I get "Error: Data source DNS is empty. It's a required field." when I try deploying a docker container

I’m trying to deploy a docker container using render. But I get the error message;
“Error: Data source DNS is empty. It’s a required field.” as shown below

I also get the same error when deploying to Playing with Docker in which I’m using docker compose up

Though, I’m able to successfully run this docker container locally on my laptop, but in order for me to scale my testing I need to host this on the cloud.

Here is my docker-compose.yaml file;

version: "3.8"

services:
  server:
    image: ${BLNK_IMAGE:-jerryenebeli/blnk:0.8.0}
    container_name: server
    restart: on-failure
    entrypoint: ["/bin/sh", "-c"]
    command:
      - "blnk migrate up && blnk start"
    environment:
      TZ: ${TZ:-Etc/UTC}
      OTEL_EXPORTER_OTLP_ENDPOINT: http://jaeger:4318
    ports:
      - "5001:5001"
      - "80:80"
      - "443:443"
    depends_on:
      - redis
      - postgres
      - jaeger
    volumes:
      - ./blnk.json:/blnk.json

  worker:
    image: ${BLNK_IMAGE:-jerryenebeli/blnk:0.8.0}
    container_name: worker
    restart: on-failure
    entrypoint: ["blnk", "workers"]
    environment:
      OTEL_EXPORTER_OTLP_ENDPOINT: http://jaeger:4318
    depends_on:
      - redis
      - postgres
      - jaeger
    volumes:
      - ./blnk.json
      

  redis:
    image: redis:7.2.4
    container_name: redis

  postgres:
    image: ${POSTGRES_IMAGE:-postgres:16}
    container_name: ${POSTGRES_CONTAINER:-postgres}
    restart: on-failure
    ports:
      - "${POSTGRES_OUTER_PORT:-5432}:5432"
    environment:
      TZ: ${TZ:-Etc/UTC}
      POSTGRES_USER: ${POSTGRES_USER:-postgres}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
      POSTGRES_DB: ${POSTGRES_DB:-blnk}
    volumes:
      - pg_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD", "pg_isready", "-U", "${POSTGRES_USER:-postgres}"]
      interval: 10s
      timeout: 5s
      retries: 5

  typesense:
    image: typesense/typesense:0.23.1
    container_name: typesense
    command:
      ["--data-dir", "/data", "--api-key=blnk-api-key", "--listen-port", "8108"]
    volumes:
      - typesense_data:/data
    logging:
      driver: "none"
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8108/health"]
      interval: 30s
      timeout: 10s
      retries: 5

  jaeger:
    image: jaegertracing/all-in-one:latest
    container_name: jaeger
    ports:
      - "16686:16686" # Jaeger UI
      - "4317:4317" # OTLP gRPC
      - "4318:4318" # OTLP HTTP
    environment:
      - COLLECTOR_OTLP_ENABLED=true
    healthcheck:
      test: ["CMD", "wget", "--spider", "http://localhost:16686"]
      interval: 10s
      timeout: 5s
      retries: 3

volumes:
  pg_data:
  typesense_data:

Here is the blnk.json file that’s being used;

{
    "project_name": "Blnk",
    "data_source": {
      "dns": "postgres://postgres:password@postgres:5432/blnk?sslmode=disable"
    },
    "redis": {
      "dns": "redis:6379"

    },
    "server": {
      "port": "5001"
    }
  }

I’m new to docker, so please help me with this error. Why am I getting the error “Data source DNS is empty. It’s a required field.” when deploying on the cloud.

Please help.

Usually you would start locally, then move it to an external provider. Usually you would reduce services (remove temporarily) to narrow the source down.

Note that both values are not “DNS”, this seems wrong:

  "dns": "postgres://postgres:password@postgres:5432/blnk?sslmode=disable"

  "dns": "redis:6379"

I assume the config file is not available in the cloud and you mount something else. Check the files inside the container. If you find the same files in the container running in the cloud and on your local machine, then it could be diffetent versions running in the cloud in the container een if the tags are the same or some kernel or hardware dependencies of the software which makes it work diffeerently in a different environment. In that case you would need to ask the maintainr of that software.

One thing I notice:

I’m not sure what your goal is with this, but it would not work anywhere. Not just in the cloud, but anywhere else as this is just defining an anonymous volume without a source path on the host. I’m not even sure it should be accepted by Docker without error message, but if it is accepted, it will just create an empty folder inside the container. It will not mount anything useful.

I was able to successfully run this container locally on my PC. My laptop resource limitation thus my need to host this on the cloud.

I have changed the values from “dns” to “DNS”;

"DNS": "postgres://postgres:password@postgres:5432/blnk?sslmode=disable"

"DNS": "redis:6379"

But I still get he same error. @bluepuma77 please tell me what’s the correct way of naming the DNS?

Since it is not a Docker configuration, @bluepuma77 most likely just assumed a DNS config would require actual DNS name, but as the documentation says

dns: Specifies the DNS or connection string to the database. It includes details such as the username, password, host, port, and database name. In this config file, it connects to a PostgreSQL database named “blnk” with SSL mode disabled.

DNS is indeed a quite misleading parameter name here.

You can ask about Docker, but you will need to be familiar with software specific terms and configuration so you can share the info with the helpers here.

If you could share docker commands instead of screenshots, that could also help. We can’t see which service throws the error message and as I mentioned in my previous post, you have a wrong volume definition.

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