{"record":{"id":"1c6518d3fa27c473","repo":"duplicati/duplicati","slug":"urloptionmissing-1c6518","errorCode":"UrlOptionMissing","errorMessage":"URL is required","messagePattern":"URL is required","errorType":"exception","errorClass":"UserInformationException","httpStatus":null,"severity":"error","filePath":"Duplicati/Library/Backend/Filen/GetApiKeyModule.cs","lineNumber":64,"sourceCode":"    }\n\n    /// <inheritdoc/>\n    public IList<ICommandLineArgument> SupportedCommands =>\n    [\n        .. AuthOptionsHelper.GetOptions(),\n        new CommandLineArgument(\"two-factor\", CommandLineArgument.ArgumentType.String, Strings.FilenBackend.TwoFactorShort, Strings.FilenBackend.TwoFactorLong)\n    ];\n\n    /// <inheritdoc/>\n    public async Task<IDictionary<string, string>> Execute(IDictionary<string, string?> options, CancellationToken cancellationToken)\n    {\n        options.TryGetValue(\"filen-operation\", out var operation);\n        if (operation != \"GetApiKey\")\n            throw new UserInformationException(\"Invalid operation\", \"InvalidOperation\");\n\n        options.TryGetValue(\"url\", out var url);\n        if (string.IsNullOrEmpty(url))\n            throw new UserInformationException(\"URL is required\", \"UrlOptionMissing\");\n\n        var uri = new Utility.RelaxedUri(url);\n\n        var newOpts = new Dictionary<string, string?>(options);\n        foreach (var key in uri.QueryParameters.AllKeys)\n            if (key != null)\n                newOpts[key] = uri.QueryParameters[key];\n\n        var backend = new FilenBackend(url, newOpts);\n        var apiKey = await backend.GetApiKey(cancellationToken).ConfigureAwait(false);\n        return new Dictionary<string, string> { { \"api-key\", apiKey ?? string.Empty } };\n    }\n\n    /// <inheritdoc/>\n    public IDictionary<string, IDictionary<string, string>> GetLookups()\n        => new Dictionary<string, IDictionary<string, string>>();\n}\n","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/duplicati/duplicati/blob/3f348be3e33f5d72d414e3ad55839c2ba34dda67/Duplicati/Library/Backend/Filen/GetApiKeyModule.cs#L46-L82","documentation":"Thrown by GetApiKeyModule.Execute when the 'url' option is null or empty. The module needs the Filen backend URL (including any query parameters it later parses via RelaxedUri) to construct a FilenBackend, so a missing URL is a hard configuration failure surfaced as UserInformationException code 'UrlOptionMissing'.","triggerScenarios":"Calling the 'filen-get-api-key' module without a 'url' option, or with an empty/whitespace value. The check happens after the operation check and before RelaxedUri parsing, so an empty string fails here rather than later in RelaxedUri.","commonSituations":"Running the module without the destination URL argument; a template/config that omits the Filen URL; passing the URL under a different option name (e.g. 'host' instead of 'url').","solutions":["Supply a non-empty --url=<filen-connection-string> when invoking the module.","Validate that the option is present and well-formed in your wrapper before launching the module.","Ensure the option key is exactly 'url' (not 'uri', 'host', or 'destination')."],"exampleFix":"// before\noptions.TryGetValue(\"url\", out var url);\nif (string.IsNullOrEmpty(url))\n    throw new UserInformationException(\"URL is required\", \"UrlOptionMissing\");\n\n// after (whitespace-aware + clearer message)\nif (string.IsNullOrWhiteSpace(url))\n    throw new UserInformationException(\n        \"The 'url' option is required for the Filen get-api-key module (e.g. filen://user@example.com).\",\n        \"UrlOptionMissing\");","handlingStrategy":"validation","validationCode":"if (string.IsNullOrWhiteSpace(options.GetValueOrDefault(\"url\")))\n    throw new ArgumentException(\"The 'url' option is required for the Filen get-api-key module.\");","typeGuard":null,"tryCatchPattern":"try { await module.Execute(options, ct); }\ncatch (UserInformationException ex) when (ex.HelpID == \"UrlOptionMissing\")\n{\n    Console.Error.WriteLine(\"Supply --url=<filen-connection-string>.\");\n    throw;\n}","preventionTips":["Require a non-empty 'url' option in any wrapper that launches the module.","Use the exact option key 'url' (not 'uri'/'host').","Validate the URL parses as a Filen URI before calling Execute."],"tags":["filen","configuration","web-module","validation","options"],"backgroundTag":null,"analyzedSha":"3f348be3e33f5d72d414e3ad55839c2ba34dda67","analyzedAt":"2026-08-13T16:48:27.008Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}