Bug 2054165

Summary: After satellite-change-hostname, foreman tasks acquired lock error still refers to URL of old hostname
Product: Red Hat Satellite Reporter: Pavel Moravec <pmoravec>
Component: satellite-change-hostnameAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Peter Ondrejka <pondrejk>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.11.0CC: egolov, pcreech
Target Milestone: 6.11.0Keywords: Regression, Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: foreman-3.1.1.5-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-07-05 14:33:17 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 Pavel Moravec 2022-02-14 10:46:26 UTC
Description of problem:
Running satellite-change-hostname forgets to update one old hostname reference.

When a task fails to be executed due to an acquired lock, an error like:

Could not synchronize the repository:
  Required lock is already taken by other running tasks.
  Please inspect their state, fix their errors and resume them.
  
  Conflicts with tasks:
  - https://old.hostname.com/foreman_tasks/tasks/bc2cb786-21d5-4c24-b7f6-33048ea1032a

is raised, pointing to the *old* FQDN.

Replacing the FQDN to a current one shows proper task (that acquired the lock), so it is just somewhere in foreman-tasks that still points to the old FQDN.


Version-Release number of selected component (if applicable):
Sat 7.0 snap 9


How reproducible:
100%


Steps to Reproduce:
1. satellite-change-hostname new-satellite.redhat.com
2. For a (bigger) repo with a feed URL, invoke its sync twice concurrently:

hammer repository synchronize --organization-id 1 --async --id 4
hammer repository synchronize --organization-id 1 --async --id 4

3. Check hostname in the error raised.


Actual results:
3. shows old FQDN


Expected results:
3. to show new FQDN


Additional info:

Comment 1 Brad Buckingham 2022-02-14 14:06:47 UTC
Is this a regression from Satellite 6.10?

Comment 2 Pavel Moravec 2022-02-14 14:42:31 UTC
(In reply to Brad Buckingham from comment #1)
> Is this a regression from Satellite 6.10?

Yes it is a regression.

Renaming my Sat6.10 to pmoravec-sat610-renamed.brq2.redhat.com :


hammer> repository synchronize --organization-id 1 --id 3 --async
Repository is being synchronized in task 5b16c769-26b8-469f-be4d-8474688e22d2.
hammer> repository synchronize --organization-id 1 --id 3 --async
Could not synchronize the repository:
  Required lock is already taken by other running tasks.
  Please inspect their state, fix their errors and resume them.
  
  Conflicts with tasks:
  - https://pmoravec-sat610-renamed.brq2.redhat.com/foreman_tasks/tasks/5b16c769-26b8-469f-be4d-8474688e22d2
hammer> 


That is correct URL - on 6.10 .

Comment 3 Evgeni Golov 2022-02-16 14:41:37 UTC
I think this is technically a duplicate of BZ#2042480, which was fixed, but somehow it seems the fix was reverted :/

Comment 5 Peter Ondrejka 2022-03-02 16:02:17 UTC
Verified on Sat 7.0 snap 10 using the steps from the problem description. The new hostname is shown correctly in the error description

Comment 9 errata-xmlrpc 2022-07-05 14:33:17 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.11 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5498