Deploy and unregister --rm-data silently destroy another instance's ExApp container and volume when two Nextclouds share one Docker daemon
I maintainer di solito rispondono entro 3 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 65/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- docker, kubernetes, php
- Ambito
- devops, infrastructure
Direzione di ricerca
Inizia da DockerActions.php:138 e :81-88, quindi esamina i percorsi di rimozione in Unregister.php:106 e :135-139, ExAppsPageController.php:494-500 e AppAPIService.php:806/809. Confronta questi percorsi con la gestione dell’etichetta dell’istanza in haproxy_agent.py:2374. Il lavoro è completato quando i container e i volumi Docker riportano un’identità dell’istanza e la rimozione rifiuta di eliminare le risorse appartenenti a un’altra istanza, preservando la pulizia della stessa istanza.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
We lost the data volume of a working ExApp because a second Nextcloud instance on the same host uninstalled its own copy of the same app.
Setup: two Nextcloud instances (a real one and a throwaway test instance), each with its own HaRP, both pointing at the same Docker daemon. Container and volume names are built from the app id alone (nc_app_<appid>, nc_app_<appid>_data), so both instances resolved to the same container and the same volume.
Two things happened, and I think both deserve a look:
- Deploying the app on instance B force-removed the running container of instance A and recreated it with B's
APP_SECRETandNEXTCLOUD_URL(DockerActions.php:138on the HaRP path,:81-88on the classic one). A's app was broken from that moment, without any warning. occ app_api:app:unregister <appid> --rm-dataon B then deleted the shared volume. For us that was a search index over 50,000 files, roughly 19 hours of rebuild. Docker's own "volume is in use" protection could not help because step 1 had already removed the container that held it.
None of the removal paths checks who created the container or volume: the occ command (Unregister.php:106 and :135-139), the admin UI (ExAppsPageController.php:494-500), and removing a deploy daemon (AppAPIService.php:806/809), which deletes volumes without any flag at all.
I know about #523 and this is deliberately not another naming ticket: even with an instance prefix in place, existing volumes stay unprefixed and the removal paths still delete blindly. It is also not the multitenancy request from nextcloud/HaRP#49, rather the opposite: we do not want to share a container between instances, we want two independent deployments to stop destroying each other.
A fix that would have saved us, and that looks backportable: set labels on container and volume at create time (for example nextcloud.appapi.instance_id) and make the removal paths refuse when the label points to a different instance. Right now the Docker path sets no labels at all, while the Kubernetes path already sets app.kubernetes.io/instance from instance_id (haproxy_agent.py:2374), so the pattern exists in the codebase.
Observed with Nextcloud 34.0.3, AppAPI with HaRP 0.4.5, Docker on Ubuntu (arm64). Happy to share the full logs with timestamps.
- Lingua principale
- PHP
- Stelle
- 198
- Fork
- 26
- Merge medio
- 2g 6h
- PR unite (30g)
- 48
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nextcloud/app_api
-
Daemon delete dialog: "Remove all ExApps" checkbox and `removeExApps` parameter have no effectAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
nextcloud/app_api#1099 · 1 commento ·
I maintainer di solito rispondono entro 3 giorni
-
deploy discussion enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
nextcloud/app_api#1013 · 2 commenti ·
I maintainer di solito rispondono entro 3 giorni
-
daemon enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di nextcloud/app_api
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
L: java:gradle L: java:maven L: ruby:bundler T: bug 🐞
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
dependabot/dependabot-core#16547 ·
I maintainer di solito rispondono entro 1 giorno
-
cloning objets from planningAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
glpi-project/glpi#25922 ·
I maintainer di solito rispondono entro 1 giorno
-
Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Automattic/safe-publish#726 ·
I maintainer di solito rispondono entro 1 giorno
-
[Translation][TwigBridge][TwigBundle] Add `HtmlTranslator` and the `tra…Forse già presa Una pull request collegata a questa issue è aperta o già unita. ApertaTranslation TwigBridge
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
symfony/symfony-docs#23308 ·
I maintainer di solito rispondono entro 3 giorni