Docker container cannot start due to Address not available when restart Docker daemon

  cassandra, cassandra-3.0, docker, zipkin

The Cassandra was created with this compose

version: '2.4'

    services:
      storage:
        image: ghcr.io/openzipkin/zipkin-cassandra:${TAG:-latest}
        container_name: cassandra
        volumes:
           - ./zipkin/volumes:/var/lib/cassandra
        ports:
          # Expose port for testing
           - 9004:9042
        restart: always
      
      zipkin:
        container_name: zipkin
        image: ghcr.io/openzipkin/zipkin:${TAG:-latest}
        environment:
          - STORAGE_TYPE=cassandra3
          - CASSANDRA_ENSURE_SCHEMA=false
          - CASSANDRA_CONTACT_POINTS=cassandra
          - CASSANDRA_USERNAME=${cassandra_username}
          - CASSANDRA_PASSWORD=${cassandra_password}
          - QUERY_LOG_LEVEL=DEBUG
          # Self tracing exists to help troubleshoot performance of the zipkin-server
          - SELF_TRACING_ENABLED=true
          # Production deployments who enable self-tracing should lower the sample rate from 1.0 (100%) 
          # to a much smaller rate, like 0.001
          - SELF_TRACING_SAMPLE_RATE=0.001
        ports:
          - 9411:9411
        command: --logging.level.com.datastax.oss.driver.internal.core.tracker.RequestLogger=TRACE
        depends_on:
          - storage 
            # restart: unless-stopped
        restart: always
    
      dependencies:
        extends:
          file: docker-compose-dependencies.yml
          service: dependencies 
        environment:
          - STORAGE_TYPE=${STORAGE_TYPE:-cassandra3}
          - CASSANDRA_CONTACT_POINTS=cassandra
        depends_on:
          - storage
        restart: always

It was running fine until restarting Docker daemon

[2021-04-28 04:26:08,807] ERROR Exception encountered during startup
(org.apache.cassandra.service.CassandraDaemon)
java.lang.RuntimeException: java.net.BindException: Address not
available at
org.apache.cassandra.net.MessagingService.getServerSockets(MessagingService.java:742)
at
org.apache.cassandra.net.MessagingService.listen(MessagingService.java:681)
at
org.apache.cassandra.net.MessagingService.listen(MessagingService.java:665)
at
org.apache.cassandra.service.StorageService.prepareToJoin(StorageService.java:831)
at
org.apache.cassandra.service.StorageService.initServer(StorageService.java:717)
at
org.apache.cassandra.service.StorageService.initServer(StorageService.java:666)
at
org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:395)
at
org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:633)
at
org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:786)
Caused by: java.net.BindException: Address not available

other containers under this host are running perfectly after the restart.
I was able to make it work by update compose (changing restart policy) then the container came back but again, crash after restart.

Source: Docker Questions

LEAVE A COMMENT