Migration failures due to list/indexes with broken child manifests
Context
Found during gitlab#350920 (closed).
Problem
While migrating existing repositories we noticed a few pre-imports failing due to manifests lists with broken child manifest revisions. These can be found by looking for a migration error has the following one:
1 error occurred:
* pre importing tagged manifests: pre importing manifest: pre importing manifest list: retrieving referenced manifest "sha256:1187cd55213884b549c2054a0a80decc51e452ed37d5b365e9c8b1e5eff13d05" from filesystem: unknown manifest name=some/repo revision=sha256:1187cd55213884b549c2054a0a80decc51e452ed37d5b365e9c8b1e5eff13d05
Upon further inspection (looking at the manifest payloads), most of these manifest lists seems to be buildkit cache images, which have caused other problems in the past (e.g. #407 (closed)).
However, I also find multiple instances of simple Docker v2 manifest lists (sample). Looking into these, I can see that pulling the referenced manifest directly leads to a 404 Not Found
, which means pulling the list from a machine with the "right" architecture will lead to the same error. So these are essentially broken.
Solution
The error highlights that the manifests referenced in the list/index do not have a revision in the corresponding repository. Regardless of the reason, this essentially means that these images are broken.
We'll skip repositories with such images during the migration.