{"record":{"id":"4e5f8f6991aebc06","repo":"juicedata/juicefs","slug":"update-format","errorCode":null,"errorMessage":"update format","messagePattern":"update format","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/meta/redis.go","lineNumber":371,"sourceCode":"\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrap(err, \"remove dir stats\")\n\t\t\t}\n\t\t}\n\t\tif !old.UserGroupQuota && format.UserGroupQuota {\n\t\t\t// remove user group quota as they are outdated\n\t\t\t_, err := m.rdb.TxPipelined(ctx, func(pipe redis.Pipeliner) error {\n\t\t\t\tpipe.Del(ctx, m.userQuotaKey(), m.userQuotaUsedSpaceKey(), m.userQuotaUsedInodesKey(),\n\t\t\t\t\tm.groupQuotaKey(), m.groupQuotaUsedSpaceKey(), m.groupQuotaUsedInodesKey())\n\t\t\t\tm.genLog(ctx, pipe, time.Now(), \"INIT_ENABLE_USERGROUPQUOTA()\")\n\t\t\t\treturn nil\n\t\t\t})\n\t\t\tif err != nil {\n\t\t\t\treturn errors.Wrap(err, \"remove user group quota\")\n\t\t\t}\n\t\t}\n\t\tif err = format.update(&old, force); err != nil {\n\t\t\treturn errors.Wrap(err, \"update format\")\n\t\t}\n\t}\n\n\tdata, err := json.MarshalIndent(format, \"\", \"\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"json: %s\", err)\n\t}\n\tts := time.Now().Unix()\n\tattr := &Attr{\n\t\tTyp:    TypeDirectory,\n\t\tAtime:  ts,\n\t\tMtime:  ts,\n\t\tCtime:  ts,\n\t\tNlink:  2,\n\t\tLength: 4 << 10,\n\t\tParent: RootInode,\n\t}\n\tif format.TrashDays > 0 {","sourceCodeStart":353,"sourceCodeEnd":389,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/meta/redis.go#L353-L389","documentation":"Returned from redisMeta.doInit when format.update(&old, force) — the function that validates and persists the new volume format settings against the previously stored format — fails. This is the final step of applying a format change during mount; failures typically mean the requested change conflicts with the existing format (e.g. incompatible settings without --force) or persisting the updated JSON to Redis failed.","triggerScenarios":"Mounting with client-side settings or a config change where format.update rejects the modification (incompatible capacity, storage, or secret change without force=true), or the underlying save of the updated format (e.g. a Redis write) returns an error.","commonSituations":"Changing immutable format fields (e.g. storage backend, bucket) without `juicefs config --force`; mixed old/new client versions disagreeing on format; Redis write failure while persisting the format hash.","solutions":["Unwrap the underlying error from format.update; if it is a compatibility rejection, use `juicefs config <meta-url> --force` deliberately or revert the setting.","Compare the stored format (`juicefs status <meta-url>`) with the requested settings to find the conflicting field.","Retry if the cause was a transient Redis write failure.","Upgrade/downgrade clients to a consistent version before changing the format."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Compare desired vs stored format before mounting:\nst, _ := juicefs.Status(ctx, metaUrl)\n// ensure changed fields (storage, bucket, capacity) are allowed or pass force","typeGuard":null,"tryCatchPattern":"if err := doInit(ctx, format); err != nil {\n    if strings.Contains(err.Error(), \"update format\") {\n        // inspect incompatible field and either revert or use juicefs config --force\n    }\n    return err\n}","preventionTips":["Never change immutable format fields (storage backend, bucket) without `--force` and understanding the impact.","Keep client versions homogeneous in the cluster before format changes.","Diff the requested config against `juicefs status` output before mounting.","Take a metadata backup before any format change."],"tags":["go","redis","metadata","config"],"backgroundTag":"invalid-config-value","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"}