Bug 2051713

Summary: Syncing RHEL 5 KS repo fails with: "ModelBase object argument after ** must be a mapping, not str"
Product: Red Hat Satellite Reporter: Lai <ltran>
Component: PulpAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Vladimír Sedmík <vsedmik>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.10.3CC: dalley
Target Milestone: UnspecifiedKeywords: 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: 2022-10-19 19:49:21 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 Lai 2022-02-07 20:45:05 UTC
Description of problem:
Syncing RHEL 5 KS repo fails with: "ModelBase object argument after ** must be a mapping, not str" so you can't sync a RHEL 5 KS repo.

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

How reproducible:
100%

Steps to Reproduce:
1. Enable "Red Hat Enterprise Linux 5 Server Kickstarter x86_64 5.10' repo
2. Start the sync

Actual results:
Sync failed with "ModelBase object argument after ** must be a mapping, not str"

Expected results:
sync should pass successfully

Additional info:

Comment 1 Lai 2022-02-07 20:46:52 UTC
Here's the conversation on the issue:

Comment #3
here's the log and vm:

Feb  4 13:00:16 dhcp-3-188 systemd: Created slice User Slice of root.
Feb  4 13:00:16 dhcp-3-188 systemd-logind: New session 331 of user root.
Feb  4 13:00:16 dhcp-3-188 systemd: Started Session 331 of user root.
Feb  4 13:00:19 dhcp-3-188 pulpcore-api: pulp [e7a1b461-f227-4976-8c29-1eacad1c5dc9]:  - - [04/Feb/2022:18:00:19 +0000] "GET
 /pulp/api/v3/tasks/5435b4b7-ba82-4a6e-a538-f73fb7b6d279/ HTTP/1.1" 200 3464 "-" "OpenAPI-Generator/3.14.1/ruby"
Feb  4 13:00:19 dhcp-3-188 pulpcore-api: pulp [e7a1b461-f227-4976-8c29-1eacad1c5dc9]:  - - [04/Feb/2022:18:00:19 +0000] "GET
 /pulp/api/v3/tasks/5c976130-d1a2-4284-9e89-80fc78f87fbf/ HTTP/1.1" 200 3463 "-" "OpenAPI-Generator/3.14.1/ruby"
Feb  4 13:00:27 dhcp-3-188 pulpcore-api: pulp [e7a1b461-f227-4976-8c29-1eacad1c5dc9]:  - - [04/Feb/2022:18:00:27 +0000] "GET
 /pulp/api/v3/tasks/5435b4b7-ba82-4a6e-a538-f73fb7b6d279/ HTTP/1.1" 200 3464 "-" "OpenAPI-Generator/3.14.1/ruby"
Feb  4 13:00:27 dhcp-3-188 pulpcore-api: pulp [e7a1b461-f227-4976-8c29-1eacad1c5dc9]:  - - [04/Feb/2022:18:00:27 +0000] "GET
 /pulp/api/v3/tasks/5c976130-d1a2-4284-9e89-80fc78f87fbf/ HTTP/1.1" 200 3464 "-" "OpenAPI-Generator/3.14.1/ruby"
Feb  4 13:00:35 dhcp-3-188 pulpcore-api: pulp [e7a1b461-f227-4976-8c29-1eacad1c5dc9]:  - - [04/Feb/2022:18:00:35 +0000] "GET
 /pulp/api/v3/tasks/5435b4b7-ba82-4a6e-a538-f73fb7b6d279/ HTTP/1.1" 200 3464 "-" "OpenAPI-Generator/3.14.1/ruby"
Feb  4 13:00:36 dhcp-3-188 pulpcore-api: pulp [e7a1b461-f227-4976-8c29-1eacad1c5dc9]:  - - [04/Feb/2022:18:00:36 +0000] "GET
 /pulp/api/v3/tasks/5c976130-d1a2-4284-9e89-80fc78f87fbf/ HTTP/1.1" 200 3464 "-" "OpenAPI-Generator/3.14.1/ruby"
Feb  4 13:00:40 dhcp-3-188 systemd: Removed slice User Slice of foreman.
Feb  4 13:00:52 dhcp-3-188 pulpcore-api: pulp [e7a1b461-f227-4976-8c29-1eacad1c5dc9]:  - - [04/Feb/2022:18:00:52 +0000] "GET
 /pulp/api/v3/tasks/5435b4b7-ba82-4a6e-a538-f73fb7b6d279/ HTTP/1.1" 200 3969 "-" "OpenAPI-Generator/3.14.1/ruby"
Feb  4 13:00:52 dhcp-3-188 pulpcore-api: pulp [e7a1b461-f227-4976-8c29-1eacad1c5dc9]:  - - [04/Feb/2022:18:00:52 +0000] "GET
 /pulp/api/v3/tasks/5c976130-d1a2-4284-9e89-80fc78f87fbf/ HTTP/1.1" 200 3466 "-" "OpenAPI-Generator/3.14.1/ruby"
