Compose project not starting up after a shutdown

Here is the Docker Compose file I used.

networks:
  yugabyte:
    external: false

services:
  yugabyte:
    image: yugabytedb/yugabyte:latest
    container_name: yugabyte
    command: >
      bin/yugabyted start --base_dir=/home/yugabyte/yb_data --background=false
    ports:
      - "7025:7000"
      - "9025:9000"
      - "15433:15433"
      - "5433:5433"
      - "9042:9042"
    volumes:
      - ./ybdata:/home/yugabyte/yb_data
    restart: unless-stopped
    tty: true
    networks:
      - yugabyte

It starts up fine, I’m able to restart multiple times. I can see data, log & conf files created in the host directory ./ybdata as well. But if I use docker-compose down and try get it up again, it starts hitting errors and goes into a restart loop with this error.

2025-05-21 15:42:25


Traceback (most recent call last):
2025-05-21 15:42:25


  File "bin/yugabyted", line 11055, in <module>
2025-05-21 15:42:25


    ControlScript().run()
2025-05-21 15:42:25


  File "bin/yugabyted", line 8774, in run
2025-05-21 15:42:25


    self.validate_and_set_configs(args)
2025-05-21 15:42:25


  File "bin/yugabyted", line 8072, in validate_and_set_configs
2025-05-21 15:42:25


    self.configs.temp_data["ui_port_available"] = self.is_port_available(
2025-05-21 15:42:25


  File "bin/yugabyted", line 3053, in is_port_available
2025-05-21 15:42:25


    return s.connect_ex((advertise_ip, int(port))) != 0
2025-05-21 15:42:25


socket.gaierror: [Errno -2] Name or service not known

I notice that if I stop setting --base-dir, then it works fine across restarts and tearing down the Docker container as well.

Solved using advertise_address of 0.0.0.0 in line with What's new in the YugabyteDB v2.20 LTS release series | YugabyteDB Docs

Updated command

bin/yugabyted start --base_dir=/home/yugabyte/yb_data --background=false --advertise_address=0.0.0.0
1 Like