Bug 1929393

Summary: pulp3: 'NoneType' object has no attribute 'cast' on metadata_checksum_type
Product: Red Hat Satellite Reporter: Tanya Tereshchenko <ttereshc>
Component: PulpAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Lai <ltran>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.9.0CC: bmbouter, ggainey, ipanova, juwatts, pcreech, rchan, ttereshc, zhunting
Target Milestone: 6.9.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-21 13:10:34 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:

Description Tanya Tereshchenko 2021-02-16 19:11:16 UTC
Description of problem:

'NoneType' object has no attribute 'cast'
    "traceback": "  File \"/usr/lib/python3.6/site-packages/rq/worker.py\", line 936, in perform_job
    rv = job.perform()
  File \"/usr/lib/python3.6/site-packages/rq/job.py\", line 684, in perform
    self._result = self._execute()
  File \"/usr/lib/python3.6/site-packages/rq/job.py\", line 690, in _execute
    return self.func(*self.args, **self.kwargs)
  File \"/usr/lib/python3.6/site-packages/pulp_2to3_migration/app/tasks/migrate.py\", line 136, in migrate_from_pulp2
    pre_migrate_all_without_content(plan, type_to_repo_ids, repo_id_to_type)
  File \"/usr/lib/python3.6/site-packages/pulp_2to3_migration/app/pre_migration.py\", line 384, in pre_migrate_all_without_content
    repo_id, distributors_repos, distributor_migrators, repo)
  File \"/usr/lib/python3.6/site-packages/pulp_2to3_migration/app/pre_migration.py\", line 556, in pre_migrate_distributor
    needs_new_publication = dist_migrator.needs_new_publication(distributor)
  File \"/usr/lib/python3.6/site-packages/pulp_2to3_migration/app/plugin/rpm/repository.py\", line 105, in needs_new_publication
    current_checksum_type = pulp2distributor.pulp3_publication.cast().metadata_checksum_type

from:

https://community.theforeman.org/t/contentmigration-migration-fails-with-error-katello-nonetype-object-has-no-attribute-cast/21828/10


The issue occurs when:

 * pre-migration for a distributor happened, but migration did not
 * then pulp2 distributor changed
 * then migration plan was run again

Comment 1 pulp-infra@redhat.com 2021-02-16 20:06:35 UTC
The Pulp upstream bug status is at MODIFIED. Updating the external tracker on this bug.

Comment 2 pulp-infra@redhat.com 2021-02-16 20:06:36 UTC
The Pulp upstream bug priority is at Normal. Updating the external tracker on this bug.

Comment 3 pulp-infra@redhat.com 2021-02-16 21:05:42 UTC
All upstream Pulp bugs are at MODIFIED+. Moving this bug to POST.

Comment 4 pulp-infra@redhat.com 2021-02-18 21:05:50 UTC
The Pulp upstream bug status is at CLOSED - CURRENTRELEASE. Updating the external tracker on this bug.

Comment 6 Lai 2021-03-22 21:17:57 UTC
The nonetype issue was experienced on both dogfood and customer db.  I have ran migration on both instance and they have migrated successfully therefore this issue does not show up.

Verified on 6.9.0_17, python3-pulp-2to3-migration-0.9.1-1.el7pc.noarch

Comment 9 errata-xmlrpc 2021-04-21 13:10:34 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 (Moderate: Satellite 6.9 Release), 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/RHSA-2021:1313