Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2038742 - pulp3 content migration failed with "Katello::Errors::Pulp3Error: local variable 'item' referenced before assignment"
Summary: pulp3 content migration failed with "Katello::Errors::Pulp3Error: local varia...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Pulp
Version: 6.9.8
Hardware: All
OS: Unspecified
high
high
Target Milestone: 6.9.9
Assignee: satellite6-bugs
QA Contact: Lai
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-10 00:12 UTC by matt jia
Modified: 2022-08-01 23:34 UTC (History)
10 users (show)

Fixed In Version: pulp-2to3-migration-0.11.9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-04-20 20:34:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github pulp pulp-2to3-migration issues 497 0 None closed migration docker repos failed with "local variable 'item' referenced before assignment" 2022-02-14 21:48:04 UTC
Red Hat Product Errata RHSA-2022:1478 0 None None None 2022-04-20 20:35:01 UTC

Description matt jia 2022-01-10 00:12:15 UTC
Description of problem:

As $summary, migration docker repos failed with:

  error:
    traceback: |2
        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 81, in migrate_from_pulp2
          migrate_content(plan, skip_corrupted=skip_corrupted)
        File "/usr/lib/python3.6/site-packages/pulp_2to3_migration/app/migration.py", line 55, in migrate_content
          plugin.migrator.migrate_content_to_pulp3(skip_corrupted=skip_corrupted)
        File "/usr/lib/python3.6/site-packages/pulp_2to3_migration/app/plugin/docker/migrator.py", line 106, in migrate_content_to_pulp3
          loop.run_until_complete(dm.create())
        File "/usr/lib64/python3.6/asyncio/base_events.py", line 484, in run_until_complete
          return future.result()
        File "/usr/lib/python3.6/site-packages/pulp_2to3_migration/app/plugin/content.py", line 89, in create
          await pipeline
        File "/usr/lib/python3.6/site-packages/pulpcore/plugin/stages/api.py", line 225, in create_pipeline
          await asyncio.gather(*futures)
        File "/usr/lib/python3.6/site-packages/pulpcore/plugin/stages/api.py", line 43, in __call__
          await self.run()
        File "/usr/lib/python3.6/site-packages/pulp_2to3_migration/app/plugin/docker/migrator.py", line 154, in run
          thru = self.relate_manifest_to_list(dc)
        File "/usr/lib/python3.6/site-packages/pulp_2to3_migration/app/plugin/docker/migrator.py", line 234, in relate_manifest_to_list
          thru = ManifestListManifest(manifest_list=item, image_manifest=dc.content,
    description: local variable 'item' referenced before assignment
 

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

6.9

How reproducible:

on customer site

Steps to Reproduce:

1.  satellite-maintain content prepare

Actual results:

Migration failed with above error.


Expected results:

Migration should complete without error.

Additional info:

Comment 1 Sayan Das 2022-01-28 14:13:44 UTC
A) This seems to have been or are being addressed in upstream

migration docker repos failed with "local variable 'item' referenced before assignment" · Issue #497 · pulp/pulp-2to3-migration · GitHub
https://github.com/pulp/pulp-2to3-migration/issues/497

Fixes #497 - local variable 'item' referenced before assignment · pulp/pulp-2to3-migration@72a6325 · GitHub
https://github.com/pulp/pulp-2to3-migration/commit/72a632553cf131b5aa20f40aefb2eefdee2cff21



B) every time this traceback has come, just before that pulp complained about missing or corrupted blobs. Further investigation of those blobs revealed, That they are part of the same repo and they are indeed missing from filesystem.

   I also had dig into docker manifests and found many of them corrupted as well. Not sure if they are related to the same blobs or not but there is a good possibility they are. Further information will be added in the later comments.

Comment 6 Grant Gainey 2022-02-17 13:42:54 UTC
Fix backported to pulp-2to3-migration 0.11.9

Comment 7 Lai 2022-03-23 21:58:24 UTC
Hey guys,

Is there a sample docker repo I can use to test this migration or is any docker fine?

Comment 8 Sayan Das 2022-03-23 22:09:22 UTC
Hello Lai,

I doubt if I know of a sample repo but maybe Matt ( reporter ) does.

Can you check with him once if he were able to reproduce this issue via any specific repo  initially ?


-- Sayan

Comment 9 Lai 2022-03-24 19:10:00 UTC
Hey Matt,

Was there a specific repo that was used for this bz?  I would like to use it for verification if there is one.

-Lai

Comment 13 Lai 2022-04-12 15:00:41 UTC
Steps to retest:

1. Sync some docker files: small, medium, and large docker files
2. Perform migration
3. check results

2nd set of test:
1. sync some docker files: small, medium, and large docker files
2. delete some docker blobs in /var/lib/pulp/content/units/ <either docker_manifest or docker_blob>
3. perform migration


Expected results:
Migration should complete successfully

Actual:
Migration does complete successfully

I also checked the dynflow and the results on UI.  It seems to work fine.

Verified on 6.9.9 snap 2

Comment 17 errata-xmlrpc 2022-04-20 20:34:53 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 (Important: Satellite 6.9.9 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/RHSA-2022:1478


Note You need to log in before you can comment on or make changes to this bug.