Bug 1953982

Summary: pulp3: Capsule docker sync fails because digest in the reposnse header does not contain sha256 algorithm
Product: Red Hat Satellite Reporter: Ina Panova <ipanova>
Component: PulpAssignee: Justin Sherrill <jsherril>
Status: CLOSED ERRATA QA Contact: Vladimír Sedmík <vsedmik>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.9.0CC: ggainey, juwatts, rchan, ttereshc, vsedmik, zhunting
Target Milestone: 6.9.2Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pulp_container-2.1.2,tfm-rubygem-katello-3.18.1.29-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-20 18:05:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1953984    

Description Ina Panova 2021-04-27 10:57:50 UTC
Description of problem:

During capsule sync  when shcma1 is requested pulp3 returns just
'7d0b1bbae291fbdaaa022e82da4addea932df9fa628493a2e3b31d3bd4443917'in the response `docker-content-digest` header.

This throws an error in pulp2:


  Traceback (most recent call last):
    File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line
367, in trace_task
      R = retval = fun(*args, **kwargs)
    File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py",
line 688, in __call__
      return super(Task, self).__call__(*args, **kwargs)
    File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py",
line 110, in __call__
      return super(PulpTask, self).__call__(*args, **kwargs)
    File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line
622, in __protected_call__
      return self.run(*args, **kwargs)
    File
"/usr/lib/python2.7/site-packages/pulp/server/controllers/repository.py",
line 802, in sync
      sync_report = sync_repo(transfer_repo, conduit, call_config)
    File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py",
line 905, in wrap_f
      return f(*args, **kwargs)
    File
"/usr/lib/python2.7/site-packages/pulp_docker/plugins/importers/importer.py",
line 86, in sync_repo
      return self.sync_step.process_lifecycle()
    File
"/usr/lib/python2.7/site-packages/pulp/plugins/util/publish_step.py",
line 573, in process_lifecycle
      super(PluginStep, self).process_lifecycle()
    File
"/usr/lib/python2.7/site-packages/pulp/plugins/util/publish_step.py",
line 164, in process_lifecycle
step.process()
    File
"/usr/lib/python2.7/site-packages/pulp/plugins/util/publish_step.py",
line 257, in process
self._process_block()
    File
"/usr/lib/python2.7/site-packages/pulp/plugins/util/publish_step.py",
line 304, in _process_block
self.process_main()
    File
"/usr/lib/python2.7/site-packages/pulp_docker/plugins/importers/sync.py",
line 231, in process_main
      manifests = self.parent.index_repository.get_manifest(tag)
    File
"/usr/lib/python2.7/site-packages/pulp_docker/plugins/registry.py", line
409, in get_manifest
      digest = self._digest_check(response_headers, manifest)
    File
"/usr/lib/python2.7/site-packages/pulp_docker/plugins/registry.py", line
436, in _digest_check
      digest = models.Manifest.calculate_digest(manifest,
expected_digest.split(':')[0])
    File
"/usr/lib/python2.7/site-packages/pulp_docker/plugins/models.py", line
142, in calculate_digest
      hasher = getattr(hashlib, algorithm)
  AttributeError: 'module' object has no attribute
'7d0b1bbae291fbdaaa022e82da4addea932df9fa628493a2e3b31d3bd4443917'


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:
response docker-content-digest header should contain "sha256:<hash>"

Expected results:


Additional info:

Comment 1 pulp-infra@redhat.com 2021-04-29 10:09:49 UTC
The Pulp upstream bug status is at ASSIGNED. Updating the external tracker on this bug.

Comment 2 pulp-infra@redhat.com 2021-04-29 10:09:51 UTC
The Pulp upstream bug priority is at Normal. Updating the external tracker on this bug.

Comment 3 pulp-infra@redhat.com 2021-05-03 17:36:29 UTC
The Pulp upstream bug status is at POST. Updating the external tracker on this bug.

Comment 4 pulp-infra@redhat.com 2021-05-04 10:07:39 UTC
The Pulp upstream bug status is at MODIFIED. Updating the external tracker on this bug.

Comment 5 pulp-infra@redhat.com 2021-05-04 11:05:54 UTC
All upstream Pulp bugs are at MODIFIED+. Moving this bug to POST.

Comment 6 pulp-infra@redhat.com 2021-05-04 15:07:04 UTC
The Pulp upstream bug status is at CLOSED - CURRENTRELEASE. Updating the external tracker on this bug.

Comment 7 Justin Sherrill 2021-05-07 12:54:31 UTC
Connecting redmine issue https://projects.theforeman.org/issues/32426 from this bug

Comment 8 Vladimír Sedmík 2021-05-07 12:56:14 UTC
Missing https://projects.theforeman.org/issues/32426

Comment 9 Justin Sherrill 2021-05-07 12:59:38 UTC
this was missing a katello change that is needed.  hooked up to https://projects.theforeman.org/issues/32426

Comment 10 Ina Panova 2021-05-07 15:42:28 UTC
Steps to verify:
1. create and sync in pulp3 "foreman/busybox-test" from quay.io
2. Confirm that in the repo there is one manifest of schema2 and it points to tag name 'latest' (introspect pulp3 repo)
3. trigger capsule sync, it should succeed.

Comment 12 Vladimír Sedmík 2021-05-11 14:58:19 UTC
Using the steps in comment#10 verified on SAT 6.9.2 snap 3:
tfm-rubygem-pulp_container_client-2.1.0-1.el7sat.noarch
tfm-rubygem-katello-3.18.1.29-1.el7sat.noarch

Comment 17 errata-xmlrpc 2021-05-20 18:05:29 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Satellite 6.9.2 Async Bug Fix Update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:2074