Feb  4 13:00:56 dhcp-3-188 pulpcore-worker-3: pulp [e7a1b461-f227-4976-8c29-1eacad1c5dc9]: pulpcore.tasking.pulpcore_worker:
INFO: Task 5435b4b7-ba82-4a6e-a538-f73fb7b6d279 failed (ModelBase object argument after ** must be a mapping, not str)

Feb  4 13:00:56 dhcp-3-188 pulpcore-worker-3: pulp [e7a1b461-f227-4976-8c29-1eacad1c5dc9]: pulpcore.tasking.pulpcore_worker:
INFO:   File "/usr/lib/python3.6/site-packages/pulpcore/tasking/pulpcore_worker.py", line 332, in _perform_task
Feb  4 13:00:56 dhcp-3-188 pulpcore-worker-3: result = func(*args, **kwargs)
Feb  4 13:00:56 dhcp-3-188 pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/pulp_rpm/app/tasks/synchronizing.py", l
ine 491, in synchronize
Feb  4 13:00:56 dhcp-3-188 pulpcore-worker-3: version = dv.create()
Feb  4 13:00:56 dhcp-3-188 pulpcore-worker-3: File "/usr/lib/python3.6/site-packages/pulpcore/plugin/stages/declarative_vers
ion.py", line 151, in create
Feb  4 13:00:56 dhcp-3-188 pulpcore-worker-3: loop.run_until_complete(pipeline)
Feb  4 13:00:56 dhcp-3-188 pulpcore-worker-3: File "/usr/lib64/python3.6/asyncio/base_events.py", line 484, in run_until_com
plete
Feb  4 13:00:56 dhcp-3-188 pulpcore-worker-3: return future.result()

vm: dhcp-3-188.vms.sat.rdu2.redhat.com

comment #4
Reproduced against pulp_rpm/main using the following script:

=====
#!/bin/bash
REPO_NAME="rhel5-ks"
REMOTE_URL=https://cdn.redhat.com/content/dist/rhel/server/5/5.11/x86_64/kickstart
pulp rpm remote create --name ${REPO_NAME} --url ${REMOTE_URL} --policy 'immediate' \
  --ca-cert @/home/vagrant/devel/pulp_startup/CDN_cert/redhat-uep.pem \
  --client-key @/home/vagrant/devel/pulp_startup/CDN_cert/cdn.key \
  --client-cert @/home/vagrant/devel/pulp_startup/CDN_cert/cdn.pem \
  --tls-validation false
pulp rpm repository create --name ${REPO_NAME} --remote ${REPO_NAME} | jq -r .pulp_href
pulp rpm repository sync --name ${REPO_NAME}
=====

Output:

=====
(pulp) []$ ./rhel5_ks_sync.sh 
{
  "pulp_href": "/pulp/api/v3/remotes/rpm/rpm/63dd2429-f64e-4acd-87d1-0161171ba481/",
  "pulp_created": "2022-02-04T21:48:48.359792Z",
  "name": "rhel5-ks",
  "url": "https://cdn.redhat.com/content/dist/rhel/server/5/5.11/x86_64/kickstart",
  "ca_cert": "...",
  "client_cert": "...",
  "tls_validation": false,
  "proxy_url": null,
  "pulp_labels": {},
  "pulp_last_updated": "2022-02-04T21:48:48.359809Z",
  "download_concurrency": null,
  "max_retries": null,
  "policy": "immediate",
  "total_timeout": null,
  "connect_timeout": null,
  "sock_connect_timeout": null,
  "sock_read_timeout": null,
  "headers": null,
  "rate_limit": null,
  "sles_auth_token": null
}

/pulp/api/v3/repositories/rpm/rpm/b913b8de-6f9e-4ce0-9f83-396f497d1fe5/
Started background task /pulp/api/v3/tasks/4422a9c5-9d9f-4818-ae4a-097a979f78dc/
......Error: Task /pulp/api/v3/tasks/4422a9c5-9d9f-4818-ae4a-097a979f78dc/ failed: 'pulpcore.app.models.content.Artifact() argument after ** must be a mapping, not str'
(pulp) []$
=====

This fails not because sha==sha1 - it fails because the RHEL5-KS treeinfo does not include a "checksums" stanza. See https://cdn.redhat.com/content/dist/rhel/server/5/5.11/x86_64/kickstart/treeinfo

Comment #5
Correcting the problem being encountered:

At #839 in this code-block:

https://github.com/pulp/pulp_rpm/blob/main/pulp_rpm/app/tasks/synchronizing.py#L838-L845

(path, checksum) == ('images/pxeboot/initrd.img', 'x86_64')

We need to figure out where that happens - expected behavior would be ('images/pxeboot/initrd.img', {})

Comment 2 Daniel Alley 2022-07-05 16:36:26 UTC
I believe this is a duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=2069822

Comment 3 Daniel Alley 2022-08-23 01:57:30 UTC
Documenting for the future: This was fixed with https://github.com/pulp/pulp_rpm/pull/2491 and shipped in 6.11 but not backported to 6.10 given lack of demand (only impacts RHEL 5 repos)

Comment 5 Daniel Alley 2022-10-19 19:49:21 UTC
Closing as a duplicate

*** This bug has been marked as a duplicate of bug 2069822 ***