{"record":{"id":"c8aec1518b638be5","repo":"juicedata/juicefs","slug":"failed-to-stat-s-s","errorCode":null,"errorMessage":"failed to stat %s: %s","messagePattern":"failed to stat (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/load.go","lineNumber":124,"sourceCode":"\nfunc open(src string, key string, algo string) (io.ReadCloser, error) {\n\tvar r io.ReadCloser\n\tvar ioErr error\n\tvar fp io.ReadCloser\n\tif key != \"\" {\n\t\tprivKey, err := object.ParsePrivateKeyFromPem([]byte(loadEncrypt(key)), []byte(os.Getenv(\"JFS_RSA_PASSPHRASE\")))\n\t\tif err != nil {\n\t\t\tif errors.Is(err, object.ErrKeyNeedPasswd) {\n\t\t\t\treturn nil, fmt.Errorf(\"%w: please set the 'JFS_RSA_PASSPHRASE' environment variable\", err)\n\t\t\t}\n\t\t\treturn nil, fmt.Errorf(\"parse private key: %s\", err)\n\t\t}\n\t\tencryptor, err := object.NewDataEncryptor(object.NewKeyEncryptor(privKey), algo)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif _, err := os.Stat(src); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to stat %s: %s\", src, err)\n\t\t}\n\t\tvar srcAbsPath string\n\t\tsrcAbsPath, err = filepath.Abs(src)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to get absolute path of %s: %s\", src, err)\n\t\t}\n\t\tfileBlob, err := object.CreateStorage(\"file\", strings.TrimSuffix(src, filepath.Base(srcAbsPath)), \"\", \"\", \"\")\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tblob := object.NewEncrypted(fileBlob, encryptor)\n\t\tfp, ioErr = blob.Get(context.Background(), filepath.Base(srcAbsPath), 0, -1)\n\t} else {\n\t\tfp, ioErr = os.Open(src)\n\t}\n\tif ioErr != nil {\n\t\treturn nil, ioErr\n\t}","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/cmd/load.go#L106-L142","documentation":"When mounting, `handleSysMountArgs` translates legacy/free-form mount options into cmd flags using optionToCmdFlag and cmdFlagsLookup. If an option is known to the command's flag set and is NOT a boolean flag, a value must follow it; when the value is missing (or consumed incorrectly), load aborts with `option <opt> requires a value`.","triggerScenarios":"`juicefs mount` (or mount helper paths from Main / tests) invoked with a value-taking option such as `--attr-cache`, `--entry-cache`, `--dir-entry-cache`, `--metrics`, `--cache-dir`, `--bucket` etc. without its value — e.g. as the last argument, or with the value separated in a way the parser didn't associate (an empty string, or the next token itself looks like an option).","commonSituations":"systemd/fstab mount unit dropping the last argument; shell scripts building mount args where a variable holding the value is empty; hand-edited fstab entries missing the value after an option; copy-pasted commands where a flag was left dangling.","solutions":["Supply the value directly after the option: `--attr-cache 1s`","Check the generating script/fstab unit — an unset variable likely produced the empty value; echo the final command to inspect it","Use `juicefs mount --help` to confirm which options take values vs are boolean","Remove the dangling option entirely if you meant the default"],"exampleFix":"// before\njuicefs mount --attr-cache redis://10.0.0.1/1 /mnt/jfs\n// after\njuicefs mount --attr-cache 1s redis://10.0.0.1/1 /mnt/jfs","handlingStrategy":"validation","validationCode":"if fi, err := os.Stat(backupPath); err != nil || fi.IsDir() {\n    return fmt.Errorf(\"backup %s unavailable: %v\", backupPath, err)\n}","typeGuard":null,"tryCatchPattern":"if err := cmd.Run(); err != nil {\n    if strings.Contains(err.Error(), \"failed to stat\") {\n        log.Fatalf(\"backup path does not exist: %v\", err)\n    }\n}","preventionTips":["Always use absolute paths for backups in scripts","Verify the backup exists right after juicefs dump completes","Watch for cleanup jobs that delete old backups before restore"],"tags":["cli","mount","fuse-options"],"backgroundTag":"missing-required-option","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"}