chocolatey/choco · error · ApplicationException
Stopping further execution as {0} has failed.
Error message
Stopping further execution as {0} has failed. What it means
Thrown during a package install/upgrade when a dependency of the current package already failed earlier in the same run (a result with Success != true whose Id matches one of the package's declared dependencies). Chocolatey logs a DependencyFailedToInstall error and, with StopOnFirstPackageFailure enabled, aborts the run via this ApplicationException.
Source
Thrown at src/chocolatey/infrastructure.app/services/NugetService.cs:1712
existingPackage.Messages.Add(message);
break;
}
// Don't attempt to action this package if dependencies failed.
if (packageResultsToReturn.Any(r => r.Value.Success != true && packageDependencyInfo.Dependencies.Any(d => d.Id.Equals(r.Value.Identity.Id, StringComparison.OrdinalIgnoreCase))))
{
var logMessage = StringResources.ErrorMessages.DependencyFailedToInstall.FormatWith(packageDependencyInfo.Id, packageDependencyInfo.Version);
packageResultsToReturn.GetOrAdd(
packageDependencyInfo.Id,
new PackageResult(packageDependencyInfo.Id, packageDependencyInfo.Version.ToFullStringChecked(), string.Empty)
)
.Messages.Add(new ResultMessage(ResultType.Error, logMessage));
this.Log().Error(ChocolateyLoggers.Important, logMessage);
if (config.Features.StopOnFirstPackageFailure)
{
throw new ApplicationException("Stopping further execution as {0} has failed.".FormatWith(packageDependencyInfo.Id));
}
continue;
}
var packageRemoteMetadata = packagesToInstall.FirstOrDefault(p => p.Identity.Equals(packageDependencyInfo));
if (packageRemoteMetadata is null)
{
var endpoint = NuGetEndpointResources.GetResourcesBySource(packageDependencyInfo.Source, sourceCacheContext);
packageRemoteMetadata = endpoint.PackageMetadataResource
.GetMetadataAsync(packageDependencyInfo, sourceCacheContext, _nugetLogger, CancellationToken.None)
.GetAwaiter().GetResult();
}
var packageToUninstall = packagesToUninstall.FirstOrDefault(p => p.PackageMetadata.Id.Equals(packageDependencyInfo.Id, StringComparison.OrdinalIgnoreCase));
View on GitHub (pinned to 0d5abdd10c)
Solutions
- Resolve the failing dependency first: re-run install for just that package and inspect its specific error
- Ensure network/source access for the dependency package and its correct version
- Disable stopOnFirstPackageFailure to continue past the dependency failure
- Pin compatible versions so dependency resolution and dependency installs succeed
Example fix
// before choco install appWithDeps --stop-on-first-package-failure // after choco install theFailingDependency --verbose # fix that, then: choco install appWithDeps
Defensive patterns
Strategy: validation
Validate before calling
// Run dependency packages first and inspect their results before the dependent package.
foreach (var dep in package.Dependencies) {
var depResult = choco.Install(dep.Id, dep.Version);
if (depResult.Success != true) { logger.Error($"Dependency {dep.Id} failed; aborting dependent install."); return; }
} Try / catch
try { choco.Install(config); }
catch (ApplicationException ex) when (ex.Message.StartsWith("Stopping further execution")) {
// inspect results for the DependencyFailedToInstall error and fix the named dependency
logger.Error(ex.Message);
} Prevention
- Install dependencies first and verify Success before the dependent package
- Do not enable stopOnFirstPackageFailure until dependencies are known-good
- Pin dependency versions to ones that install cleanly in your environment
When it happens
Trigger: Processing packageDependencyInfo whose Dependencies collection contains an Id that already has a failed (Success != true) entry in packageResultsToReturn, while config.Features.StopOnFirstPackageFailure is true.
Common situations: A dependency failed to download (network) or its own install script errored, so the dependent package cannot proceed; misordered install plan with StopOnFirstPackageFailure; a dependency pinned to a version that fails its install.
Related errors
- Force dependencies can only be used with force also turned o
- Package name is required. Please pass at least one package n
- It appears you are attempting to use options that may be onl
- Force dependencies can only be used with force also turned o
- Reboot required before continuing. Reboot and run the same c
AI-assisted analysis of chocolatey/choco@0d5abdd10c (2026-08-13).
Data as JSON: /api/errors/37f64b1dcf2f4417.
Report an issue: GitHub.