mirror update lacks a way to continue when package import fails due to missing files
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Start by reading the aptly mirror update implementation and tracing what happens when a downloaded package is missing at import time. The issue does not identify specific files or tests, so locate the relevant code and existing mirror-update tests first. Done means one missing package no longer aborts the full update, and the missing package is reported or marked as failed.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Our environment enforces the use of a malware scanner (Microsoft Defender Advanced Threat Protection).
During aptly mirror update, the scanner may immediately delete freshly downloaded .deb files if they are deemed problematic. This happens after the download completes but before aptly imports the file into its pool/db.
When this occurs, aptly aborts the entire mirror update with an error like:
Downloading: http://ch.archive.ubuntu.com/ubuntu/pool/universe/e/ettercap/ettercap-common_0.8.2-10build4_amd64.deb
[...]
ERROR: unable to import file: open /srv/aptly/.aptly/pool/fc/49/6661-493f-4245-b878-5cd1565065daettercap-common_0.8.2-10build4_amd64.deb: no such file or directory
(There are several such packages per distro and pocket)
Minimal reproduction
- Start a mirror update:
sudo -u aptly aptly mirror update bionic-orig-main-test - Some .deb are downloaded successfully.
- The problematic .deb file is being downloaded.
- An external malware scanner deletes the file immediately upon download completion.
- aptly attempts to import the file and aborts the update.
Observed behavior
- The mirror update stops at the first such incident.
- The order of package downloads appears nondeterministic.
- As a result, repeated invocations of
aptly mirror updatestop at different points, leaving a large and unpredictable set of packages not downloaded. - There is currently no way to:
- continue the update
- downgrade this specific failure to a warning
- complete the rest of the download queue
Expected / desired behavior
In environments where files can be externally removed (malware scanners, filesystem policies, etc.), it would be useful if aptly could:
- Continue the mirror update when a downloaded package file is missing at import time
- Report the missing packages at the end of the run (or mark them as failed)
- Avoid aborting the entire update for a single missing file
This could be implemented, for example, as:
- a flag such as
--continue-on-import-error - or a mirror option to treat missing package files as non-fatal
Rationale
In our case, excluding the aptly pool directory from malware scanning is not an option. From a security standpoint, it is acceptable (and even desirable) that certain packages never make it into the mirror. However, the current behavior forces us to repeatedly re-run mirror updates until “by chance” all non-blocked packages are downloaded.
This makes it difficult to maintain a consistent and predictable mirror state in hardened environments.
The current behavior also makes it impossible to detect which packages are systematically blocked by the scanner, because the update stops before the full download queue is processed.
- Lingua principale
- Go
- Stelle
- 2.9k
- Fork
- 436
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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 aptly-dev/aptly
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 54/100
Tutte le issue di aptly-dev/aptly
Issue simili
-
consensus feature I2 S4 U2
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug] [Go] Ack returns nil when the server answers with a non-OK statusForse già presa @leizhiyuan l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
apache/rocketmq-clients#1465 ·
I maintainer di solito rispondono entro 2 giorni
-
Priority/Low Type/Improvement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
OpenNSW/nsw-srilanka#906 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
praetorianer777/Dynamo#57 ·
I maintainer di solito rispondono entro 1 giorno
-
fix(handlers): explicitly set Content-Type header in static Index handlerForse già presa @kage-zero l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno