Docker Compose Example Fails

Hi Weaviate Team,

The Docker Compose example here fails for a single-node development instance.

    weaviate:
        image: semitechnologies/weaviate:latest
        networks:
            - sail
        ports:
            - '8080:8080'
            - '50051:50051'
            - '8300:8300'
        restart: on-failure
        volumes:
            - 'sail-weaviate:/var/lib/weaviate'
        environment:
            QUERY_DEFAULTS_LIMIT: 25
            AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
            PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
            ENABLE_API_BASED_MODULES: 'true'
            CLUSTER_HOSTNAME: 'node1'
            DEFAULT_VECTORIZER_MODULE: 'text2vec-cohere'
            ENABLE_MODULES: 'text2vec-cohere'

In the logs:

{"build_git_commit":"be13581","build_go_version":"go1.22.9","build_image_tag":"1.26.10","build_wv_version":"1.26.10","level":"info","msg":"attempted to join and failed","remoteNode":"172.18.0.4:8300","status":8,"time":"2024-11-22T17:38:13Z"}

Any calls to the API fail with: {"error":[{"message":"leader not found"}]}

How might this be fixed so that I can run a single node cluster for development on 1.27.5?

Thanks!

Update: I tried to bring up a 3-node cluster in Docker Compose. The first node still fails stating the leader isn’t found when it has the two other nodes joined to it.

Why would it not default to be a leader, and why is this not documented accordingly?

hi @aaronfs !!

You docker compose looks different from the one I get in the docs.

Here is the original one:

---
services:
  weaviate:
    command:
    - --host
    - 0.0.0.0
    - --port
    - '8080'
    - --scheme
    - http
    image: cr.weaviate.io/semitechnologies/weaviate:1.27.5
    ports:
    - 8080:8080
    - 50051:50051
    volumes:
    - weaviate_data:/var/lib/weaviate
    restart: on-failure:0
    environment:
      QUERY_DEFAULTS_LIMIT: 25
      AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
      PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
      DEFAULT_VECTORIZER_MODULE: 'none'
      ENABLE_API_BASED_MODULES: 'true'
      CLUSTER_HOSTNAME: 'node1'
volumes:
  weaviate_data:
...

Can you try with this original one?

Also, can you paste the entire error stack trace?

Thanks!

Are you able to spin up a 1.27.5 single-node cluster and create schema, insert objects, etc., with what you posted above? I am just fine on 1.24.26. It’s after the introduction of Raft in 1.25 that I see this problem. Which is a breaking change across what I believe to be a SemVer minor version.

The problem I see is intrinsic to Weaviate’s Raft implementation in failing to elect a leader in a single-node cluster, not the Docker Compose or the environment variables thereof. (I.e., why would Weaviate not default to a single-node configuration in a Getting Started guide intended for development?)

hi! Yes! I am able to spin the cluster and use it as expected with the docker compose I pasted from our docs.

can you share the full error logs?

Also, have you tried upgrading to latest 1.27.5?