Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-23943

Error undefined method `repository_url' when tryinfg to use composed images for system deployments in Red Hat Satellite 6

    • Bug Fix
    • Hide
      .Path to Red Hat Image Builder image renders correctly

      Previously, when you provisioned a host by using a Red Hat Image Builder image and provided a relative path to the image in the `kickstart_liveimg` parameter, the `Kickstart default` provisioning template failed to render.
      The Katello component has been fixed to render the absolute path of the image correctly.
      As a result, the `Kickstart default` template renders successfully and you can provision hosts by using the image.
      Show
      .Path to Red Hat Image Builder image renders correctly Previously, when you provisioned a host by using a Red Hat Image Builder image and provided a relative path to the image in the `kickstart_liveimg` parameter, the `Kickstart default` provisioning template failed to render. The Katello component has been fixed to render the absolute path of the image correctly. As a result, the `Kickstart default` template renders successfully and you can provision hosts by using the image.
    • Done
    • None
    • Yes

      Description of problem:

      While following https://access.redhat.com/documentation/en-us/red_hat_satellite/6.14/html-single/provisioning_hosts/index#Using_an_Image_Builder_Image_for_Provisioning_provisioning , After submitting the host for build with kickstart_liveimg parameter, The process is unable to fetch kickstart or render\preview the Kickstart template shipped with Red Hat Satellite 6.

      Version-Release number of selected component (if applicable):

      Satellite 6.14 [ perhaps some older versions are affected as well ]

      How reproducible:

      Always

      Steps to Reproduce:
      1. Create a system with kickstart_liveimg parameter added
      2. Try to render\preview the kickstart template against that host
      3. Repeat Step 2 with both Safemode Rendering enabled and disabled

      Actual results:

      With Safemode enabled:

      2024-03-13T20:38:49 [W|app|74498179] Error rendering the Kickstart default template
      2024-03-13T20:38:49 [I|app|74498179] Backtrace for 'Error rendering the Kickstart default template' error (Safemode::SecurityError): Safemode doesn't allow to access 'repository_url' on #<Safemode::ScopeObject>
      74498179 | /usr/share/gems/gems/safemode-1.3.8/lib/safemode/scope.rb:39:in `method_missing'
      74498179 | Kickstart default:114:in `initialize'
      74498179 | /usr/share/gems/gems/safemode-1.3.8/lib/safemode.rb:52:in `eval'
      74498179 | /usr/share/gems/gems/safemode-1.3.8/lib/safemode.rb:52:in `eval'
      74498179 | /usr/share/foreman/app/services/foreman/renderer/safe_mode_renderer.rb:7:in `render'
      74498179 | /usr/share/foreman/app/services/foreman/renderer/base_renderer.rb:18:in `render'
      74498179 | /usr/share/foreman/app/models/template.rb:172:in `render'
      74498179 | /usr/share/foreman/app/controllers/templates_controller.rb:131:in `safe_render'
      74498179 | /usr/share/foreman/app/controllers/templates_controller.rb:111:in `preview'
      74498179 | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
      74498179 | /usr/share/gems/gems/actionpack-6.1.7.4/lib/abstract_controller/base.rb:228:in `process_action'
      74498179 | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_controller/metal/rendering.rb:30:in `process_action'
      74498179 | /usr/share/gems/gems/actionpack-6.1.7.4/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
      74498179 | /usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
      74498179 | /usr/share/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
      74498179 | /usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
      74498179 | /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
      74498179 | /usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
      74498179 | /usr/share/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
      74498179 | /usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
      74498179 | /usr/share/gems/gems/audited-5.3.2/lib/audited/sweeper.rb:16:in `around'
      74498179 | /usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
      74498179 | /usr/share/gems/gems/audited-5.3.2/lib/audited/sweeper.rb:16:in `around'
      74498179 | /usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
      74498179 | /usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:137:in `run_callbacks'

      With Safemode disabled:

      2024-03-13T20:36:07 [W|app|0deac36e] Error rendering the Kickstart default template
      2024-03-13T20:36:07 [I|app|0deac36e] Backtrace for 'Error rendering the Kickstart default template' error (NoMethodError): undefined method `repository_url' for #<Foreman::Renderer::Scope::Provisioning:0x0000557a6cde2a10>
      0deac36e | Did you mean? register_url
      0deac36e | Kickstart default:38:in `get_binding'
      0deac36e | /usr/share/ruby/erb.rb:905:in `eval'
      0deac36e | /usr/share/ruby/erb.rb:905:in `result'
      0deac36e | /usr/share/foreman/app/services/foreman/renderer/unsafe_mode_renderer.rb:7:in `render'
      0deac36e | /usr/share/foreman/app/services/foreman/renderer/base_renderer.rb:18:in `render'
      0deac36e | /usr/share/foreman/app/services/foreman/renderer.rb:46:in `render'
      0deac36e | /usr/share/foreman/app/models/template.rb:172:in `render'
      0deac36e | /usr/share/foreman/app/controllers/templates_controller.rb:131:in `safe_render'
      0deac36e | /usr/share/foreman/app/controllers/templates_controller.rb:111:in `preview'
      0deac36e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
      0deac36e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/abstract_controller/base.rb:228:in `process_action'
      0deac36e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_controller/metal/rendering.rb:30:in `process_action'
      0deac36e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
      0deac36e | /usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
      0deac36e | /usr/share/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
      0deac36e | /usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
      0deac36e | /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
      0deac36e | /usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
      0deac36e | /usr/share/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
      0deac36e | /usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
      0deac36e | /usr/share/gems/gems/audited-5.3.2/lib/audited/sweeper.rb:16:in `around'
      0deac36e | /usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
      0deac36e | /usr/share/gems/gems/audited-5.3.2/lib/audited/sweeper.rb:16:in `around'
      0deac36e | /usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
      0deac36e | /usr/share/gems/gems/activesupport-6.1.7.4/lib/active_support/callbacks.rb:137:in `run_callbacks'
      0deac36e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/abstract_controller/callbacks.rb:41:in `process_action'
      0deac36e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_controller/metal/rescue.rb:22:in `process_action'
      0deac36e | /usr/share/gems/gems/actionpack-6.1.7.4/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'

      It seems foreman does not even know where the repository_url function exists or what to pick from.

      Expected results:

      No such error and end-users would be able to deploy systems using the RH Image builder images and the documented procedure in "Chapter 8. Using a Red Hat Image Builder Image for Provisioning"

      Additional info:

            [SAT-23943] Error undefined method `repository_url' when tryinfg to use composed images for system deployments in Red Hat Satellite 6

            Errata Tool added a comment -

            Since the problem described in this issue should be resolved in a recent advisory, it has been closed.

            For information on the advisory (Critical: Satellite 6.16.0 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-2024:8906

            Errata Tool added a comment - Since the problem described in this issue should be resolved in a recent advisory, it has been closed. For information on the advisory (Critical: Satellite 6.16.0 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-2024:8906

            Verified.
            Tested on Satellite stream snap 69.0
            Version: rubygem-katello-4.14.0-0.4.pre.master.20240725144255gitd207d35.el8sat.noarch
             
            Steps:
            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/test_custom_product/test_file_repo/rhel-8.10-x86_64-boot.iso`
            5. Try to render the kickstart template
             
            Observations:
            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 
            Also, I encountered a SAT-27220 issue while uploading RHEL ISO to a file type repository, which had to be worked around by uploading it to 6.15.z and testing it after upgrading to stream/6.16

            Gaurav Talreja added a comment - Verified. Tested on Satellite stream snap 69.0 Version: rubygem-katello-4.14.0-0.4.pre.master.20240725144255gitd207d35.el8sat.noarch   Steps: 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/test_custom_product/test_file_repo/rhel-8.10-x86_64-boot.iso` 5. Try to render the kickstart template   Observations: 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   Also, I encountered a SAT-27220 issue while uploading RHEL ISO to a file type repository, which had to be worked around by uploading it to 6.15.z and testing it after upgrading to stream/6.16

            gtalreja@redhat.com I see that the Satellite team is assigned to the Rocket. Any progress with testing or do you need help from DEVs?

            Leos Stejskal added a comment - gtalreja@redhat.com I see that the Satellite team is assigned to the Rocket. Any progress with testing or do you need help from DEVs?

            Eric Helms added a comment -

            This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

            Due to differences in account names between systems, some fields were not replicated. Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

            To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "SAT-" followed by an integer. You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

            "Bugzilla Bug" = 1234567

            In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues@redhat.com. You can also visit https://access.redhat.com/articles/7032570 for general account information.

            Eric Helms added a comment - This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there. Due to differences in account names between systems, some fields were not replicated. Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information. To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "SAT-" followed by an integer. You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like: "Bugzilla Bug" = 1234567 In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues@redhat.com. You can also visit https://access.redhat.com/articles/7032570 for general account information.

            Sayan Das added a comment - - edited

            Sayan Das added a comment - - edited Created the doc BZ https://bugzilla.redhat.com/show_bug.cgi?id=2280349

            Bryan Kearney added a comment - - edited

            Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/37268 has been resolved.

            Bryan Kearney added a comment - - edited Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/37268 has been resolved.

            Bryan Kearney added a comment - - edited

            Upstream bug assigned to iballou@redhat.com

            Bryan Kearney added a comment - - edited Upstream bug assigned to iballou@redhat.com

            Bryan Kearney added a comment - - edited

            Upstream bug assigned to iballou@redhat.com

            Bryan Kearney added a comment - - edited Upstream bug assigned to iballou@redhat.com

            Ian Ballou added a comment - - edited

            Created redmine issue https://projects.theforeman.org/issues/37268 from this bug

            Ian Ballou added a comment - - edited Created redmine issue https://projects.theforeman.org/issues/37268 from this bug

              iballou@redhat.com Ian Ballou
              rhn-support-saydas Sayan Das
              Gaurav Talreja Gaurav Talreja
              Lena Ansorgová Lena Ansorgová
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: