{"record":{"id":"e8f40ff3f5563b7f","repo":"microsoft/aspire","slug":"helm-0-was-detected-but-aspire-requires-helm-1-or-later-to","errorCode":null,"errorMessage":"Helm {0} was detected, but Aspire requires Helm {1} or later to deploy Kubernetes resources. Upgrade Helm from {2}.","messagePattern":"Helm (.+?) was detected, but Aspire requires Helm (.+?) or later to deploy Kubernetes resources\\. Upgrade Helm from (.+?)\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Hosting.Kubernetes/Deployment/HelmVersionValidator.cs","lineNumber":102,"sourceCode":"\n        if (exitCode != 0)\n        {\n            var errorText = stderr.ToString().Trim();\n            var detail = string.IsNullOrEmpty(errorText) ? $\"exit code {exitCode}\" : errorText;\n            throw new InvalidOperationException(\n                $\"'helm version --short' failed ({detail}). Aspire requires Helm {MinimumHelmVersion} or later. See {InstallDocsUrl}.\");\n        }\n\n        var rawOutput = stdout.ToString().Trim();\n        if (!TryParseHelmVersion(rawOutput, out var detected))\n        {\n            throw new InvalidOperationException(\n                $\"Could not parse Helm version from 'helm version --short' output: '{rawOutput}'. Aspire requires Helm {MinimumHelmVersion} or later. See {InstallDocsUrl}.\");\n        }\n\n        if (detected < MinimumHelmVersion)\n        {\n            throw new InvalidOperationException(\n                string.Format(\n                    CultureInfo.InvariantCulture,\n                    \"Helm {0} was detected, but Aspire requires Helm {1} or later to deploy Kubernetes resources. Upgrade Helm from {2}.\",\n                    detected,\n                    MinimumHelmVersion,\n                    InstallDocsUrl));\n        }\n    }\n\n    /// <summary>\n    /// Extracts the first <c>MAJOR.MINOR.PATCH</c> token from the given Helm version\n    /// output. Returns <see langword=\"false\"/> if no version token is present.\n    /// </summary>\n    internal static bool TryParseHelmVersion(string output, out Version version)\n    {\n        version = new Version(0, 0, 0);\n        if (string.IsNullOrWhiteSpace(output))\n        {","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Hosting.Kubernetes/Deployment/HelmVersionValidator.cs#L84-L120","documentation":"Thrown when Helm is found and its version parses successfully, but the detected version is older than Aspire's minimum (4.2.0). The message formats detected version, required minimum, and the install-docs URL. Deployment cannot proceed because Aspire's Helm templating/destroy flows rely on Helm 4.x behavior.","triggerScenarios":"EnsureMinimumVersionAsync parses 'helm version --short' output into a Version and compares detected < MinimumHelmVersion (4.2.0); any helm 3.x or helm 4.0/4.1 install triggers this when deploying Kubernetes resources through the Helm deployment engine.","commonSituations":"Distros/CI images pinning helm 3.x via apt (helm3 packages); developers who installed helm long ago and never upgraded; using a package-manager version lagging upstream; projects recently migrated to Aspire's Kubernetes publishing that requires Helm 4.2+.","solutions":["Upgrade Helm to 4.2.0 or later from https://helm.sh/docs/intro/install/ (replace the binary or use your package manager: 'brew upgrade helm', 'choco upgrade kubernetes-helm', etc.).","Verify the upgrade with 'helm version --short' showing v4.2.0+ before rerunning the deploy.","Remove stale helm3 packages ('apt remove helm3' / old 'helm' from distro repos) that shadow the newer binary on PATH."],"exampleFix":"// before\n$ helm version --short\nv3.14.0+...\n// after\n$ brew upgrade helm\n$ helm version --short\nv4.2.0+...","handlingStrategy":"validation","validationCode":"// Check the version before deploying:\nvar raw = await CaptureAsync(\"helm version --short\");\nvar m = System.Text.RegularExpressions.Regex.Match(raw, @\"v?(\\d+)\\.(\\d+)\\.(\\d+)\");\nif (m.Success && new Version(int.Parse(m.Groups[1].Value), int.Parse(m.Groups[2].Value), int.Parse(m.Groups[3].Value)) < new Version(4, 2, 0))\n{\n    Console.Error.WriteLine(\"Helm >= 4.2.0 is required: https://helm.sh/docs/intro/install/\");\n}","typeGuard":null,"tryCatchPattern":"try\n{\n    await deployAsync();\n}\ncatch (InvalidOperationException ex) when (ex.Message.StartsWith(\"Helm \") && ex.Message.Contains(\"was detected, but Aspire requires\"))\n{\n    // Message contains detected version, required version, and upgrade URL.\n    Console.Error.WriteLine(ex.Message);\n}","preventionTips":["Upgrade Helm to 4.2.0+ before adopting Aspire Kubernetes publishing.","Remove distro 'helm3'/legacy helm packages that shadow newer installs on PATH.","Pin helm >= 4.2.0 in CI images and devcontainer features.","Add a version check to your CI setup step so staleness fails early with a clear message."],"tags":["helm","version-check","upgrade-required","kubernetes"],"backgroundTag":"tool-version-too-old","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"}