Skip to content

app-service: install on upgrade when the helm release is missing#3438

Closed
pengpeng wants to merge 1 commit into
mainfrom
fix/app-service-upgrade-install-on-missing-release
Closed

app-service: install on upgrade when the helm release is missing#3438
pengpeng wants to merge 1 commit into
mainfrom
fix/app-service-upgrade-install-on-missing-release

Conversation

@pengpeng

Copy link
Copy Markdown
Member
  • Background

When an app's helm release no longer exists but the ApplicationManager still believes the app is installed (orphaned/incomplete prior install), an upgrade fails early in UpgradingApp.exec at GetDeployedReleaseVersion with release: not found and drops the app into upgradeFailed. From there upgrade keeps hitting the same error and there is no clean CLI recovery path.

This PR makes upgrade self-heal a vanished release instead of erroring:

  • upgrading_app.go: tolerate driver.ErrReleaseNotFound from GetDeployedReleaseVersion (don't return early), and skip the >= deployed version guard when there is no deployed release.
  • helm.UpgradeCharts: mirror helm upgrade --install. helm's action.Upgrade.Run does not honor the Install field (that behavior lives in helm's CLI layer), so probe the release history and fall back to InstallCharts when it returns driver.ErrReleaseNotFound.

go build ./... and go vet ./pkg/helm/... ./pkg/appstate/... pass. (The helm path has no cluster-backed unit tests.)

  • Target Version for Merge

main

  • Related Issues

N/A

  • PRs Involving Sub-Systems

This is approach B (root-cause fix: upgrade reinstalls a missing release, so upgradeFailed never happens for a vanished release). Approach A#3437 — makes upgradeFailed recoverable via install from the state machine side. The two are independent and can coexist; opened both so maintainers can pick the preferred direction (or take both).

  • Other information:

app-service is a core component; the change takes effect after app-service is rebuilt/redeployed.

Made with Cursor

An upgrade of an app whose helm release no longer exists (e.g. the release was
lost while the ApplicationManager still believes the app is installed) fails
with "release: not found" and drops the app into upgradeFailed, with no clean
recovery path.

Make upgrade self-heal a vanished release:
- upgrading_app.go: tolerate driver.ErrReleaseNotFound from
  GetDeployedReleaseVersion instead of returning early; skip the
  ">= deployed version" guard when there is no deployed release.
- helm.UpgradeCharts: mirror `helm upgrade --install`. action.Upgrade.Run does
  not honor the Install field (that lives in helm's CLI layer), so probe the
  release history and fall back to InstallCharts when it is ErrReleaseNotFound.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Jun 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
olares Ready Ready Preview, Comment Jun 21, 2026 10:23am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
olares-docs Ignored Ignored Jun 21, 2026 10:23am

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2f41098. Configure here.

ctrl.Log.Info("helm release not found on upgrade; installing instead",
"appName", appName, "namespace", namespace)
return InstallCharts(ctx, actionConfig, settings, appName, chartName, repoURL, namespace, vals)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

History errors silently ignored

Medium Severity

In UpgradeCharts, when hist.Run returns an error other than driver.ErrReleaseNotFound, that error is dropped and execution continues to runUpgrade. Elsewhere (e.g. HelmClient.IsInstalled, clearHelmHistory) non–not-found history failures are returned immediately, so callers may see a misleading upgrade failure or miss the install fallback when storage is unavailable.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2f41098. Configure here.

@pengpeng pengpeng closed this Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant