{"record":{"id":"bf8dac49c78e9575","repo":"juicedata/juicefs","slug":"cifs-password-sk-is-required","errorCode":null,"errorMessage":"CIFS password/sk is required","messagePattern":"CIFS password/sk is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/object/cifs.go","lineNumber":514,"sourceCode":"\tif len(parts) > 2 && parts[2] != \"\" {\n\t\terr = fmt.Errorf(\"endpoint should be a valid share name (%s)\", \"\\\\\\\\<server>\\\\<share>\")\n\t\treturn\n\t}\n\tshare = parts[1]\n\treturn\n}\n\nfunc newCifs(endpoint, username, password, _ string) (ObjectStorage, error) {\n\thost, port, share, err := parseEndpoint(endpoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif username == \"\" {\n\t\treturn nil, fmt.Errorf(\"CIFS username/ak is required\")\n\t}\n\n\tif password == \"\" {\n\t\treturn nil, fmt.Errorf(\"CIFS password/sk is required\")\n\t}\n\n\tmaxPool := 8\n\tif v := os.Getenv(\"JFS_CIFS_MAX_POOL\"); v != \"\" {\n\t\tif n, err := strconv.Atoi(v); err == nil {\n\t\t\tmaxPool = n\n\t\t}\n\t}\n\n\tstore := &cifsStore{\n\t\thost:            host,\n\t\tport:            port,\n\t\tshare:           share,\n\t\tuser:            username,\n\t\tpassword:        password,\n\t\tconnIdleTimeout: 5 * time.Minute,\n\t\tpool:            make(chan *cifsConn, maxPool),\n\t}","sourceCodeStart":496,"sourceCodeEnd":532,"githubUrl":"https://github.com/juicedata/juicefs/blob/c9a67b23e8e08ec23ec331aa6f1675e2319e921c/pkg/object/cifs.go#L496-L532","documentation":"newCifs requires a non-empty password (mapped to the secret-key parameter). SMB session setup normally requires the password matching the username; without it the client cannot complete authentication, so construction fails right after the username check.","triggerScenarios":"Calling newCifs(endpoint, username, \"\", _) — missing secret-key in the cifs storage URI or empty env/config value; tests TestCifs/TestCifs2 passing an empty password.","commonSituations":"Secret not injected into the environment (CI/CD secret missing); user stored only the access key; whitespace-only value trimmed to empty.","solutions":["Provide the SMB password as the secret-key parameter of the cifs storage URI.","Verify the secret-key environment variable/config field is set and non-empty (after trimming).","If using Kerberos/SSO where a password is not used, still satisfy the driver by supplying the required credential fields as expected by this driver."],"exampleFix":"// before\nnewCifs(\"cifs://server/share\", \"smbuser\", \"\")\n// after\nnewCifs(\"cifs://server/share\", \"smbuser\", \"s3cret\")","handlingStrategy":"validation","validationCode":"if sk == \"\" {\n    return fmt.Errorf(\"cifs storage requires a password (secret key); got empty value\")\n}","typeGuard":null,"tryCatchPattern":"obj, err := object.CreateStorage(\"cifs\", endpoint, ak, sk, \"\")\nif err != nil && strings.Contains(err.Error(), \"password/sk is required\") {\n    return fmt.Errorf(\"missing SMB password: set secret key for user %s\", ak)\n}","preventionTips":["Ensure the secret-key field/env is set and non-whitespace","Verify CI/CD secret injection at deploy time","Store SMB credentials together so one is never omitted"],"tags":["cifs","smb","authentication","credentials"],"backgroundTag":"missing-credentials","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"}