{"record":{"id":"74b270b75ddabaa7","repo":"duplicati/duplicati","slug":"setinitpassword-empty-password-in-customactiondat","errorCode":null,"errorMessage":"SetInitPassword: empty password in CustomActionData.","messagePattern":"SetInitPassword: empty password in CustomActionData\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ReleaseBuilder/Resources/Windows/TrayIcon/SetInitPassword.js","lineNumber":41,"sourceCode":"        // No data passed - fail loudly. The MSI engine will surface\n        // this as a CA failure because Return=\"check\" is set on the\n        // matching <CustomAction>.\n        throw new Error(\"SetInitPassword: CustomActionData is empty.\");\n    }\n\n    var sep = data.indexOf(\"|\");\n    if (sep < 0) {\n        throw new Error(\"SetInitPassword: CustomActionData is missing the '|' separator.\");\n    }\n\n    var exe = data.substring(0, sep);\n    var password = data.substring(sep + 1);\n\n    if (exe.length === 0) {\n        throw new Error(\"SetInitPassword: empty exe path in CustomActionData.\");\n    }\n    if (password.length === 0) {\n        throw new Error(\"SetInitPassword: empty password in CustomActionData.\");\n    }\n\n    // Set the env var on the current script's process. WScript.Shell.Run\n    // launches the child as a child process of this script process, so\n    // the env var is inherited. The variable is NOT promoted to user-\n    // or system-wide because we use the \"PROCESS\" environment scope.\n    shell.Environment(\"PROCESS\").Item(\"DUPLICATI__INIT_PASSWORD\") = password;\n    try {\n        // First arg quotes the exe path itself, then appends the\n        // sub-command. Quoting the exe is necessary because the install\n        // dir may contain spaces. Window-style 0 hides the window;\n        // 'true' makes Run wait for the child to exit and return its\n        // exit code.\n        var cmd = \"\\\"\" + exe + \"\\\" set-init-password\";\n        var rc = shell.Run(cmd, 0, true);\n        if (rc !== 0) {\n            throw new Error(\"SetInitPassword: child process exited with code \" + rc);\n        }","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/duplicati/duplicati/blob/3f348be3e33f5d72d414e3ad55839c2ba34dda67/ReleaseBuilder/Resources/Windows/TrayIcon/SetInitPassword.js#L23-L59","documentation":"Thrown by VerifyConsistencyForRepairAsync when FilesetEntry rows reference non-existent FileLookup entries AND the code successfully identified the affected filesets. The message lists up to 10 fileset versions (with their version number, timestamp, and database ID) and appends '... and more' if more than 10 filesets are affected (the overflow flag).","triggerScenarios":"After detecting nonAttachedFiles != 0 (dangling FilesetEntry.FileID references), the code queries the first 11 distinct FilesetIDs with the problem, cross-references them with FilesetTimesAsync to produce human-readable version/timestamp pairs, and throws this detailed message. The overflow flag is set when more than 10 fileset IDs were found.","commonSituations":"Same root causes as the generic variant (error 522): interrupted delete, corruption, or cascade failures. The difference is that here the filesets are still present in the Fileset table so their metadata can be looked up for a more informative error message.","solutions":["Run the Duplicati repair command -- the detailed fileset list helps identify which backup versions are affected.","For the specific filesets listed in the error, consider deleting those backup versions individually and re-running the backup.","Delete and recreate the local database from the remote destination if repair does not resolve the dangling references.","Back up the local SQLite database before attempting manual SQL fixes to FilesetEntry."],"exampleFix":"// before\nawait db.VerifyConsistencyForRepairAsync(blocksize, hashsize, verifyfilelists, token);\n// after\ntry {\n    await db.VerifyConsistencyForRepairAsync(blocksize, hashsize, verifyfilelists, token);\n} catch (DatabaseInconsistencyException ex) {\n    // ex.Message lists affected filesets -- log them for diagnosis\n    logger.LogError(ex, \"Consistency check failed for filesets listed in message\");\n    await RepairDatabaseAsync(token);\n}","handlingStrategy":"try-catch","validationCode":"// Pre-check: count dangling FilesetEntry references with fileset detail\nlong dangling = await db.ExecuteScalarInt64Async(\n    \"SELECT COUNT(*) FROM \\\"FilesetEntry\\\" fe WHERE fe.\\\"FileID\\\" NOT IN (SELECT \\\"ID\\\" FROM \\\"FileLookup\\\")\", token);\nif (dangling > 0)\n    await RepairDatabaseAsync(token);","typeGuard":"// N/A -- runtime database-state error","tryCatchPattern":"try {\n    await db.VerifyConsistencyForRepairAsync(blocksize, hashsize, verifyfilelists, token);\n} catch (DatabaseInconsistencyException ex) when (ex.Message.Contains(\"FilesetEntry without corresponding FileLookup\")) {\n    logger.LogError(ex, \"Consistency failure: {Message}\", ex.Message);\n    await RepairDatabaseAsync(token);\n}","preventionTips":["Always use graceful shutdown; avoid SIGKILL on the Duplicati process during operations.","Run VerifyConsistencyForRepairAsync after every major delete or compaction cycle.","Document which backup versions are affected to prioritize repair."],"tags":["duplicati","database-consistency","sqlite","repair","dangling-reference","filesetentry"],"backgroundTag":null,"analyzedSha":"3f348be3e33f5d72d414e3ad55839c2ba34dda67","analyzedAt":"2026-08-13T16:48:27.008Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}