Bug 1964797

Summary: pulp3: Custom repo sync completes with "undefined method `username' for #<PulpRpmClient::RpmRpmRemoteResponse:0x000000001f309f70>" error.
Product: Red Hat Satellite Reporter: Devendra Singh <desingh>
Component: PulpAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Lai <ltran>
Severity: high Docs Contact:
Priority: high    
Version: 6.10.0CC: egolov, jsherril, pmoravec, ttereshc
Target Milestone: 6.10.0Keywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: python-pulp-rpm-3.11.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-12 13:37:18 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:
Attachments:
Description Flags
yum sync failure none

Description Devendra Singh 2021-05-26 06:27:11 UTC
Description of problem: Custom repo sync completes with  "undefined method `username' for #<PulpRpmClient::RpmRpmRemoteResponse:0x000000001f309f70>" error.

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

How reproducible:
always

Steps to Reproduce:
1. Install Satellite with 6.10 Snap1 version
2. Create a custom product
3. Create a custom repo with credentials.
4. Run the repository sync, Repo sync complete with 

NoMethodError: undefined method `username' for #<PulpRpmClient::RpmRpmRemoteResponse:0x000000001317f760>
Actual results:
Repo sync complete with NoMethodError error.

Expected results:
Repos sync should complete successfully.

Additional info:
The problem appears if we create the custom repo with upstream credentials.

Comment 1 Tanya Tereshchenko 2021-06-08 10:01:37 UTC
Please provide logs, both for Katello and Pulp.
Which versions of pulp client packages are used?

Feel free to provide a reproducer machine instead.

Thank you.

Comment 6 Lai 2021-06-11 15:11:04 UTC
Created attachment 1790262 [details]
yum sync failure

Comment 7 Pavel Moravec 2021-06-25 07:15:49 UTC
I can confirm the bug is present in snap 4:

satellite-6.10.0-0.1.beta.el7sat.noarch
python3-pulpcore-3.11.2-2.el7pc.noarch
python3-pulp-rpm-3.11.0-1.el7pc.noarch
katello-4.1.0-0.6.rc2.el7sat.noarch
tfm-rubygem-katello-4.1.0-0.9.rc2.2.el7sat.noarch

with backtrace of Actions::Pulp3::Repository::RefreshRemote :

 NoMethodError

undefined method `username' for #<PulpRpmClient::RpmRpmRemoteResponse:0x00000000100463b0>

---
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.0.rc2.2/app/services/katello/pulp3/repository.rb:143:in
  `block in remote_needs_updates?'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.0.rc2.2/app/services/katello/pulp3/repository.rb:143:in
  `any?'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.0.rc2.2/app/services/katello/pulp3/repository.rb:143:in
  `remote_needs_updates?'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.0.rc2.2/app/lib/actions/pulp3/repository/refresh_remote.rb:12:in
  `invoke_external_task'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.8/lib/dynflow/action/polling.rb:84:in
  `initiate_external_action'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.8/lib/dynflow/action/polling.rb:19:in
  `run'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.8/lib/dynflow/action/cancellable.rb:14:in
  `run'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.0.rc2.2/app/lib/actions/pulp3/abstract_async_task.rb:10:in
  `run'"
- "/opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.8/lib/dynflow/action.rb:571:in
  `block (3 levels) in execute_run'"
..



My particular reproducer:
- sync CentOS8 baseos or appstream repo (this went fine)
- sync it again, (regardless of --skip-metadata-check=yes/no)


Shall we remove "Fixed in version", as that does not further seem to be correct?

Comment 8 Justin Sherrill 2021-07-12 13:37:18 UTC

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