Project

Profile

Help

Issue #8825

closed

RPM Publication fails with "unexpected keyword argument 'main_variant'" error

Added by frumpleswift over 3 years ago. Updated over 3 years ago.

Status:
CLOSED - DUPLICATE
Priority:
Normal
Assignee:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
CentOS 7
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

We are using pulp to create and host a package repository for networks that are not connected to the internet.

In the past week our packer build process began to fail when we attempt to create an RPM Publication. The publication process fails with the following error:

{
    "pulp_href": "/pulp/api/v3/tasks/7b20aa82-95ed-4243-af87-1481c5d05edc/",
    "pulp_created": "2021-05-25T21:06:01.820590Z",
    "state": "failed",
    "name": "pulp_rpm.app.tasks.publishing.publish",
    "logging_cid": "4cbb785ba2594f96bd3b28921e223484",
    "started_at": "2021-05-25T21:06:01.974315Z",
    "finished_at": "2021-05-25T21:06:03.654737Z",
    "error": {
        "traceback": "  File \"/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/worker.py\", line 1013, in perform_job\n    rv = job.perform()\n  File \"/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py\", line 709, in perform\n    self._result = self._execute()\n  File \"/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py\", line 732, in _execute\n    result = self.func(*self.args, **self.kwargs)\n  File \"/usr/local/lib/pulp/lib64/python3.6/site-packages/pulp_rpm/app/tasks/publishing.py\", line 307, in publish\n    publication_data.populate()\n  File \"/usr/local/lib/pulp/lib64/python3.6/site-packages/pulp_rpm/app/tasks/publishing.py\", line 229, in populate\n    self.handle_sub_repos(distribution_tree)\n  File \"/usr/local/lib/pulp/lib64/python3.6/site-packages/pulp_rpm/app/tasks/publishing.py\", line 182, in handle_sub_repos\n    treeinfo.dump(treeinfo_file.name)\n  File \"/usr/local/lib/pulp/lib64/python3.6/site-packages/productmd/treeinfo.py\", line 147, in dump\n    self.serialize(parser, main_variant=main_variant)\n",
        "description": "serialize() got an unexpected keyword argument 'main_variant'"
    },
    "worker": "/pulp/api/v3/workers/b3446fb5-8ef1-425a-8326-77a079e2b8b1/",
    "parent_task": null,
    "child_tasks": [],
    "task_group": null,
    "progress_reports": [],
    "created_resources": [],
    "reserved_resources_record": [
        "/pulp/api/v3/repositories/rpm/rpm/50c62586-2fce-4272-b74a-113f6015386b/"
    ]
}

We are using the following ansible-galaxy modules:

---
roles:
  - src: geerlingguy.postgresql
    version: 3.1.0

collections:
  - name: community.postgresql
    version: 1.2.0
  - name: community.general
    version: 2.5.0
  - name: pulp.pulp_installer
    version: 3.12.0
  - name: pulp.squeezer
    version: 0.0.7

pulpcore-manager version:

[dad-user@dark-aster-registry ~]$ ls /usr/local/bin/pulpcore-manager --version
ls (GNU coreutils) 8.30
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Richard M. Stallman and David MacKenzie.
[dad-user@dark-aster-registry ~]$ 

Related issues

Is duplicate of RPM Support - Issue #8807: Distribution tree publish fails with productmd 1.33+CLOSED - CURRENTRELEASEttereshcActions
Actions #1

Updated by frumpleswift over 3 years ago

I believe the root cause of the issue is a change to the productmd package.

My latest working pulp build has productmd 1.32, while the broken one has productmd 1.33.

If you look at the changes, they are explicitly adding the main_variant parameter to treeinfo: https://github.com/release-engineering/productmd/commit/06ab7b7593ce21b20b75c25d72c9aafb67155fd1

Actions #2

Updated by frumpleswift over 3 years ago

I was able to get around the issue by manually editing roles/pulp_common/templates/pip_constraints_for_plugins.txt.j2

bash-4.2$ cat roles/pulp_common/templates/pip_constraints_for_plugins.txt.j2
pulpcore=={{ pip_pkgs.packages[pulp_install_dir + '/bin/pip'].pulpcore[0].version }}
productmd==1.32
bash-4.2$ 

This resulted in a rendered file as follows:

[root@dark-aster-registry ~]# cat /usr/local/lib/pulp/pip_constraints_for_plugins.txt 
pulpcore==3.12.0
productmd==1.32
[root@dark-aster-registry ~]# 

which forced the older version:

[root@dark-aster-registry ~]# . /usr/local/lib/pulp/
bin/                             pip-selfcheck.json
include/                         pyvenv.cfg
lib/                             requirements.in
lib64/                           share/
pip_constraints_for_plugins.txt  
[root@dark-aster-registry ~]# . /usr/local/lib/pulp/bin/activate
(pulp) [root@dark-aster-registry ~]# pip list | grep productmd
productmd                       1.32
(pulp) [root@dark-aster-registry ~]# 
Actions #3

Updated by ttereshc over 3 years ago

  • Project changed from Pulp to RPM Support
Actions #4

Updated by ttereshc over 3 years ago

  • Status changed from NEW to CLOSED - DUPLICATE

The workaround is to downgrade to productmd 1.32.
The compatibility with 1.33 will be in the upcoming pulp_rpm 3.13 release. See #8807.

Actions #5

Updated by ttereshc over 3 years ago

  • Is duplicate of Issue #8807: Distribution tree publish fails with productmd 1.33+ added

Also available in: Atom PDF