Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1676982

Summary: "syspurpose show" creates two conflicting tasks on Satellite 6.5 server
Product: Red Hat Enterprise Linux 8 Reporter: Chris Snyder <csnyder>
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: medium Docs Contact:
Priority: high    
Version: 8.0CC: candlepin-bugs, cdonnell, dscott, inecas, jcallaha, jsefler, jturel, khowell, rdrazny, rhsm-qe, rjerrido, tasander, wchadwic
Target Milestone: rcKeywords: Triaged
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: subscription-manager-1.23.8-28 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1668251 Environment:
Last Closed: 2019-06-14 01:45:36 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:
Bug Depends On:    
Bug Blocks: 1668251, 1670104    

Comment 7 Jonathon Turel 2019-02-26 21:30:48 UTC
Demonstrating original failure with version subscription-manager-1.23.8-27:

[root@rhel8 vagrant]# subscription-manager register
Registering to: sat-6-5-qa-rhel7.strangeways.example.com:443/rhsm
Username: admin
Password: 
Organization: Default_Organization
The system has been registered with ID: 1df323ed-853b-4a19-9458-8db8998de932
The registered system name is: rhel8.dr.example.com


[root@rhel8 vagrant]# syspurpose show
{
  "role": "Red Hat Enterprise Linux Server",
  "usage": "Production"
}
HTTP error (500 - Internal Server Error): Required lock is already taken by other running tasks.
Please inspect their state, fix their errors and resume them.

Required lock: update
Conflicts with tasks:
- https://sat-6-5-qa-rhel7.strangeways.example.com/foreman_tasks/tasks/cd2539f3-28c4-4b04-ac26-0764b797e6b7

[root@rhel8 vagrant] tail -f -n 10000 /var/log/rhsm/rhsm.log | grep PUT
2019-02-26 16:22:01,723 [INFO] syspurpose:2138:MainThread @connection.py:638 - Response: status=200, request="PUT /rhsm/consumers/1df323ed-853b-4a19-9458-8db8998de932"
2019-02-26 16:22:01,905 [INFO] syspurpose:2138:MainThread @connection.py:638 - Response: status=500, request="PUT /rhsm/consumers/1df323ed-853b-4a19-9458-8db8998de932"

Notice the 500 ISE indicating the lock and duplicate PUT requests from rhsm.log

========
verifying version...
[root@rhel8 vagrant]# rpm -qa | grep "syspurpose\|subscription"
python3-syspurpose-1.23.8-32.el8.x86_64
python3-subscription-manager-rhsm-1.23.8-32.el8.x86_64
dnf-plugin-subscription-manager-1.23.8-32.el8.x86_64
subscription-manager-rhsm-certificates-1.23.8-32.el8.x86_64
subscription-manager-1.23.8-32.el8.x86_64

[root@rhel8 vagrant]# rpm -q subscription-manager --changelog | grep 1676982
- 1676982: Do not make duplicate sync calls on syspurpose show

[root@rhel8 vagrant]# subscription-manager register                                                                                                                     

Registering to: sat-6-5-qa-rhel7.strangeways.example.com:443/rhsm
Username: admin
Password:
Organization: Default_Organization
The system has been registered with ID: 0888005b-f8c7-47f1-8d4c-8f71b239f332
The registered system name is: rhel8.dr.example.com
[root@rhel8 vagrant]# syspurpose show
{
  "role": "Red Hat Enterprise Linux Server",
  "usage": "Production"
}
System purpose successfully sent to subscription management server.
[root@rhel8 vagrant]# 

[root@rhel8 vagrant] tail -f -n 10000 /var/log/rhsm/rhsm.log | grep PUT
2019-02-26 16:28:56,115 [INFO] syspurpose:2405:MainThread @connection.py:638 - Response: status=200, request="PUT /rhsm/consumers/0888005b-f8c7-47f1-8d4c-8f71b239f332"

Notice success of syspurpose show and single PUT against the server in rhsm.log

Comment 8 John Sefler 2019-02-26 21:34:30 UTC
Moving to VERIFIED based on comment 7

Comment 9 Jonathon Turel 2019-02-27 13:59:39 UTC
We tested this against satellite-6.5.0-6.beta.el7sat.noarch

Comment 10 Chris Snyder 2019-03-06 20:52:52 UTC
*** Bug 1668251 has been marked as a duplicate of this bug. ***

Comment 11 Taft Sanders 2019-04-23 18:23:40 UTC
*** Bug 1702052 has been marked as a duplicate of this bug. ***

Comment 12 Brad Buckingham 2019-05-01 18:14:51 UTC
*** Bug 1702788 has been marked as a duplicate of this bug. ***