Bug 2272114

Summary: Error undefined method `repository_url' when tryinfg to use composed images for system deployments in Red Hat Satellite 6
Product: Red Hat Satellite Reporter: Odilon Sousa <osousa>
Component: Provisioning TemplatesAssignee: Ian Ballou <iballou>
Status: CLOSED ERRATA QA Contact: sganar
Severity: high Docs Contact:
Priority: high    
Version: 6.14.2CC: ahumbe, fperalta, gtalreja, iballou, jlenz, mhulan, pcreech, rlavi, sganar, shwsingh
Target Milestone: 6.14.4Keywords: EasyFix, Regression, Triaged
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: rubygem-katello-4.9.0.24-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2269386 Environment:
Last Closed: 2024-04-29 11:23:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Comment 1 sganar 2024-04-15 15:33:19 UTC
FaliedQA

Tested on Satellite 6.14.4 Snap 1.0
rubygem-katello-4.9.0.24-1.el8sat.noarch

Steps followed: 
1. Configure the Satellite for provisioning
2. Create a custom product, create a file repository
3. Upload the ISO to the file repository, create a CV, add the repo to the CV and publish it
4. Provision a host with `kickstart_liveimg` parameter with its value similar to `custom/custom_product/custom_liveimg_repo/RHEL8.iso`
5. Try to render the kickstart template

Observation:
The template rendered successfully with Safemode Enabled/Disabled, However the host provisioning fails when the anaconda installer starts with below error(the ISO was correctly fetched and downloaded):

anaconda 33.16.9.4 exception report
Traceback (most recent call first):
  File "/usr/lib64/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
  File "/usr/lib64/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib64/python3.6/site-packages/pyanaconda/core/util.py", line 202, in startProgram
    preexec_fn=preexec, cwd=root, env=env, **kwargs)
  File "/usr/lib64/python3.6/site-packages/pyanaconda/core/util.py", line 321, in _run_program
    env_prune=env_prune)
  File "/usr/lib64/python3.6/site-packages/pyanaconda/core/util.py", line 397, in execWithRedirect
    log_output=log_output, binary_output=binary_output)[0]
  File "/usr/lib64/python3.6/site-packages/pyanaconda/core/util.py", line 378, in execInSysroot
    return execWithRedirect(command, argv, stdin=stdin, root=root)
  File "/usr/lib64/python3.6/site-packages/pyanaconda/payload/live/payload_base.py", line 148, in _create_rescue_image
    util.execInSysroot("systemd-machine-id-setup", [])
  File "/usr/lib64/python3.6/site-packages/pyanaconda/payload/live/payload_base.py", line 139, in install
    self._create_rescue_image()
  File "/usr/lib64/python3.6/site-packages/pyanaconda/payload/live/payload_liveimg.py", line 292, in install
    super().install()
  File "/usr/lib64/python3.6/site-packages/pyanaconda/installation_tasks.py", line 456, in run_task
    self._task(*self._task_args, **self._task_kwargs)
  File "/usr/lib64/python3.6/site-packages/pyanaconda/installation_tasks.py", line 490, in start
    self.run_task()
  File "/usr/lib64/python3.6/site-packages/pyanaconda/installation_tasks.py", line 311, in start
    item.start()
  File "/usr/lib64/python3.6/site-packages/pyanaconda/installation_tasks.py", line 311, in start
    item.start()
  File "/usr/lib64/python3.6/site-packages/pyanaconda/installation_tasks.py", line 311, in start
    item.start()
  File "/usr/lib64/python3.6/site-packages/pyanaconda/installation.py", line 406, in run_installation
    queue.start()
  File "/usr/lib64/python3.6/threading.py", line 885, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib64/python3.6/site-packages/pyanaconda/threading.py", line 280, in run
    threading.Thread.run(self)
FileNotFoundError: [Errno 2] No such file or directory: 'systemd-machine-id-setup': 'systemd-machine-id-setup'

Comment 3 Ian Ballou 2024-04-16 12:59:00 UTC
@sganar , in the rendered template, you saw liveimg --url=<url> get added to the kickstart file correctly?

If that is the case, I think the "FileNotFoundError: [Errno 2] No such file or directory: 'systemd-machine-id-setup': 'systemd-machine-id-setup'" could potentially be a second bug.

I did find https://bugzilla.redhat.com/show_bug.cgi?id=1963778, which suggests a potential bug with Anaconda.

I think if we can verify that the liveimg --url=<url> line is being added correctly to the kickstart file, that the issue here is resolved but we may need to shift the attention to another BZ. Mostly mentioning this since this issue was more related to Katello than Foreman provisioning.

Comment 4 sganar 2024-04-16 16:01:59 UTC
@iballou , yes the liveimg --url=<url> is populated correctly.

I'll verify this bug since the main issue for which the bug was reported is fixed, and we are hitting another bug related to Anaconda

Comment 5 sganar 2024-04-16 16:03:21 UTC
Verified.

Tested on Satellite 6.14.4 Snap 1.0
rubygem-katello-4.9.0.24-1.el8sat.noarch

Steps followed: 
1. Configure the Satellite for provisioning
2. Create a custom product, create a file repository
3. Upload the ISO to the file repository, create a CV, add the repo to the CV and publish it
4. Provision a host with `kickstart_liveimg` parameter with its value similar to `custom/custom_product/custom_liveimg_repo/RHEL8.iso`
5. Try to render the kickstart template

Observation:
The template rendered successfully with Safemode Enabled/Disabled with liveimg parameter correctly populated
Note: The host provisioning will fail because of this anaconda bug: https://bugzilla.redhat.com/show_bug.cgi?id=1963778

Comment 11 errata-xmlrpc 2024-04-29 11:23:46 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 (Satellite 6.14.4 Async 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/RHBA-2024:2099