Temporal worker exits | Unable to load configuration: config file corrupted: Persistence.DataStores[default](value).Cassandra.Hosts: zero value

Hi.
I am using postgres, not cassandra. The temporal_server container of my docker compose loads successfully. All services load successfully with the exception of temporal worker. I exec into temporal_server container and there is indeed config/docker.yaml file that looks fine, and specifies “postgres” plugin name under visibility:sql. Nowhere in my setup cassandra is mentioned. Here is my docker-compose.yml file. Thank you

version: '3.8'
services:
  postgres:
    container_name: tempo_db
    image: postgres:13
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: tempodb
    healthcheck:
      test: pg_isready -U postgres
      interval: 15s
      timeout: 5s
      retries: 5
    ports:
      - "5432:5432"
    volumes:
      - postgres_data:/var/lib/postgresql/data

  backend:
    container_name: tempo_backend
    build: ./backend
    command: uvicorn app.main:app --host 0.0.0.0 --reload
    environment:
      - DATABASE_URL=postgresql://postgres:postgres@postgres:5432/tempodb
    ports:
      - "8000:8000"
    depends_on:
      - postgres

  frontend:
    container_name: tempo_frontend 
    build: ./frontend
    ports:
      - "3000:3000"
    volumes:
      - ./frontend/src:/app/src
    depends_on:
      - backend

  temporal:
    command: schema-upgrade autosetup
    container_name: temporal_server
    depends_on:
      postgres:
        condition: service_healthy
    image: temporalio/auto-setup:1.21.5
    environment:
      DB: "postgres"
      DB_PORT: "5432"
      POSTGRES_USER: "postgres"
      POSTGRES_PWD: "postgres"
      POSTGRES_SEEDS: "postgres"
    ports:
      - "7233:7233"

  worker:
    container_name: tempo_worker
    image: temporalio/auto-setup:1.21.5
    command: python ./backend/app/workers/worker.py
    environment:
      - DATABASE_URL=postgresql://postgres:postgres@postgres:5432/tempodb
      - TEMPORAL_TASK_QUEUE=csv-process
      - TEMPORAL_NAMESPACE=test
      - TEMPORAL_ADDRESS=temporal:7233
    depends_on:
      - temporal

volumes:
  postgres_data:

The culprit was the image for worker service.

I used the same image for temporal service (correct) and the worker (incorrect). The worker needed its own image, in this case an image created from a simple Dockerfile so that python worker script can run.

Hi @smkin

I am also running into this same issue. But I can’t override the default docker.yaml. Kindly provide some insights. I will share my configuration.

I am running my postgres in local. I am trying to connect my docker’s temporal image with m local DB. I have placed my configuration file in the same project path “./development.yaml”

development.yaml

persistence:
  numHistoryShards: 5
  dynamicConfigClient: /etc/temporal/config/config.yaml
  defaultStore: default
  visibilityStore: visibility
  datastores:
    default:
      sql:
        pluginName: "postgres"
        databaseName: "temporal"
        connectAddr: "localhost:5432"
        connectProtocol: "tcp"
        user: "postgres"
        password: ""
    visibility:
      sql:
        pluginName: "postgres"
        databaseName: "temporal_visibility"
        connectAddr: "localhost:5432"
        connectProtocol: "tcp"
        user: "postgres"
        password: ""

global:
  membership:
    maxJoinDuration: 30s
    broadcastAddress: "127.0.0.1"
  frontend:
    rpc:
      address: "127.0.0.1:7233"
  services:
    history:
      rpc:
        grpcPort: 7234
    matching:
      rpc:
        grpcPort: 7235
    worker:
      rpc:
        grpcPort: 7236

docker.compose.yml

version: '3.8'

services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    environment:
      - DB_HOST=host.docker.internal
      - DB_USER=${DB_USER}
      - DB_PASSWORD=${DB_PASSWORD}
      - DB_NAME=${DB_NAME}
      - DB_PORT=${DB_PORT}
    ports:
      - '5000:5000'
    #entrypoint: ["sh", "/usr/src/app/db-init.sh"]
  
  temporal:
    image: temporalio/server:latest
    container_name: temporal
    volumes:
      - ./development.yaml:/etc/temporal/config/config.yaml
    ports:
      - "7233:7233"
    environment:
      - TEMPORAL_CLI_ADDRESS=127.0.0.1:7233
      - DYNAMIC_CONFIG_FILE_PATH=/etc/temporal/config/config.yaml
    

Finally it says this:

temporal  | TEMPORAL_ADDRESS is not set, setting it to 192.168.176.3:7233
temporal  | 2024/07/01 13:06:26 Loading config; env=docker,zone=,configDir=config
temporal  | 2024/07/01 13:06:26 Loading config files=[config/docker.yaml]
temporal  | Unable to load configuration: config file corrupted: Persistence.DataStores[default](value).Cassandra.Hosts: zero value.

I need some help on this.