{"record":{"id":"7987d13699eeed59","repo":"microsoft/aspire","slug":"the-0-option-must-be-specified-when-running-in-non","errorCode":null,"errorMessage":"The {0} option must be specified when running in non-interactive mode.","messagePattern":"The (.+?) option must be specified when running in non-interactive mode\\.","errorType":"exception","errorClass":"NonInteractiveException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Cli/Commands/UpdateCommand.cs","lineNumber":699,"sourceCode":"            if (nonInteractive)\n            {\n                var identityChannel = ExecutionContext.IdentityChannel;\n                if (!string.IsNullOrWhiteSpace(identityChannel)\n                    && !string.Equals(identityChannel, PackageChannelNames.Local, StringComparisons.ChannelName)\n                    && channels.FirstOrDefault(c => string.Equals(c, identityChannel, StringComparisons.ChannelName)) is { } matchedChannel)\n                {\n                    channel = matchedChannel;\n                }\n                else if (string.Equals(identityChannel, PackageChannelNames.Local, StringComparisons.ChannelName))\n                {\n                    channel = PackageChannelNames.Stable;\n                }\n                else\n                {\n                    var channelOptionDisplayName = $\"'{_channelOption.Name}'\";\n                    InteractionService.DisplayError(\n                        string.Format(CultureInfo.CurrentCulture, InteractionServiceStrings.NonInteractiveOptionRequired, channelOptionDisplayName));\n                    throw new NonInteractiveException(channelOptionDisplayName);\n                }\n            }\n            else\n            {\n                var channelBinding = PromptBinding.Create(parseResult, _channelOption);\n                channel = await InteractionService.PromptForSelectionAsync(\n                    \"Select the channel to update to:\",\n                    channels,\n                    q => q,\n                    binding: channelBinding,\n                    cancellationToken: cancellationToken);\n            }\n        }\n\n        try\n        {\n            // Get current executable path for display purposes only\n            var currentExePath = _processPathProvider.ProcessPath;","sourceCodeStart":681,"sourceCodeEnd":717,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Cli/Commands/UpdateCommand.cs#L681-L717","documentation":"Thrown by `aspire update --self` when running with --non-interactive (e.g. in CI) and no --channel option was supplied while the CLI's own identity channel cannot be used to pick an update channel. The CLI refuses to prompt, so it fails fast with a NonInteractiveException telling the user which option is required.","triggerScenarios":"`aspire update --self --non-interactive` (or non-TTY/CI environment forcing non-interactive) without --channel, when the running CLI's identity channel is empty, unrecognized, or an unmapped value like a local dev build in an unexpected configuration.","commonSituations":"CI pipelines upgrading the CLI non-interactively after the CLI was built locally or from a PR channel, scripts that previously relied on interactive prompting, or automation running through a non-TTY agent.","solutions":["Add --channel stable (or daily/staging) to the non-interactive update command","Run the command interactively so the channel prompt is shown","Set the `channel` global configuration value so a prompt is not needed","Ensure the CLI itself is an official build whose identity channel (stable/daily) can be used automatically"],"exampleFix":"// before\naspire update --self --non-interactive\n// after\naspire update --self --non-interactive --channel stable","handlingStrategy":"validation","validationCode":"if (isCi && !args.Contains(\"--channel\"))\n    throw new ArgumentException(\"--channel is required when running aspire update --self in non-interactive CI\");","typeGuard":null,"tryCatchPattern":"try { await selfUpdateAsync(); }\ncatch (NonInteractiveException ex) { Console.Error.WriteLine($\"Provide the {ex.Message} or run interactively.\"); return 2; }","preventionTips":["Always include --channel in scripted/CI invocations of aspire update --self","Avoid relying on interactive prompts in non-TTY environments","Verify the CLI build identity (stable/daily) matches the channel you pass"],"tags":["cli","non-interactive","missing-option"],"backgroundTag":"missing-required-option","analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-21T09:17:21.228Z"}