A failed `app_api:app:update` command can leave the ExApp stopped with no way to retry

Offen
#1,234 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
42/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
kubernetes, php
Bereich
backend, devops

Rechercherichtung

Start with lib/Command/ExApp/Update.php, especially the update sequence around lines 166–203 linked in the report. Trace how image pulling, container replacement, heartbeat checks, and metadata writes are handled, then check the Kubernetes path because the issue says its update flow may differ. Done means a failed update leaves the old ExApp usable and retryable, while a successful update commits the new metadata and removes the old container.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

bug deploy docker
Describe the bug

The command disables and stops the app, replaces its routes and translations, and writes the new version to the database. It only pulls and deploys the new image after all of that:
https://github.com/nextcloud/app_api/blob/634729d75dbca75a76dada69962e5bf99154a149/lib/Command/ExApp/Update.php#L166-L203

This results in the ex-app being down for the time the image is downloaded, and if the pull fails, the metadata is already lost, and the previous ex-app is left disabled.
The ex-app cannot be updated now since the metadata says it's already updated. The only way to update it is to unregister+register it.

A possible order:

  • Pull the new image first, before touching the running app.
  • Stop the old container and rename it instead of removing it, then start the new one.
  • Only after the heartbeat passes, write the version, routes and translations and remove the old container.
  • If any step fails, restore the old container.

For kubernetes things could look different, I'm not sure.

Steps/Code to Reproduce

/

Expected Results

/

Actual Results

/

Setup configuration

app_api = 36.0.0-dev.0
nextcloud = 36.0.0

Vorherrschende Sprache
PHP
Sterne
202
Forks
30
Ø Merge
3 T. 20 Std.
Gemergte PRs (30 T.)
24

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus nextcloud/app_api

Alle Issues in nextcloud/app_api

Ähnliche Issues

Weitere Issues zu PHP

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.