{"record":{"id":"cfb4425f2806b1bb","repo":"weaviate/weaviate","slug":"open-raft-store-w","errorCode":null,"errorMessage":"open raft store: %w","messagePattern":"open raft store: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"cluster/service.go","lineNumber":231,"sourceCode":"\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}, c.logger)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n\n// Open internal RPC service to handle node communication,\n// bootstrap the Raft node, and restore the database state\nfunc (c *Service) Open(ctx context.Context, db schema.Indexer) error {\n\tc.logger.WithField(\"servers\", c.config.NodeNameToPortMap).Info(\"open cluster service\")\n\tif err := c.rpcServer.Open(); err != nil {\n\t\treturn fmt.Errorf(\"start rpc service: %w\", err)\n\t}\n\n\tif err := c.Raft.Open(ctx, db); err != nil {\n\t\treturn fmt.Errorf(\"open raft store: %w\", err)\n\t}\n\n\thasState, err := raft.HasExistingState(c.Raft.store.logCache, c.Raft.store.logStore, c.Raft.store.snapshotStore)\n\tif err != nil {\n\t\treturn err\n\t}\n\tc.log.WithField(\"hasState\", hasState).Info(\"raft init\")\n\n\t// If we have a state in raft, we only want to re-join the nodes in raft_join list to ensure that we update the\n\t// configuration with our current ip.\n\t// If we have no state, we want to do the bootstrap procedure where we will try to join a cluster or notify other\n\t// peers that we are ready to form a new cluster.\n\tbootstrapCtx, bCancel := context.WithTimeout(ctx, c.config.BootstrapTimeout)\n\tdefer bCancel()\n\tif hasState {\n\t\tjoiner := bootstrap.NewJoiner(c.rpcClient, c.config.NodeID, c.raftAddr, c.config.Voter)\n\t\terr = backoff.Retry(func() error {\n\t\t\tjoinNodes := bootstrap.ResolveRemoteNodes(c.config.NodeSelector, c.config.NodeNameToPortMap)","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/cluster/service.go#L213-L249","documentation":"Weaviate's cluster service startup wraps any failure to open the RAFT log/snapshot store (cluster/service.go Open). RAFT keeps persistent state in the configured RAFT data dir; if opening that store fails the whole node refuses to start so it never serves with inconsistent cluster state.","triggerScenarios":"c.Raft.Open(ctx, db) fails: RAFT work dir missing/unwritable, corrupted bolt store or snapshot files, stale lock from another process, or inner 'initialize raft store' errors (mkdir/bolt/log-cache/snapshot/transport).","commonSituations":"Running two weaviate processes against the same RAFT_HOME dir; disk full or permissions changed on the data volume; corrupted raft.db after unclean shutdown; Kubernetes pod mounting a read-only volume.","solutions":["Check RAFT_HOME / work dir exists, is writable, and only one weaviate process uses it","Fix disk space / permissions on the data volume","If state is disposable or cluster is being rebuilt, stop all nodes, clear the RAFT dir, and re-bootstrap with RAFT_JOIN=true","Enable one-node recovery (RAFT_FORCE_ONE_NODE_RECOVERY) for single-node clusters with stale state","Inspect inner wrapped message for the precise failing store component (bolt db, snapshot store, etc.)"],"exampleFix":"// before\nservices := cluster.New(...)\nif err := services.Open(ctx, db); err != nil { log.Fatal(err) }\n// after\n// ensure RAFT_HOME dir exists and is writable before starting:\nif err := os.MkdirAll(raftHome, 0o755); err != nil { log.Fatal(err) }\nif err := services.Open(ctx, db); err != nil { log.Fatalf(\"open cluster: %v\", err) }","handlingStrategy":"try-catch","validationCode":"// pre-start check (shell)\ntest -w \"$RAFT_HOME\" && ! pgrep -f 'weaviate.*' >/dev/null || echo 'dir unwritable or another weaviate running'","typeGuard":null,"tryCatchPattern":"if err := clusterService.Open(ctx, db); err != nil {\n    var perr *fs.PathError\n    if errors.As(err, &perr) { /* fix dir perms/path per perr */ }\n    log.Fatalf(\"cluster open failed: %v\", err)\n}","preventionTips":["Provision a dedicated writable volume for RAFT_HOME","Run a single weaviate process per data dir","Monitor disk space and inode usage","Pin and review RAFT env vars in deployment manifests"],"tags":["raft","startup","storage"],"backgroundTag":"raft-store-open-failed","analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}