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 1668251

Summary: "syspurpose show" creates two conflicting tasks on Satellite 6.5 server
Product: Red Hat Enterprise Linux 8 Reporter: Radovan Drazny <rdrazny>
Component: subscription-managerAssignee: candlepin-bugs
Status: CLOSED DUPLICATE QA Contact: Red Hat subscription-manager QE Team <rhsm-qe>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.0CC: csnyder, inecas, jcallaha, jsefler, jturel, khowell, rdrazny
Target Milestone: rcKeywords: Triaged
Target Release: 8.0Flags: jturel: needinfo-
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1676982 (view as bug list) Environment:
Last Closed: 2019-03-06 20:52:52 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: 1676982    
Bug Blocks: 1670104    
Attachments:
Description Flags
foreman logs double request none

Description Radovan Drazny 2019-01-22 09:59:22 UTC
Description of problem:
Running "syspurpose show" on a RHEL 8 client registered to a Sat 6.5 server spawns two identical tasks, which try to access same resource.

Version-Release number of selected component (if applicable):
Sat 6.5 Snap 12

How reproducible:
always

Steps to Reproduce:
1. Have a RHEL 8 system registered with a Sat 6.5 instance
2. Run "syspurpose show" command on the client

Actual results:

[root@rhel8client1 ~]# syspurpose show
{
  "role": "Red Hat Enterprise Linux Server",
  "usage": "Development/Test"
}
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://sat6stable.example.com/foreman_tasks/tasks/702b1ae1-26db-4ac5-a095-f2eab2ca8536

Expected results:
No error message

Additional info:
Checking the task queue on the Satellite, there are two identical and conflicting tasks started at the same time:


702b1ae1-26db-4ac5-a095-f2eab2ca8536 | Update for host rhel8client1.example.com  | stopped   | success | 2019/01/22 09:50:12 | 2019/01/22 09:50:12 | foreman_admin     |
fea5b5cb-bb51-479f-857f-0b7a99cc811a | Update for host rhel8client1.example.com  | stopped   | error   | 2019/01/22 09:50:12 | 2019/01/22 09:50:12 | foreman_admin     | Required lock is already taken by other running tasks.
Please inspect their st...


One of them locks the "update" resource, causing the other one to fail.

Comment 5 Jonathon Turel 2019-01-30 23:17:32 UTC
Hi Radovan: Thank you! I see can very reliably recreate the problem now by deleting /etc/rhsm/syspurpose/syspurpose.json

Comment 6 Jonathon Turel 2019-01-30 23:23:03 UTC
Created attachment 1525190 [details]
foreman logs double request

Comment 7 Jonathon Turel 2019-01-30 23:27:48 UTC
Hey Kevin,

It looks like `syspurpose show` is sending two identical requests to the server (I believe) when syspurpose values are not set or /etc/rhsm/syspurpose/syspurpose.json is missing. Check out attachment 1 [details] to see the requests & timing. The two basically simultaneous requests are creating Foreman tasks with locks and one of the tasks won't complete due to the lock. Two identical requests seems like a bug in the CLI to me. Let me know if you agree and I'll file a bz against the CLI and link it to this one or whatever fits your workflow.

Comment 8 jcallaha 2019-02-12 19:28:59 UTC
*** Bug 1676605 has been marked as a duplicate of this bug. ***

Comment 10 Chris Snyder 2019-03-06 20:52:52 UTC

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