{"record":{"id":"aebbff2da7a24689","repo":"juicedata/juicefs","slug":"create-sor-w","errorCode":null,"errorMessage":"create %sor: %w","messagePattern":"create (.+?)or: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/sync.go","lineNumber":510,"sourceCode":"\treturn regexp.MustCompile(pattern).MatchString(endpoint)\n}\n\nfunc wrapSyncEncryptedStore(store object.ObjectStorage, keyPath, passphraseEnv, mode, algo string) (object.ObjectStorage, error) {\n\tif keyPath == \"\" {\n\t\treturn store, nil\n\t}\n\n\tprivKey, err := object.ParseRsaPrivateKeyFromPath(keyPath, os.Getenv(passphraseEnv))\n\tif err != nil {\n\t\tif errors.Is(err, object.ErrKeyNeedPasswd) {\n\t\t\tlogger.Fatalf(\"%s key is password protected, please set %s environment variable\", mode, passphraseEnv)\n\t\t}\n\t\treturn nil, fmt.Errorf(\"load %s key: %w\", mode, err)\n\t}\n\n\tencryptor, err := object.NewDataEncryptor(object.NewKeyEncryptor(privKey), algo)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"create %sor: %w\", mode, err)\n\t}\n\n\treturn object.NewChunkedEncrypted(store, encryptor), nil\n}\n\nfunc loadClusterWorkerConfig(r io.Reader) (string, string, error) {\n\tsrc, dst, env, err := sync.ReadClusterWorkerConfig(r)\n\tif err != nil {\n\t\treturn \"\", \"\", err\n\t}\n\tfor key, value := range env {\n\t\tif err := os.Setenv(key, value); err != nil {\n\t\t\treturn \"\", \"\", fmt.Errorf(\"set worker environment %q: %s\", key, err)\n\t\t}\n\t}\n\treturn src, dst, nil\n}\n","sourceCodeStart":492,"sourceCodeEnd":528,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/cmd/sync.go#L492-L528","documentation":"After loading the RSA private key, wrapSyncEncryptedStore builds the encryptor with object.NewDataEncryptor(object.NewKeyEncryptor(privKey), algo), where algo comes from the --encrypt-algo flag. This error wraps failure to construct that encryptor — almost always an unsupported/misspelled algorithm name (e.g. 'chacha20' instead of 'aes256').","triggerScenarios":"doSync invoked with --encrypt-rsa-key plus an --encrypt-algo value that object.NewDataEncryptor does not recognize (currently only aes256/chacha20-style registered algorithms); the wrapped inner error from NewDataEncryptor names the invalid algorithm.","commonSituations":"Typo in --encrypt-algo; copying an algorithm name from another tool; older client version that predates a newer algorithm (version mismatch between sync nodes); case sensitivity issues ('AES256' vs 'aes256').","solutions":["Use a supported --encrypt-algo value (check `juicefs sync --help`; e.g. aes256)","Fix the spelling/case of the algorithm name","Ensure all sync nodes run a JuiceFS version supporting the chosen algorithm; upgrade if needed","Omit --encrypt-algo to use the default algorithm"],"exampleFix":"// before\njuicefs sync --encrypt-rsa-key key.pem --encrypt-algo des3 src dst\n// create encryptor: ... invalid algorithm\n// after\njuicefs sync --encrypt-rsa-key key.pem --encrypt-algo aes256 src dst","handlingStrategy":"validation","validationCode":"allowed := map[string]bool{\"aes256\": true, \"chacha20\": true}\nalgo := ctx.String(\"encrypt-algo\")\nif algo != \"\" && !allowed[strings.ToLower(algo)] {\n\treturn fmt.Errorf(\"unsupported --encrypt-algo %q\", algo)\n}","typeGuard":"null","tryCatchPattern":"if err != nil {\n\tif strings.Contains(err.Error(), \"create \") && strings.Contains(err.Error(), \"or:\") {\n\t\t// encryptor construction failed; check --encrypt-algo value\n\t}\n\treturn err\n}","preventionTips":["Only use algorithm names listed in `juicefs sync --help`","Pin the same JuiceFS version on all sync nodes so algorithm support matches","Add a config-lint step that validates --encrypt-algo before launching long syncs"],"tags":["encryption","config","sync","juicefs","invalid-algorithm"],"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-14T00:17:10.932Z"}