Project

Profile

Help

Issue #8686

Migrating one plugin removes publications/distributions of others.

Added by ttereshc 6 months ago. Updated 4 months ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Assignee:
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Platform Release:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

To reproduce:

  • have iso and rpm repos in pulp2
  • migrate one plugin
  • then migrate another plugin

Observe that content app shows only repositories of the last migrated plugin.

Not sure when it was introduced but it was not this way right from the start. As a part of the fix, there should be a test added to check that scenario.

Repositories and content are not removed, so the workaround is to publish all repositories of the first migrated plugin.

Associated revisions

Revision 66984546 View on GitHub
Added by ttereshc 5 months ago

Remove relations only for plugins specified in the plan

closes #8686 https://pulp.plan.io/issues/8686

Revision 66984546 View on GitHub
Added by ttereshc 5 months ago

Remove relations only for plugins specified in the plan

closes #8686 https://pulp.plan.io/issues/8686

Revision 66984546 View on GitHub
Added by ttereshc 5 months ago

Remove relations only for plugins specified in the plan

closes #8686 https://pulp.plan.io/issues/8686

Revision b99077f6 View on GitHub
Added by ttereshc 4 months ago

Remove relations only for plugins specified in the plan

closes #8686 https://pulp.plan.io/issues/8686

Revision b99077f6 View on GitHub
Added by ttereshc 4 months ago

Remove relations only for plugins specified in the plan

closes #8686 https://pulp.plan.io/issues/8686

Revision b99077f6 View on GitHub
Added by ttereshc 4 months ago

Remove relations only for plugins specified in the plan

closes #8686 https://pulp.plan.io/issues/8686

History

#1 Updated by ggainey 6 months ago

With a not-latest migration, pulp_file, and pulp_rpm, I was getting the following error at migration:

May 03 19:16:42 pulp2-nightly-pulp3-source-centos7.padre-fedora.example.com rq[29529]: ValueError: Cannot assign "<FileDistribution: 60904a369119923276d5850e-iso>": "Pulp2Distributor.pulp3_distribution" must be a "BaseDistribution" instance.

Once I updated all my repos, I was able migrate ISO followed by migrating RPM, and the repos were both served by the content-app.

Output of my experiment-run below.

(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 ~]$ pulp-admin rpm repo list
+----------------------------------------------------------------------+
                            RPM Repositories
+----------------------------------------------------------------------+

Id:                  rpm
Display Name:        None
Description:         None
Content Unit Counts: 
  Erratum:           4
  Package Category:  1
  Package Group:     2
  Package Langpacks: 1
  Rpm:               35


(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 ~]$ pulp-admin iso repo list
+----------------------------------------------------------------------+
                            ISO Repositories
+----------------------------------------------------------------------+

Id:                  iso
Display Name:        None
Description:         None
Content Unit Counts: 
  Iso: 3

(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 ~]$ http :/pulp/content/

        <!DOCTYPE html>
        <html>
            <body>
                <ul>             
                </ul>
            </body>
        </html>
        
(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 ~]$ pulp migration plan create --plan '{"plugins": [{"type": "iso"}]}'
{
  "pulp_href": "/pulp/api/v3/migration-plans/1ecb31e7-2687-4209-808a-da56474d1a05/",
  "pulp_created": "2021-05-03T20:13:48.938862Z",
  "plan": {
    "plugins": [
      {
        "type": "iso"
      }
    ]
  }
}

(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 ~]$ pulp migration plan run --href /pulp/api/v3/migration-plans/1ecb31e7-2687-4209-808a-da56474d1a05/
Started background task /pulp/api/v3/tasks/e3678b75-6522-4d6f-83ab-9491ccc7c36e/
.Done.
(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 ~]$ http :/pulp/content/

        <!DOCTYPE html>
        <html>
            <body>
                <ul>                
                    <li><a href="iso/">iso/</a></li>                
                </ul>
            </body>
        </html>
        
(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 ~]$ pulp migration plan create --plan '{"plugins": [{"type": "rpm"}]}'
{
  "pulp_href": "/pulp/api/v3/migration-plans/ac527a1f-dc2a-4839-892e-f07ef971aa56/",
  "pulp_created": "2021-05-03T20:14:15.641048Z",
  "plan": {
    "plugins": [
      {
        "type": "rpm"
      }
    ]
  }
}

(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 ~]$ pulp migration plan run --href /pulp/api/v3/migration-plans/ac527a1f-dc2a-4839-892e-f07ef971aa56/
Started background task /pulp/api/v3/tasks/cea4eb37-a5fa-4139-934e-5394167f1306/
...Done.
(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 ~]$ http :/pulp/content/

        <!DOCTYPE html>
        <html>
            <body>
                <ul>                
                    <li><a href="iso/">iso/</a></li>                
                    <li><a href="rpm-signed/">rpm-signed/</a></li>                
                </ul>
            </body>
        </html>
        
(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 ~]$ 

#2 Updated by ipanova@redhat.com 6 months ago

@grant theBaseDistribution error is related to tthe compatibility with core 3.12 https://pulp.plan.io/issues/8522#note-2

#3 Updated by ttereshc 5 months ago

I can still reproduce it on my system :( which is basically katello 3.18 versions

{
  "versions": [
    {
      "component": "pulpcore",
      "version": "3.7.7.dev0"
    },
    {
      "component": "pulp_file",
      "version": "1.3.1.dev0"
    },
    {
      "component": "pulp_container",
      "version": "2.1.2.dev0"
    },
    {
      "component": "pulp_2to3_migration",
      "version": "0.12.0.dev0"
    },
    {
      "component": "pulp_rpm",
      "version": "3.11.1.dev0"
    }
  ],

#4 Updated by ttereshc 5 months ago

I think the root cause is in tracking migration plan relations badly. It was introduced in 0.9.0 with this commit https://github.com/pulp/pulp-2to3-migration/commit/6173a64d62bad465c6789d08613c07c7f205a846

#5 Updated by ttereshc 5 months ago

  • Status changed from NEW to POST
  • Assignee set to ttereshc

#6 Updated by ttereshc 5 months ago

  • Status changed from POST to MODIFIED

#7 Updated by ttereshc 4 months ago

  • Sprint/Milestone set to 0.11.2

#8 Updated by pulpbot 4 months ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF