Install errata on hosts and then perform any other actions using Rerun fails

So when applying errata to hosts, it normally require a restart of one or several services.
So what I do is select an errata I want to patch, select a bunch of hosts from the errata page, apply it to the hosts, when completed from the “job_invocations” page, I hit the button “Rerun” to perform a task on the same selection of hosts and for example change the “Job category” to “Commands” and run the command “systemctl restart sssd” on the hosts. However when I do I get this error:
image
I am doing something unsupported?
On Foreman 3.6.1/Katello 4.8.1.

Some logs:

2023-06-21T09:15:46 [I|app|2c749fd5] Started POST "/api/job_invocations" for 11.11.11.11 at 2023-06-21 09:15:46 +0000
2023-06-21T09:15:46 [I|app|2c749fd5] Processing by Api::V2::JobInvocationsController#create as JSON
2023-06-21T09:15:46 [I|app|2c749fd5]   Parameters: {"organization"=>{"id"=>1, "title"=>"dummy"}, "job_invocation"=>{"job_template_id"=>157, "targeting_type"=>"static_query", "randomized_ordering"=>nil, "inputs"=>{"errata"=>"ALSA-2023:3559", "command"=>"systemctl restart sssd", "pre_script"=>nil, "post_script"=>nil, "options"=>nil}, "ssh_user"=>nil, "ssh"=>{"effective_user"=>"root"}, "recurrence"=>nil, "scheduling"=>nil, "concurrency_control"=>{"time_span"=>"", "concurrency_level"=>""}, "bookmark_id"=>nil, "search_query"=>"name ^ (host1.test.internal,host2.test.internal)", "description_format"=>"Run %{command}", "execution_timeout_interval"=>"", "time_to_pickup"=>""}, "apiv"=>"v2"}
2023-06-21T09:15:46 [W|app|2c749fd5] Action failed
2023-06-21T09:15:46 [I|app|2c749fd5] Backtrace for 'Action failed' error (Foreman::Exception): ERF42-9222 [Foreman::Exception]: Unknown input errata for template Run Command - Script Default
 2c749fd5 | /usr/share/gems/gems/foreman_remote_execution-9.1.0/app/models/job_invocation_composer.rb:188:in `block in template_invocations_params'
 2c749fd5 | /usr/share/gems/gems/foreman_remote_execution-9.1.0/app/models/job_invocation_composer.rb:185:in `each'
 2c749fd5 | /usr/share/gems/gems/foreman_remote_execution-9.1.0/app/models/job_invocation_composer.rb:185:in `map'
 2c749fd5 | /usr/share/gems/gems/foreman_remote_execution-9.1.0/app/models/job_invocation_composer.rb:185:in `template_invocations_params'
 2c749fd5 | /usr/share/gems/gems/foreman_remote_execution-9.1.0/app/models/job_invocation_composer.rb:134:in `params'
 2c749fd5 | /usr/share/gems/gems/foreman_remote_execution-9.1.0/app/models/job_invocation_composer.rb:399:in `from_api_params'
 2c749fd5 | /usr/share/gems/gems/foreman_remote_execution-9.1.0/app/controllers/api/v2/job_invocations_controller.rb:91:in `create'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/abstract_controller/base.rb:228:in `process_action'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_controller/metal/rendering.rb:30:in `process_action'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/abstract_controller/callbacks.rb:42:in `block in process_action'
 2c749fd5 | /usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
 2c749fd5 | /usr/share/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
 2c749fd5 | /usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 2c749fd5 | /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
 2c749fd5 | /usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 2c749fd5 | /usr/share/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
 2c749fd5 | /usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 2c749fd5 | /usr/share/gems/gems/audited-5.3.1/lib/audited/sweeper.rb:16:in `around'
 2c749fd5 | /usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 2c749fd5 | /usr/share/gems/gems/audited-5.3.1/lib/audited/sweeper.rb:16:in `around'
 2c749fd5 | /usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 2c749fd5 | /usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/callbacks.rb:137:in `run_callbacks'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/abstract_controller/callbacks.rb:41:in `process_action'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_controller/metal/rescue.rb:22:in `process_action'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
 2c749fd5 | /usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/notifications.rb:203:in `block in instrument'
 2c749fd5 | /usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
 2c749fd5 | /usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/notifications.rb:203:in `instrument'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_controller/metal/instrumentation.rb:33:in `process_action'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_controller/metal/params_wrapper.rb:249:in `process_action'
 2c749fd5 | /usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/abstract_controller/base.rb:165:in `process'
 2c749fd5 | /usr/share/gems/gems/actionview-6.1.7.3/lib/action_view/rendering.rb:39:in `process'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_controller/metal.rb:190:in `dispatch'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_controller/metal.rb:254:in `dispatch'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/routing/route_set.rb:33:in `serve'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/routing/mapper.rb:19:in `block in <class:Constraints>'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/routing/mapper.rb:49:in `serve'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/journey/router.rb:50:in `block in serve'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/journey/router.rb:32:in `each'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/journey/router.rb:32:in `serve'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/routing/route_set.rb:842:in `call'
 2c749fd5 | /usr/share/gems/gems/katello-4.8.1/lib/katello/middleware/organization_created_enforcer.rb:18:in `call'
 2c749fd5 | /usr/share/gems/gems/katello-4.8.1/lib/katello/middleware/event_daemon.rb:10:in `call'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/static.rb:24:in `call'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/static.rb:24:in `call'
 2c749fd5 | /usr/share/gems/gems/apipie-dsl-2.5.0/lib/apipie_dsl/static_dispatcher.rb:67:in `call'
 2c749fd5 | /usr/share/gems/gems/apipie-rails-0.8.2/lib/apipie/static_dispatcher.rb:68:in `call'
 2c749fd5 | /usr/share/gems/gems/apipie-rails-0.8.2/lib/apipie/extractor/recorder.rb:137:in `call'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/static.rb:24:in `call'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/static.rb:24:in `call'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/static.rb:24:in `call'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/static.rb:24:in `call'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/static.rb:24:in `call'
 2c749fd5 | /usr/share/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in `call'
 2c749fd5 | /usr/share/foreman/lib/foreman/middleware/telemetry.rb:10:in `call'
 2c749fd5 | /usr/share/gems/gems/apipie-rails-0.8.2/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
 2c749fd5 | /usr/share/gems/gems/rack-2.2.6.2/lib/rack/tempfile_reaper.rb:15:in `call'
 2c749fd5 | /usr/share/gems/gems/rack-2.2.6.2/lib/rack/etag.rb:27:in `call'
 2c749fd5 | /usr/share/gems/gems/rack-2.2.6.2/lib/rack/conditional_get.rb:40:in `call'
 2c749fd5 | /usr/share/gems/gems/rack-2.2.6.2/lib/rack/head.rb:12:in `call'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/http/permissions_policy.rb:22:in `call'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/http/content_security_policy.rb:19:in `call'
 2c749fd5 | /usr/share/foreman/lib/foreman/middleware/logging_context_session.rb:22:in `call'
 2c749fd5 | /usr/share/gems/gems/rack-2.2.6.2/lib/rack/session/abstract/id.rb:266:in `context'
 2c749fd5 | /usr/share/gems/gems/rack-2.2.6.2/lib/rack/session/abstract/id.rb:260:in `call'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/cookies.rb:697:in `call'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
 2c749fd5 | /usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/callbacks.rb:98:in `run_callbacks'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
 2c749fd5 | /usr/share/gems/gems/railties-6.1.7.3/lib/rails/rack/logger.rb:37:in `call_app'
 2c749fd5 | /usr/share/gems/gems/railties-6.1.7.3/lib/rails/rack/logger.rb:28:in `call'
 2c749fd5 | /usr/share/gems/gems/sprockets-rails-3.4.2/lib/sprockets/rails/quiet_assets.rb:13:in `call'
 2c749fd5 | /usr/share/foreman/lib/foreman/middleware/logging_context_request.rb:11:in `call'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/request_id.rb:26:in `call'
 2c749fd5 | /usr/share/gems/gems/katello-4.8.1/lib/katello/prevent_json_parsing.rb:12:in `call'
 2c749fd5 | /usr/share/gems/gems/rack-2.2.6.2/lib/rack/method_override.rb:24:in `call'
 2c749fd5 | /usr/share/gems/gems/rack-2.2.6.2/lib/rack/runtime.rb:22:in `call'
 2c749fd5 | /usr/share/gems/gems/activesupport-6.1.7.3/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/executor.rb:14:in `call'
 2c749fd5 | /usr/share/gems/gems/rack-2.2.6.2/lib/rack/sendfile.rb:110:in `call'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/ssl.rb:77:in `call'
 2c749fd5 | /usr/share/gems/gems/actionpack-6.1.7.3/lib/action_dispatch/middleware/host_authorization.rb:142:in `call'
 2c749fd5 | /usr/share/gems/gems/secure_headers-6.5.0/lib/secure_headers/middleware.rb:11:in `call'
 2c749fd5 | /usr/share/gems/gems/railties-6.1.7.3/lib/rails/engine.rb:539:in `call'
 2c749fd5 | /usr/share/gems/gems/railties-6.1.7.3/lib/rails/railtie.rb:207:in `public_send'
 2c749fd5 | /usr/share/gems/gems/railties-6.1.7.3/lib/rails/railtie.rb:207:in `method_missing'
 2c749fd5 | /usr/share/gems/gems/rack-2.2.6.2/lib/rack/urlmap.rb:74:in `block in call'
 2c749fd5 | /usr/share/gems/gems/rack-2.2.6.2/lib/rack/urlmap.rb:58:in `each'
 2c749fd5 | /usr/share/gems/gems/rack-2.2.6.2/lib/rack/urlmap.rb:58:in `call'
 2c749fd5 | /usr/share/gems/gems/puma-5.6.5/lib/puma/configuration.rb:252:in `call'
 2c749fd5 | /usr/share/gems/gems/puma-5.6.5/lib/puma/request.rb:77:in `block in handle_request'
 2c749fd5 | /usr/share/gems/gems/puma-5.6.5/lib/puma/thread_pool.rb:340:in `with_force_shutdown'
 2c749fd5 | /usr/share/gems/gems/puma-5.6.5/lib/puma/request.rb:76:in `handle_request'
 2c749fd5 | /usr/share/gems/gems/puma-5.6.5/lib/puma/server.rb:443:in `process_client'
 2c749fd5 | /usr/share/gems/gems/puma-5.6.5/lib/puma/thread_pool.rb:147:in `block in spawn_thread'
 2c749fd5 | /usr/share/gems/gems/logging-2.3.1/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2023-06-21T09:15:46 [I|app|2c749fd5]   Rendered api/v2/errors/standard_error.json.rabl within api/v2/layouts/error_layout (Duration: 2.1ms | Allocations: 264)
2023-06-21T09:15:46 [I|app|2c749fd5]   Rendered layout api/v2/layouts/error_layout.json.erb (Duration: 8.5ms | Allocations: 6048)
2023-06-21T09:15:46 [I|app|2c749fd5] Completed 500 Internal Server Error in 26ms (Views: 9.5ms | ActiveRecord: 2.1ms | Allocations: 11831)

However pretty simple to get the error, just patch any host using the errata page and try Rerun and perform any command.

This will need to be looked at by a dev, from what I see it looks like the form is storing data from the first job and sending it with the data of the second job, despite the second form not having those fields.
You might want to open an issue for this at Overview - Foreman Remote Execution - Foreman
In the meantime until this gets fixed, your best bet would probably be to copy-paste the original host filter/search expression from the first job into a fresh job invocation form (create new job invocation instead of rerun), which would be what I assume is why you are using rerun in the first place.

Yeah, it seems like it’s using the inputs from the previous job template in the newly selected one. It should probably not let you do that; looks like a bug to me.