Bug 2167097

Summary: Job template "change content source" fails to change the content source
Product: Red Hat Satellite Reporter: soham <smajumda>
Component: Hosts - ContentAssignee: Jeremy Lenz <jlenz>
Status: CLOSED ERRATA QA Contact: Sam Bible <sbible>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.13.0CC: ahumbe, aruzicka, jlenz, lstejska, mhulan, pcreech, sbible
Target Milestone: 6.14.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-katello-4.9.0.6-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-08 14:18:30 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 soham 2023-02-04 17:54:15 UTC
Description of problem:
Job template "change content source" fails to change the content source



Steps to Reproduce:
1. Register a RHEL8 client VM to satellite
2. Edit it and add correct content source manually. [It would be blank on registration]
3. Now use job template "change content source" to change the content source.

Actual results:
The job completes successfully but the actual change doesnt happen. Below is the execution log:

1:
Successfully updated the system facts.
   2:
Starting deployment of REX pull provider
   3:
#
   4:
# Installing packages
   5:
#
   6:
Updating Subscription Management repositories.
   7:
EPEL8                                            41 kB/s | 2.3 kB     00:00    
   8:
Package foreman_ygg_worker-0.1.1-2.el8sat.x86_64 is already installed.
   9:
Dependencies resolved.
  10:
Nothing to do.
  11:
Complete!
  12:
Getting configuration from subscription-manager...
  13:
enabled
  14:
Running timer as unit: run-ra9ac2f1552b848b6b030ee4a490fe707.timer
  15:
Will run service as unit: run-ra9ac2f1552b848b6b030ee4a490fe707.service
  16:
Remote execution pull provider successfully configured!
  17:
Exit status: 0


Expected results:
The content source should be changed

Comment 1 Brad Buckingham 2023-02-06 14:15:51 UTC
Is this a regression from 6.12?  Thanks!

Comment 4 Leos Stejskal 2023-03-17 08:12:56 UTC
Hi,
can I get more info about the issue?
- Satellite & Katello version
- Logs from capsule and satellite

Jeremy:
change_content_source is in https://github.com/Katello/katello/blob/master/app/lib/katello/concerns/base_template_scope_extensions.rb#L301

Comment 8 Marek Hulan 2023-06-05 14:58:33 UTC
Isn't the reproducer missing a step? I think the job should be triggered from the change content source wizard, not ran directly. The job doesn't change anything in the DB, it only performs what needs to be performed on the host. The wizard modifies the Satellite DB. If that's the case, that wouldn't be a bug right? Perhaps we could add a description to the template to explain its purpose.

Comment 9 Jeremy Lenz 2023-06-22 13:28:01 UTC
I'd be in favor of renaming the job template to something more descriptive - something like "Configure host for new content source."

Comment 11 Jeremy Lenz 2023-07-17 14:39:09 UTC
Created redmine issue https://projects.theforeman.org/issues/36597 from this bug

Comment 12 Bryan Kearney 2023-07-17 16:02:50 UTC
Upstream bug assigned to jlenz

Comment 13 Bryan Kearney 2023-07-17 16:02:52 UTC
Upstream bug assigned to jlenz

Comment 14 Bryan Kearney 2023-07-21 20:02:39 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/36597 has been resolved.

Comment 17 Sam Bible 2023-08-10 16:42:47 UTC
Verified on: 6.14 - 11

Steps to verify:
1. Navigate to Hosts -> Job Templates
2. Select Katello as the job category

Expected Results:
There is no job template named 'Change Content Source' and there is one named 'Configure Host for new content source'; the description of the template has been updated
The job executes successfully.

Actual Results:
There is no job template named 'Change Content Source' and there is one named 'Configure Host for new content source'; the description of the template has been updated
The job executes successfully.

Comment 20 errata-xmlrpc 2023-11-08 14:18:30 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 (Important: Satellite 6.14 security and bug fix update), 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-2023:6818