juicedata/juicefs · error
expected key 'test' but got %s
Error message
expected key 'test' but got %s
What it means
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.
Source
Thrown at cmd/objbench.go:852
}
// get the off out of range
if d, e := get(blob, key, 6, 2); e != nil || d != "" {
return warning(fmt.Errorf(`failed to get object with the offset out of range, expect "", but got %q, error: %s`, d, e))
}
return nil
})
runCase("head an object", func(blob object.ObjectStorage) error {
br := []byte("hello")
if err := blob.Put(ctx, key, bytes.NewReader(br)); err != nil {
return fmt.Errorf("put object failed: %s", err)
}
defer blob.Delete(ctx, key) //nolint:errcheck
if h, err := blob.Head(ctx, key); err != nil {
return fmt.Errorf("failed to head object %s", err)
} else {
if h.Key() != key {
return fmt.Errorf("expected key 'test' but got %s", h.Key())
}
}
return nil
})
runCase("delete an object", func(blob object.ObjectStorage) error {
br := []byte("hello")
if err := blob.Put(ctx, key, bytes.NewReader(br)); err != nil {
return fmt.Errorf("put object failed: %s", err)
}
if err := blob.Delete(ctx, key); err != nil {
return fmt.Errorf("delete failed: %s", err)
}
if _, err := blob.Head(ctx, key); err == nil {
return fmt.Errorf("expect err is not nil")
}
if err := blob.Delete(ctx, key); err != nil {View on GitHub (pinned to c9a67b23e8)
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
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at cmd/objbench.go:852 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of juicedata/juicefs@c9a67b23e8 (2026-09-06).
Data as JSON: /api/errors/8e0cbf61ef4b5c8a.
Report an issue: GitHub.