Project

Profile

Help

Issue #8686

closed

Migrating one plugin removes publications/distributions of others.

Added by ttereshc over 3 years ago. Updated over 3 years 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.

Actions #1

Updated by ggainey over 3 years 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 ~]$ 
Actions #2

Updated by ipanova@redhat.com over 3 years ago

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

Actions #3

Updated by ttereshc over 3 years 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"
    }
  ],
Actions #4

Updated by ttereshc over 3 years 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

Actions #5

Updated by ttereshc over 3 years ago

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

Added by ttereshc over 3 years ago

Revision 66984546 | View on GitHub

Remove relations only for plugins specified in the plan

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

Added by ttereshc over 3 years ago

Revision 66984546 | View on GitHub

Remove relations only for plugins specified in the plan

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

Added by ttereshc over 3 years ago

Revision 66984546 | View on GitHub

Remove relations only for plugins specified in the plan

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

Actions #6

Updated by ttereshc over 3 years ago

  • Status changed from POST to MODIFIED
Actions #7

Updated by ttereshc over 3 years ago

  • Sprint/Milestone set to 0.11.2

Added by ttereshc over 3 years ago

Revision b99077f6 | View on GitHub

Remove relations only for plugins specified in the plan

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

Added by ttereshc over 3 years ago

Revision b99077f6 | View on GitHub

Remove relations only for plugins specified in the plan

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

Added by ttereshc over 3 years ago

Revision b99077f6 | View on GitHub

Remove relations only for plugins specified in the plan

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

Actions #8

Updated by pulpbot over 3 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF