{"record":{"id":"568d8f2513587a11","repo":"weaviate/weaviate","slug":"update-bucket-q-w","errorCode":null,"errorMessage":"update bucket %q: %w","messagePattern":"update bucket %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"adapters/repos/schema/store.go","lineNumber":417,"sourceCode":"\t\t\t\t}\n\t\t\t}\n\t\t\tcls, _ = rootCursor.Next()\n\t\t}\n\t\tfor _, cls := range ss.ObjectSchema.Classes {\n\t\t\tif err := ctx.Err(); err != nil {\n\t\t\t\treturn fmt.Errorf(\"context for class %q: %w\", cls.Class, err)\n\t\t\t}\n\t\t\tsharding := ss.ShardingState[cls.Class]\n\t\t\tpayload, err := createClassPayload(cls, sharding)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"create payload for class %q: %w\", cls.Class, err)\n\t\t\t}\n\t\t\tb, err := root.CreateBucket(encodeClassName(cls.Class))\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"create bucket for class %q: %w\", cls.Class, err)\n\t\t\t}\n\t\t\tif err := r.updateClass(b, payload); err != nil {\n\t\t\t\treturn fmt.Errorf(\"update bucket %q: %w\", cls.Class, err)\n\t\t\t}\n\t\t\tr.log.WithField(\"action\", \"update_schema_store\").\n\t\t\t\tDebugf(\"Class updated: %s\", cls.Class)\n\t\t}\n\n\t\tr.log.WithField(\"action\", \"update_schema_store\").\n\t\t\tDebug(\"All classes updated\")\n\n\t\treturn nil\n\t}\n}\n\nfunc saveConfig(root *bolt.Bucket, cfg config) error {\n\tdata, err := json.Marshal(&cfg)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"marshal config: %w\", err)\n\t}\n\tif err := root.Put(keyConfig, data); err != nil {","sourceCodeStart":399,"sourceCodeEnd":435,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/repos/schema/store.go#L399-L435","documentation":"After the class bucket is obtained, r.updateClass(b, payload) writes the serialized payload into it. Any failure updating the bucket (BoltDB Put failure, closed DB, nested txn issues) is wrapped as \"update bucket %q\" with the class name.","triggerScenarios":"updateClass returns an error during Save's class loop — typically bolt Put failing due to I/O error, disk full, or the DB being closed concurrently.","commonSituations":"Disk pressure during schema updates; racing shutdown closing the schema DB mid-Save; extremely large schema writes exceeding fsync timeouts.","solutions":["Read the wrapped updateClass error; address the underlying bolt Put failure (disk space, permissions, closed DB).","Retry Save; BoltDB transactions are atomic so a failed save leaves the prior schema intact.","Ensure the node is not shutting down while schema updates are in flight (check lifecycle/ordering of store Close)."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := store.Save(ctx, ss)\nif err != nil && strings.Contains(err.Error(), \"update bucket\") {\n\t// bolt txns are atomic; prior schema intact — safe to retry\n\ttime.Sleep(time.Second)\n\terr = store.Save(ctx, ss)\n}","preventionTips":["Keep the schema DB open for the node's lifetime; serialize Close after in-flight saves.","Watch disk utilization and fsync latency on storage.","Batch very large schema writes and retry with backoff on transient I/O failures."],"tags":["schema","boltdb","storage"],"backgroundTag":"bucket-write-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"}