{"record":{"id":"6216431691efdb51","repo":"chocolatey/choco","slug":"no-runner-was-found-that-implements-source-type","errorCode":null,"errorMessage":"No runner was found that implements source type '{0}' or action was missing","messagePattern":"No runner was found that implements source type '(.+?)' or action was missing","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs","lineNumber":176,"sourceCode":"\r\n        private void PerformSourceRunnerAction<TSourceRunner>(ChocolateyConfiguration config, Action<TSourceRunner> action, IEnumerable<TSourceRunner> alternativeSourceRunners, bool throwOnException = false)\r\n            where TSourceRunner : class, IAlternativeSourceRunner\r\n        {\r\n            var runner = GetSourceRunner(config.SourceType, alternativeSourceRunners);\r\n            if (runner != null && action != null)\r\n            {\r\n                if (runner is IBootstrappableSourceRunner bootstrapper)\r\n                {\r\n                    bootstrapper.EnsureSourceAppInstalled(config, (packageResult, configuration) => HandlePackageResult(packageResult, configuration, CommandNameType.Install));\r\n                }\r\n\r\n                action.Invoke(runner);\r\n            }\r\n            else\r\n            {\r\n                if (throwOnException)\r\n                {\r\n                    throw new NotSupportedException(\"No runner was found that implements source type '{0}' or action was missing\".FormatWith(config.SourceType));\r\n                }\r\n                else\r\n                {\r\n                    this.Log().Warn(\"No runner was found that implements source type '{0}' or action was missing\".FormatWith(config.SourceType));\r\n                }\r\n            }\r\n        }\r\n\r\n        private TResult PerformSourceRunnerFunction<TSourceRunner, TResult>(ChocolateyConfiguration config, Func<TSourceRunner, TResult> function, bool throwOnException = false)\r\n            where TSourceRunner : class, IAlternativeSourceRunner\r\n        {\r\n            var alternativeSourceRunners = _containerResolver.ResolveAll<TSourceRunner>();\r\n            return PerformSourceRunnerFunction(config, function, alternativeSourceRunners, throwOnException);\r\n        }\r\n\r\n        private TResult PerformSourceRunnerFunction<TSourceRunner, TResult>(ChocolateyConfiguration config, Func<TSourceRunner, TResult> function, IEnumerable<TSourceRunner> alternativeSourceRunners, bool throwOnException = false)\r\n            where TSourceRunner : class, IAlternativeSourceRunner\r\n        {\r","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/chocolatey/choco/blob/0d5abdd10cc177a141e69547cad6935b419b6c17/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs#L158-L194","documentation":"Thrown by ChocolateyPackageService.PerformSourceRunnerAction (the action overload) when GetSourceRunner returns null for the given config.SourceType (no registered IAlternativeSourceRunner matches) or when the action delegate itself is null, and throwOnException is true. This covers source types like 'ruby', 'python', 'cygwin', 'windowsfeatures', etc. that require specialized runners. If the appropriate runner isn't registered in the DI container, the operation cannot proceed.","triggerScenarios":"Setting --source-type to a value like 'ruby' or 'windowsfeatures' when no corresponding runner is registered. The runner extension or module providing the source type is not installed. The source type string has a typo. The action parameter passed to the method is null (internal code error). throwOnException is true (called from a path that expects exceptions).","commonSituations":"User passes --source-type=python but the Python source runner extension isn't installed. Chocolatey extension that provides the source runner is missing or corrupted. Typo in source type name. Version mismatch where the runner was removed or renamed. Internal call passes null action due to a bug.","solutions":["Verify the source type name with 'choco search --help' or documentation for supported source types","Install the Chocolatey extension that provides the needed source runner","Check spelling of the --source-type argument","Use the default/normal source type if the specialized one isn't needed: omit --source-type"],"exampleFix":"// before\nchoco install mypackage --source=python --source-type=python\n// throws if python runner not installed\n\n// after (use normal source)\nchoco install mypackage --source=https://pypi.org/\n// or install the python extension first, then:\nchoco install mypackage --source-type=python","handlingStrategy":"validation","validationCode":"// Validate source type has a registered runner before performing operations\nvar supportedSourceTypes = new[] { \"normal\", \"ruby\", \"python\", \"cygwin\", \"windowsfeatures\", \"webpi\" };\nif (!supportedSourceTypes.Contains(sourceType.ToLowerInvariant()))\n{\n    Console.Error.WriteLine($\"Source type '{sourceType}' has no registered runner. \" +\n        \"Supported types: {string.Join(\", \", supportedSourceTypes)}\");\n    return;\n}","typeGuard":"public static bool IsKnownSourceType(string sourceType, IEnumerable<string> registeredTypes)\n{\n    return registeredTypes.Any(t => t.Equals(sourceType, StringComparison.OrdinalIgnoreCase));\n}","tryCatchPattern":"try\n{\n    packageService.InstallPackage(config);\n}\ncatch (NotSupportedException ex) when (ex.Message.Contains(\"No runner was found\"))\n{\n    logger.Error($\"No source runner for type '{config.SourceType}'. \" +\n        \"Install the required extension or use the default source.\");\n}","preventionTips":["Verify the source type has a runner installed before using --source-type","Install Chocolatey extensions that provide the needed source runners","Check spelling of the source type argument","Omit --source-type to use the default NuGet source runner"],"tags":["source","source-type","runner","di-container","not-found","alternative-source"],"backgroundTag":null,"analyzedSha":"0d5abdd10cc177a141e69547cad6935b419b6c17","analyzedAt":"2026-08-13T18:33:03.301Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}