{"record":{"id":"49dd6870a289f009","repo":"chocolatey/choco","slug":"the-default-push-source-configuration-is-not-set","errorCode":null,"errorMessage":"The default push source configuration is not set. Either pass a source to push to, such as `--source=\"'{0}'\"`, or set the `defaultPushSource` configuration value, for example `choco config set --name=\"'defaultPushSource'\" --value=\"'{0}'\"`.","messagePattern":"The default push source configuration is not set\\. Either pass a source to push to, such as `--source=\"'(.+?)'\"`, or set the `defaultPushSource` configuration value, for example `choco config set --name=\"'defaultPushSource'\" --value=\"'(.+?)'\"`\\.","errorType":"validation","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"src/chocolatey/infrastructure.app/commands/ChocolateyPushCommand.cs","lineNumber":74,"sourceCode":"            //todo: #2569 push command - allow disable buffering?\r\n        }\r\n\r\n        public virtual void ParseAdditionalArguments(IList<string> unparsedArguments, ChocolateyConfiguration configuration)\r\n        {\r\n            configuration.Input = string.Join(\" \", unparsedArguments); // path to .nupkg - assume relative\r\n        }\r\n\r\n        public virtual void Validate(ChocolateyConfiguration configuration)\r\n        {\r\n            if (string.IsNullOrWhiteSpace(configuration.Sources))\r\n            {\r\n                if (!string.IsNullOrWhiteSpace(configuration.PushCommand.DefaultSource))\r\n                {\r\n                    configuration.Sources = configuration.PushCommand.DefaultSource;\r\n                }\r\n                else\r\n                {\r\n                    throw new ApplicationException(\"The default push source configuration is not set. Either pass a source to push to, such as `--source=\\\"'{0}'\\\"`, or set the `defaultPushSource` configuration value, for example `choco config set --name=\\\"'defaultPushSource'\\\" --value=\\\"'{0}'\\\"`.\".FormatWith(ApplicationParameters.ChocolateyCommunityFeedPushSource));\r\n                }\r\n            }\r\n\r\n            IEnumerable<string> sources = configuration.Sources.Split(new[] { \";\", \",\" }, StringSplitOptions.RemoveEmptyEntries);\r\n\r\n            if (sources.Count() > 1)\r\n            {\r\n                throw new ApplicationException(\"Multiple sources are not supported by push command.\");\r\n            }\r\n\r\n            var remoteSource = new Uri(configuration.Sources);\r\n            if (string.IsNullOrWhiteSpace(configuration.PushCommand.Key) && !remoteSource.IsUnc && !remoteSource.IsFile)\r\n            {\r\n                // perform a lookup\r\n                configuration.PushCommand.Key = _configSettingsService.GetApiKey(configuration, null);\r\n                if (string.IsNullOrWhiteSpace(configuration.PushCommand.Key))\r\n                {\r\n                    throw new ApplicationException(\"An API key was not found for '{0}'. You must either set an API key with the apikey command or specify one with --api-key.\".FormatWith(configuration.Sources));\r","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/chocolatey/choco/blob/0d5abdd10cc177a141e69547cad6935b419b6c17/src/chocolatey/infrastructure.app/commands/ChocolateyPushCommand.cs#L56-L92","documentation":"Thrown by ChocolateyPushCommand.Validate when no --source is provided and no defaultPushSource is configured in Chocolatey settings. Push requires a destination feed; if neither a CLI --source argument nor the 'defaultPushSource' config value is set, the command cannot determine where to push and aborts. The message includes the community feed URL as an example.","triggerScenarios":"Running 'choco push' without --source and without having set 'defaultPushSource' via 'choco config set'. The check is: configuration.Sources is null/empty AND configuration.PushCommand.DefaultSource is null/empty.","commonSituations":"First-time push on a fresh Chocolatey install where no default push source was ever configured. Or in CI/CD pipelines where the push source was expected to be pre-set but was not.","solutions":["Pass the source explicitly: 'choco push --source=\"https://push.chocolatey.org/\"'.","Set a persistent default: 'choco config set --name=\"defaultPushSource\" --value=\"https://push.chocolatey.org/\"' then run 'choco push' without --source.","For internal/private feeds, point to your internal NuGet repository URL."],"exampleFix":"// before\nchoco push\n// after\nchoco config set --name=\"defaultPushSource\" --value=\"https://push.chocolatey.org/\"\nchoco push","handlingStrategy":"validation","validationCode":"// Ensure a push source is available before pushing\nif (string.IsNullOrWhiteSpace(pushSource) && string.IsNullOrWhiteSpace(GetConfig(\"defaultPushSource\")))\n{\n    Console.Error.WriteLine(\"No push source configured. Set defaultPushSource or pass --source.\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set 'defaultPushSource' once with 'choco config set' to avoid repeated --source flags.","Always pass --source explicitly in CI/CD pipelines for determinism."],"tags":["chocolatey","push-command","missing-config","source"],"backgroundTag":null,"analyzedSha":"0d5abdd10cc177a141e69547cad6935b419b6c17","analyzedAt":"2026-08-13T18:33:03.301Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}