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

Aberta
#1,234 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
42/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
kubernetes, php
Domínio
backend, devops

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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

Linguagem predominante
PHP
Estrelas
202
Forks
30
Merge médio
3d 20h
PRs com merge (30d)
24

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de nextcloud/app_api

Todas as issues de nextcloud/app_api

Issues semelhantes

Mais issues de PHP

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.