Geo: Images without mediaType fail to replicate with error "Container repository sync failed: Unexpected mediaType:"
Summary
Images without mediaType fail to replicate with error "Container repository sync failed: Unexpected mediaType:"
. While checking, I also found that Running ContainerRepository.find(ID).manifest.inspect
doesn't return the tags that have the above media type.
This issue was created from https://gitlab.com/gitlab-com/geo-customers/-/issues/106 and ZD ticket (both internal).
Steps to reproduce
Steps available in https://gitlab.com/gitlab-com/geo-customers/-/issues/106#note_1214914649 (internal).
Example Project
What is the current bug behavior?
Container repositories with the above media type won't replicate.
What is the expected correct behavior?
Container repositories with the above media type should replicate.
Relevant logs and/or screenshots
Sample manifest output of a problematic tag:
irb(main):005:0>container_repository = ContainerRepository.find_by_id(<CONTAINER_REPOSITORY_ID>)
###
irb(main):006:0>repository_path = container_repository.path
###
irb(main):007:0>client = ContainerRegistry::Client.new(Gitlab.config.geo.registry_replication.primary_api_url, token: ::Auth::ContainerRegistryAuthenticationService.pull_access_token(repository_path))
###
irb(main):008:0> manifest = client.repository_raw_manifest(repository_path, 'v3')
=> "{\"schemaVersion\":2,\"config\":{\"mediaType\":\"application/vnd.oci.image.config.v1+json\",\"digest\":\"sha256:0e64dbff72378fcf6815c9bf99ceb747061b...
irb(main):009:0> manifest_parsed = Gitlab::Json.parse(manifest)
=> {"schemaVersion"=>2, "config"=>{"mediaType"=>"application/vnd.oci.image.config.v1+json", "digest"=>"sha256:0e64dbff72378fcf6815c9bf99ceb747061b095a5c...
irb(main):010:0> puts manifest_parsed
{"schemaVersion"=>2, "config"=>{"mediaType"=>"application/vnd.oci.image.config.v1+json", "digest"=>"sha256:0e64dbff72378fcf6815c9bf99ceb747061b095a5c5aabc671ede531841df8e5", "size"=>9299}, "layers"=>[{"mediaType"=>"application/vnd.oci.image.layer.v1.tar+gzip", "digest"=>"sha256:4315d93e6088983ee0af02d4dca2fb52d54178223927ca37764b791dc6f26935", "size"=>79639273}, {"mediaType"=>"application/vnd.oci.image.layer.v1.tar+gzip", "digest"=>"sha256:5bcaf7989b0148556c4d3cf4a0933e26dc8daab662616857dc45f57e66031360", "size"=>1874}, {"mediaType"=>"application/vnd.oci.image.layer.v1.tar+gzip", "digest"=>"sha256:dcc9681fb3f0f31b8fa24fe67caad8bb4e6fc6ce9331a5cccf6852c60cba80aa", "size"=>87058824}, {"mediaType"=>"application/vnd.oci.image.layer.v1.tar+gzip", "digest"=>"sha256:0fb22f89f50015d7410401ae920626391320c5f43af9c0c9eba03d613ae049f6", "size"=>6074341}, {"mediaType"=>"application/vnd.oci.image.layer.v1.tar+gzip", "digest"=>"sha256:48cb83c0c51922cbcc02c401d1f3a3f80541fdadc7bf2f066c3b7e8a792ec95f", "size"=>4818575}, {"mediaType"=>"application/vnd.oci.image.layer.v1.tar+gzip", "digest"=>"sha256:e71f5d69d121f91a328e2ca1a3bc88b258e27774b0586af9fece6be471c83130", "size"=>29578249}, {"mediaType"=>"application/vnd.oci.image.layer.v1.tar+gzip", "digest"=>"sha256:9aa5a577abbebc1edf091e85faaadf5d24008981113bf5c58dfca8827bedb474", "size"=>7276046}, {"mediaType"=>"application/vnd.oci.image.layer.v1.tar+gzip", "digest"=>"sha256:6ccdb36c8a1bb0059ddce3a85e1cfabe569d064f69fc35a2479a605ccdbb4c1f", "size"=>20112618}, {"mediaType"=>"application/vnd.oci.image.layer.v1.tar+gzip", "digest"=>"sha256:793af91ed4f79899b6e8022be73606dfb9ad87eeb8eb2d57321abdbdf3438a39", "size"=>10789728}, {"mediaType"=>"application/vnd.oci.image.layer.v1.tar+gzip", "digest"=>"sha256:181d55faa6515fa46d3751e482b5c08666b38e2d7feea8d19b21d5e1fa77c8d0", "size"=>9417855}, {"mediaType"=>"application/vnd.oci.image.layer.v1.tar+gzip", "digest"=>"sha256:17db85c709bd0c8947cc33ead6289bd0973ba6e7fa9e7b55b856e8012f6d65d0", "size"=>9196547}, {"mediaType"=>"application/vnd.oci.image.layer.v1.tar+gzip", "digest"=>"sha256:f4d5f7369bd810daffb5ab71a04cfad17bb3a2a332de74fac2a8e22cf5834ab6", "size"=>572}, {"mediaType"=>"application/vnd.oci.image.layer.v1.tar+gzip", "digest"=>"sha256:3420186ac988d33f4ada29875d2076f12e38647c582a51baa5ded98bb383793b", "size"=>2834}, {"mediaType"=>"application/vnd.oci.image.layer.v1.tar+gzip", "digest"=>"sha256:4ca545ee6d5db5c1170386eeb39b2ffe3bd46e5d4a73a9acbebc805f19607eb3", "size"=>42}, {"mediaType"=>"application/vnd.oci.image.layer.v1.tar+gzip", "digest"=>"sha256:ca1ad790e48b18497831f7e305b48ea705e7d7c9c0a5049037f2383e05ae2374", "size"=>26378}, {"mediaType"=>"application/vnd.oci.image.layer.v1.tar+gzip", "digest"=>"sha256:1c614c694e98e6fd547e03738cbbe06758779b016b238acdd971250b9d34dd00", "size"=>172}, {"mediaType"=>"application/vnd.oci.image.layer.v1.tar+gzip", "digest"=>"sha256:4ca545ee6d5db5c1170386eeb39b2ffe3bd46e5d4a73a9acbebc805f19607eb3", "size"=>42}, {"mediaType"=>"application/vnd.oci.image.layer.v1.tar+gzip", "digest"=>"sha256:1f3006fa7c2e41574fdddde0e1e9036f29f55d2effd02fc832b19d9af737951c", "size"=>1541160}, {"mediaType"=>"application/vnd.oci.image.layer.v1.tar+gzip", "digest"=>"sha256:309680c7280e0ba861aef0340acf0f07f3e551fc8dc101ee6b450fb5cf835454", "size"=>708599}, {"mediaType"=>"application/vnd.oci.image.layer.v1.tar+gzip", "digest"=>"sha256:93235323c908bc97fa5ca0fdd3feb3d2f8b4b6cae24f79e7c179f108ce62e469", "size"=>6897421}, {"mediaType"=>"application/vnd.oci.image.layer.v1.tar+gzip", "digest"=>"sha256:58b5451f787d2c8a9127c823d821cad3234a65ec50503174b681d75d06c686c0", "size"=>172}, {"mediaType"=>"application/vnd.oci.image.layer.v1.tar+gzip", "digest"=>"sha256:4ca545ee6d5db5c1170386eeb39b2ffe3bd46e5d4a73a9acbebc805f19607eb3", "size"=>42}, {"mediaType"=>"application/vnd.oci.image.layer.v1.tar+gzip", "digest"=>"sha256:212dc2d44460542a951dcc78e51ad2797372b341aaa352b1fe392695b39bdee4", "size"=>93861805}, {"mediaType"=>"application/vnd.oci.image.layer.v1.tar+gzip", "digest"=>"sha256:699742ca9d10699c0ecad3f1372a77835f5381dd594ad90b5d78422b5d9e00c3", "size"=>2835}], "annotations"=>{"org.opencontainers.image.base.digest"=>"sha256:3a41aacc1d097c55c6b65660c48425f1c019cfddc12e19d626fb57a2c9c45de6", "org.opencontainers.image.base.name"=>"registry.access.redhat.com/ubi7/ubi:latest"}}
=> nil
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)