{"record":{"id":"bcaa9a856ac98f10","repo":"juicedata/juicefs","slug":"failed-to-chtimes-s","errorCode":null,"errorMessage":"failed to chtimes %s","messagePattern":"failed to chtimes (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/objbench.go","lineNumber":1131,"sourceCode":"\n\tfunFSCase(\"change permission\", func() error {\n\t\tif err := fi.Chmod(key, 0777); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif objInfo, err := blob.Head(ctx, key); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to head object %s\", err)\n\t\t} else if info, ok := objInfo.(object.File); ok {\n\t\t\tif info.Mode()&0xFFF != 0777 {\n\t\t\t\treturn fmt.Errorf(\"expect mode %o but got %o\", 0777, info.Mode())\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t})\n\n\tfunFSCase(\"change mtime\", func() error {\n\t\tmtime := time.Now().Add(-10 * time.Minute)\n\t\tif err := fi.Chtimes(key, mtime); err != nil {\n\t\t\treturn fmt.Errorf(\"failed to chtimes %s\", err)\n\t\t}\n\t\tif objInfo, 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 objInfo.Mtime().Before(mtime.Add(-2*time.Second)) || objInfo.Mtime().After(mtime.Add(2*time.Second)) {\n\t\t\t\treturn fmt.Errorf(\"mtime deviation is too large, the actual mtime is %s but got %s\", mtime.Format(time.RFC3339), objInfo.Mtime().Format(time.RFC3339))\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t})\n}\n","sourceCodeStart":1113,"sourceCodeEnd":1143,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/cmd/objbench.go#L1113-L1143","documentation":"objbench 'change mtime' test wraps an error from fi.Chtimes(key, mtime) — the FileSystem interface's change-times call — into 'failed to chtimes %s'. It means the benchmark could not set the object's modification time before verifying it via Head.","triggerScenarios":"Calling fi.Chtimes(key, mtime) with mtime = now -10min and the filesystem implementation returns an error (backend rejects Chtimes, key missing, permission issue).","commonSituations":"Backends whose objectStorage doesn't support setting mtime; key already removed by a failed previous case; running objbench against storage that errors on Chtimes.","solutions":["Inspect the wrapped error to find the Chtimes failure cause.","Confirm the key exists (earlier objbench case created it); rerun the full benchmark.","Use a backend that supports Chtimes / mtime metadata.","Check write permissions on the target prefix."],"exampleFix":"// before\nreturn fmt.Errorf(\"failed to chtimes %s\", err)\n// after\nreturn fmt.Errorf(\"failed to chtimes %s: %w\", key, err)","handlingStrategy":"validation","validationCode":"if _, err := blob.Head(ctx, key); err != nil {\n    return fmt.Errorf(\"key %s not headable: %w\", key, err)\n}","typeGuard":null,"tryCatchPattern":"if err := fi.Chtimes(key, mtime); err != nil {\n    log.Warnf(\"chtimes unsupported or failed for %s: %v\", key, err)\n    return nil // degrade gracefully on backends without Chtimes\n}","preventionTips":["Use backends that support setting mtime if the workflow requires it.","Ensure the key exists before Chtimes.","Check write permissions on the target prefix.","Capture the underlying error to distinguish unsupported vs transient failure."],"tags":["object-storage","mtime","chtimes","benchmark"],"backgroundTag":"unsupported-operation","analyzedSha":"c9a67b23e8e08ec23ec331aa6f1675e2319e921c","analyzedAt":"2026-09-06T17:55:48.476Z","contentChangedAt":"2026-09-06T17:55:48.476Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}