{"record":{"id":"8e0cbf61ef4b5c8a","repo":"juicedata/juicefs","slug":"expected-key-test-but-got-s","errorCode":null,"errorMessage":"expected key 'test' but got %s","messagePattern":"expected key 'test' but got (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/objbench.go","lineNumber":852,"sourceCode":"\t\t}\n\t\t// get the off out of range\n\t\tif d, e := get(blob, key, 6, 2); e != nil || d != \"\" {\n\t\t\treturn warning(fmt.Errorf(`failed to get object with the offset out of range, expect \"\", but got %q, error: %s`, d, e))\n\t\t}\n\t\treturn nil\n\t})\n\n\trunCase(\"head an object\", func(blob object.ObjectStorage) error {\n\t\tbr := []byte(\"hello\")\n\t\tif err := blob.Put(ctx, key, bytes.NewReader(br)); err != nil {\n\t\t\treturn fmt.Errorf(\"put object failed: %s\", err)\n\t\t}\n\t\tdefer blob.Delete(ctx, key) //nolint:errcheck\n\t\tif h, err := blob.Head(ctx, key); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to head object %s\", err)\n\t\t} else {\n\t\t\tif h.Key() != key {\n\t\t\t\treturn fmt.Errorf(\"expected key 'test' but got %s\", h.Key())\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t})\n\n\trunCase(\"delete an object\", func(blob object.ObjectStorage) error {\n\t\tbr := []byte(\"hello\")\n\t\tif err := blob.Put(ctx, key, bytes.NewReader(br)); err != nil {\n\t\t\treturn fmt.Errorf(\"put object failed: %s\", err)\n\t\t}\n\t\tif err := blob.Delete(ctx, key); err != nil {\n\t\t\treturn fmt.Errorf(\"delete failed: %s\", err)\n\t\t}\n\t\tif _, err := blob.Head(ctx, key); err == nil {\n\t\t\treturn fmt.Errorf(\"expect err is not nil\")\n\t\t}\n\n\t\tif err := blob.Delete(ctx, key); err != nil {","sourceCodeStart":834,"sourceCodeEnd":870,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/cmd/objbench.go#L834-L870","documentation":"Signals a mismatch during an objbench object-storage correctness check: after performing a storage operation (e.g. get/head/list around key 'test'), the value returned by the backend does not equal the expected key 'test'. It fires when the object storage under test returns an unexpected key or body, indicating non-conforming behavior of that backend rather than a JuiceFS bug.","triggerScenarios":"Thrown at cmd/objbench.go:852 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the object storage backend implements the expected operation (get/head/list) correctly and returns data for the exact key that was written","Run juicefs objench against a known-good backend (e.g. MinIO) to confirm the test setup is correct","Check whether the key was overwritten or deleted by a concurrent process during the bench run","Upgrade to the latest JuiceFS version in case a backend-specific fix already exists","Report the failing case with backend name/version to the JuiceFS maintainers if the backend is genuinely non-conforming"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}