duplicati/duplicati · error · ArgumentException

Missing required option: {key}

Error message

Missing required option: {key}

What it means

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.

Source

Thrown at Duplicati/Library/Backend/MovistarCloud/MovistarCloudBackend.cs:554

        if (_nameToId.TryGetValue(remotename, out id))
            return id;

        if (allowMissing) return null;
        throw new FileMissingException($"Remote file not found: {remotename}");
    }

    /// <summary>
    /// Gets a required option value from the options dictionary.
    /// </summary>
    /// <param name="options">The options dictionary</param>
    /// <param name="key">The option key</param>
    /// <returns>The option value</returns>
    /// <exception cref="ArgumentException">Thrown when the option is missing</exception>
    private static string RequireOption(Dictionary<string, string?> options, string key)
    {
        if (options.TryGetValue(key, out var v) && !string.IsNullOrWhiteSpace(v))
            return v.Trim();
        throw new ArgumentException($"Missing required option: {key}");
    }

    /// <summary>
    /// Validates the remote file name for allowed characters.
    /// </summary>
    /// <param name="name">The file name to validate</param>
    /// <exception cref="ArgumentException">Thrown when the name contains invalid characters</exception>
    private static void ValidateRemoteName(string name)
    {
        foreach (var c in name)
            if (!(char.IsLetterOrDigit(c) || c == '.' || c == '-' || c == '_'))
                throw new ArgumentException($"Unsupported remote filename char '{c}' in '{name}'");
    }

    /// <summary>
    /// Basic file entry implementation for Movistar Cloud files.
    /// </summary>
    private sealed class BasicFileEntry : IFileEntry

View on GitHub (pinned to 3f348be3e3)

Solutions

  1. Open the backend configuration and fill in the missing option identified by {key}.
  2. Cross-check the required option names against the backend's SupportedCommands list.
  3. Re-import or re-enter the configuration ensuring no required field is blank.
  4. Add a UI-side validation that blocks saving when a required option is empty.

Example fix

// before
throw new ArgumentException($"Missing required option: {key}");

// after - categorize as user-facing config error
throw new UserInformationException(
    $"The required Movistar Cloud option '{key}' is missing or empty. Set it in the backend configuration.",
    "MovistarCloudMissingOption");
Defensive patterns

Strategy: validation

Validate before calling

foreach (var key in new[] { "auth-username", "auth-password", "path" })
    if (!options.TryGetValue(key, out var v) || string.IsNullOrWhiteSpace(v))
        throw new ArgumentException($"Missing required option: {key}");

Try / catch

try { user = RequireOption(options, "auth-username"); }
catch (ArgumentException ex) { throw new UserInformationException(ex.Message, "MovistarMissingOption", ex); }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of duplicati/duplicati@3f348be3e3 (2026-08-13). Data as JSON: /api/errors/3083d6c87da779a2. Report an issue: GitHub.