Red Hat Satellite engineering is moving the tracking of its product development work on Satellite 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 "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. 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 "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-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 1899158 - search in job templates fail with error "undefined method `resource_type' for nil:NilClass"
Summary: search in job templates fail with error "undefined method `resource_type' for...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Remote Execution
Version: 6.8.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.9.0
Assignee: Adam Ruzicka
QA Contact: Peter Ondrejka
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-11-18 16:02 UTC by Stefan Meyer
Modified: 2021-04-21 13:18 UTC (History)
3 users (show)

Fixed In Version: tfm-rubygem-foreman_remote_execution-4.2.1,foreman-2.3.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-04-21 13:18:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
example job template (1.25 KB, text/plain)
2020-11-18 16:02 UTC, Stefan Meyer
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 30933 0 Normal Closed undefined method `resource_type' for nil:NilClass when going to new job invocation form with template which has input of... 2021-02-19 16:24:57 UTC
Foreman Issue Tracker 30934 0 Normal Closed _invocation_form partial has hardcoded reference to report templates 2021-02-19 16:24:56 UTC

Description Stefan Meyer 2020-11-18 16:02:51 UTC
Created attachment 1730599 [details]
example job template

Description of problem:
When configuring a job template with
 - Input Type = User input,
 - Value Type = search 
 - Resource Type = Capsule
the rendering of the template fails with error "undefined method `resource_type' for nil:NilClass"
  

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

How reproducible:
Whenever a search is used and no options are set for the input.

Steps to Reproduce:
1. Import attach job template
2. Run new template


Actual results:
- Error message: "undefined method `resource_type' for nil:NilClass" in GUI
- Extract from production log:

2020-11-18T16:49:14 [I|app|98376017] Started GET "/job_invocations/new?authorizer=%23%3CAuthorizer%3A0x00007f07728630c8%3E&template_id=522" for 192.168.2.89 at 2020-11-18 16:49:14 +0100
2020-11-18T16:49:14 [I|app|98376017] Processing by JobInvocationsController#new as HTML
2020-11-18T16:49:14 [I|app|98376017]   Parameters: {"authorizer"=>"#<Authorizer:0x00007f07728630c8>", "template_id"=>"522"}
2020-11-18T16:49:14 [I|app|98376017]   Rendering /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-3.3.7/app/views/job_invocations/new.html.erb within layouts/application
2020-11-18T16:49:14 [I|app|98376017]   Rendered template_inputs/_invocation_form.html.erb (Duration: 6.4ms | Allocations: 6752)
2020-11-18T16:49:14 [I|app|98376017]   Rendered template_inputs/_invocation_form.html.erb (Duration: 4.9ms | Allocations: 6725)
2020-11-18T16:49:14 [I|app|98376017]   Rendered template_inputs/_invocation_form.html.erb (Duration: 5.9ms | Allocations: 7161)
2020-11-18T16:49:14 [I|app|98376017]   Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-3.3.7/app/views/job_invocations/_form.html.erb (Duration: 59.5ms | Allocations: 43354)
2020-11-18T16:49:14 [I|app|98376017]   Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_remote_execution-3.3.7/app/views/job_invocations/new.html.erb within layouts/application (Duration: 66.0ms | Allocations: 50062)
2020-11-18T16:49:14 [W|app|98376017] Action failed
2020-11-18T16:49:14 [I|app|98376017]   Rendering common/500.html.erb within layouts/application
2020-11-18T16:49:14 [I|app|98376017]   Rendered common/500.html.erb within layouts/application (Duration: 5.0ms | Allocations: 7072)
2020-11-18T16:49:14 [I|app|98376017]   Rendered layouts/_application_content.html.erb (Duration: 3.9ms | Allocations: 6555)
2020-11-18T16:49:14 [I|app|98376017]   Rendering layouts/base.html.erb
2020-11-18T16:49:14 [I|app|98376017]   Rendered /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-6.0.1.7/app/views/foreman_theme_satellite/_theme_client_side_branding.js.erb (Duration: 6.4ms | Allocations: 6939)
2020-11-18T16:49:14 [I|app|98376017]   Rendered layouts/base.html.erb (Duration: 13.9ms | Allocations: 15403)
2020-11-18T16:49:14 [I|app|98376017] Completed 500 Internal Server Error in 129ms (Views: 27.5ms | ActiveRecord: 8.7ms | Allocations: 98026)

Expected results:
- Search in templates should work

Additional info:
- This seems to be fixed upstream: https://projects.theforeman.org/issues/30933

Comment 1 Adam Ruzicka 2020-11-19 15:13:44 UTC
> This seems to be fixed upstream

Fixes are ready in upstream, but not merged yet. Just to be correct

Comment 2 Bryan Kearney 2020-11-23 16:03:53 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/30933 has been resolved.

Comment 3 Peter Ondrejka 2020-12-09 15:28:27 UTC
Verified in Satellite 6.9 sn 4, a job template with custom search user input executes correctly

Comment 6 errata-xmlrpc 2021-04-21 13:18:56 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.9 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-2021:1313


Note You need to log in before you can comment on or make changes to this bug.