{"record":{"id":"3083d6c87da779a2","repo":"duplicati/duplicati","slug":"missing-required-option-key","errorCode":null,"errorMessage":"Missing required option: {key}","messagePattern":"Missing required option: (.+?)","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"Duplicati/Library/Backend/MovistarCloud/MovistarCloudBackend.cs","lineNumber":554,"sourceCode":"        if (_nameToId.TryGetValue(remotename, out id))\n            return id;\n\n        if (allowMissing) return null;\n        throw new FileMissingException($\"Remote file not found: {remotename}\");\n    }\n\n    /// <summary>\n    /// Gets a required option value from the options dictionary.\n    /// </summary>\n    /// <param name=\"options\">The options dictionary</param>\n    /// <param name=\"key\">The option key</param>\n    /// <returns>The option value</returns>\n    /// <exception cref=\"ArgumentException\">Thrown when the option is missing</exception>\n    private static string RequireOption(Dictionary<string, string?> options, string key)\n    {\n        if (options.TryGetValue(key, out var v) && !string.IsNullOrWhiteSpace(v))\n            return v.Trim();\n        throw new ArgumentException($\"Missing required option: {key}\");\n    }\n\n    /// <summary>\n    /// Validates the remote file name for allowed characters.\n    /// </summary>\n    /// <param name=\"name\">The file name to validate</param>\n    /// <exception cref=\"ArgumentException\">Thrown when the name contains invalid characters</exception>\n    private static void ValidateRemoteName(string name)\n    {\n        foreach (var c in name)\n            if (!(char.IsLetterOrDigit(c) || c == '.' || c == '-' || c == '_'))\n                throw new ArgumentException($\"Unsupported remote filename char '{c}' in '{name}'\");\n    }\n\n    /// <summary>\n    /// Basic file entry implementation for Movistar Cloud files.\n    /// </summary>\n    private sealed class BasicFileEntry : IFileEntry","sourceCodeStart":536,"sourceCodeEnd":572,"githubUrl":"https://github.com/duplicati/duplicati/blob/3f348be3e33f5d72d414e3ad55839c2ba34dda67/Duplicati/Library/Backend/MovistarCloud/MovistarCloudBackend.cs#L536-L572","documentation":"Thrown by the static MovistarCloudBackend.RequireOption helper when a required configuration key is absent from the options dictionary or its value is null/whitespace. System.ArgumentException indicates a configuration error at backend construction. RequireOption is used to pull mandatory settings like username, password, and the destination path.","triggerScenarios":"RequireOption(options, key) is called during backend construction; options does not contain key, or the value is null/empty/whitespace; ArgumentException is thrown with the offending key name.","commonSituations":"A required option (e.g. 'auth-username' or 'auth-password') was omitted in the backend configuration; option key renamed across versions; the UI did not persist the field; export/import of config dropped a value.","solutions":["Open the backend configuration and fill in the missing option identified by {key}.","Cross-check the required option names against the backend's SupportedCommands list.","Re-import or re-enter the configuration ensuring no required field is blank.","Add a UI-side validation that blocks saving when a required option is empty."],"exampleFix":"// before\nthrow new ArgumentException($\"Missing required option: {key}\");\n\n// after - categorize as user-facing config error\nthrow new UserInformationException(\n    $\"The required Movistar Cloud option '{key}' is missing or empty. Set it in the backend configuration.\",\n    \"MovistarCloudMissingOption\");","handlingStrategy":"validation","validationCode":"foreach (var key in new[] { \"auth-username\", \"auth-password\", \"path\" })\n    if (!options.TryGetValue(key, out var v) || string.IsNullOrWhiteSpace(v))\n        throw new ArgumentException($\"Missing required option: {key}\");","typeGuard":null,"tryCatchPattern":"try { user = RequireOption(options, \"auth-username\"); }\ncatch (ArgumentException ex) { throw new UserInformationException(ex.Message, \"MovistarMissingOption\", ex); }","preventionTips":["Validate all required options in the UI before saving the backend.","Provide a clear list of mandatory keys via SupportedCommands.","Re-check options after config import/export."],"tags":["movistar-cloud","configuration","argument","missing-option","backend"],"backgroundTag":null,"analyzedSha":"3f348be3e33f5d72d414e3ad55839c2ba34dda67","analyzedAt":"2026-08-13T16:48:27.008Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}