Error message shown when editing a host in host details page: Oops, we're sorry but something went wrong Lifecycle environment must be specified

Problem: After upgrading to 3.7.1 from 3.6.x an error shows when editing a host in the UI
Oops, we’re sorry but something went wrong Lifecycle environment must be specified
Hosts > All Hosts > Edit > Make any change or no change > Press Submit
Error is shown.

Steps for the upgrade process:

dnf remove puppet6-release*
add puppet 7 repo
dnf install https://yum.puppet.com/puppet7-release-el-8.noarch.rpm
foreman-rake katello:upgrade_check
dnf update
systemctl stop puppetserver
puppetserver ca migrate (this solves certs issue)
dnf update https://yum.theforeman.org/releases/3.7/el8/x86_64/foreman-release.rpm
https://yum.theforeman.org/katello/4.9/katello/el8/x86_64/katello-repos-latest.rpm
dnf module enable katello:el8 pulpcore:el8
foreman-maintain service stop
dnf update
foreman-installer

Expected outcome: Able to edit hosts without error

Foreman and Proxy versions: Foreman 3.7.1

Foreman and Proxy plugin versions:

Distribution and version: Rocky 8.8

Other relevant data:
Production log:


2023-11-06T14:53:38 [I|app|a4c47110] Completed 200 OK in 38ms (Views: 14.9ms | ActiveRecord: 2.7ms | Allocations: 32344)
2023-11-06T14:53:45 [I|app|3f8eedd0] Started PATCH "/hosts/160" for 10.31.35.68 at 2023-11-06 14:53:45 -0500
2023-11-06T14:53:45 [I|app|3f8eedd0] Processing by HostsController#update as */*
2023-11-06T14:53:45 [I|app|3f8eedd0]   Parameters: {"utf8"=>"✓", "authenticity_token"=>"vxqQTfFMUAgyMWD6YMCa2MZp3LiC4spRTQtHTninmgio9ck3G4IoGSBEx/Q4tcELyHJau9NiXmfeGE0O3oT0zA==", "host"=>{"name"=>"uscdc01tlgrl001", "hostgroup_id"=>"7", "puppet_attributes"=>{"environment_id"=>"2"}, "puppet_proxy_id"=>"1", "puppet_ca_proxy_id"=>"1", "openscap_proxy_id"=>"1", "realm_id"=>"1", "config_group_ids"=>[""], "puppetclass_ids"=>[""], "managed"=>"true", "uuid"=>"50211379-a21a-00a8-47a4-5f2496a423ef", "progress_report_id"=>"[FILTERED]", "interfaces_attributes"=>{"0"=>{"_destroy"=>"0", "identifier"=>"ens160", "name"=>"uscdc01tlgrl001", "domain_id"=>"1", "subnet_id"=>"2", "ip"=>"10.29.148.50", "ip6"=>"", "managed"=>"1", "primary"=>"1", "provision"=>"0", "execution"=>"1", "tag"=>"", "attached_to"=>"", "id"=>"323"}, "1"=>{"_destroy"=>"0", "identifier"=>"ens192", "name"=>"uscdc01tlgrl001-mgmt", "domain_id"=>"5", "subnet_id"=>"5", "ip"=>"10.35.123.165", "ip6"=>"", "managed"=>"1", "primary"=>"0", "provision"=>"1", "execution"=>"0", "tag"=>"", "attached_to"=>"", "id"=>"324"}}, "compute_attributes"=>{"cpus"=>"2", "corespersocket"=>"1", "memory_mb"=>"4096", "boot_order"=>["network", "disk"], "scsi_controllers"=>"{\"scsiControllers\":[{\"type\":\"VirtualLsiLogicController\",\"shared_bus\":\"noSharing\",\"unit_number\":7,\"key\":1000},{\"type\":\"VirtualLsiLogicController\",\"shared_bus\":\"noSharing\",\"unit_number\":7,\"key\":1001}],\"volumes\":[{\"thin\":true,\"name\":\"Hard disk 1\",\"mode\":\"persistent\",\"controllerKey\":1000,\"serverId\":\"50211379-a21a-00a8-47a4-5f2496a423ef\",\"datastore\":\"USCDC01-SAN-SC03-VMW-063\",\"id\":\"6000C292-97f6-5948-08bc-ac11dfbdf7aa\",\"eagerZero\":false,\"filename\":\"[USCDC01-SAN-SC03-VMW-063] uscdc01tlgrl001/uscdc01tlgrl001.vmdk\",\"unitNumber\":0,\"sizeGb\":35},{\"thin\":true,\"name\":\"Hard disk 2\",\"mode\":\"persistent\",\"controllerKey\":1001,\"serverId\":\"50211379-a21a-00a8-47a4-5f2496a423ef\",\"datastore\":\"USCDC01-SAN-SC03-VMW-063\",\"id\":\"6000C29f-4a78-84b3-51ff-375d979230e6\",\"eagerZero\":false,\"filename\":\"[USCDC01-SAN-SC03-VMW-063] uscdc01tlgrl001/uscdc01tlgrl001_1.vmdk\",\"unitNumber\":0,\"sizeGb\":20}]}"}, "architecture_id"=>"1", "operatingsystem_id"=>"42", "medium_id"=>"", "content_facet_attributes"=>{"kickstart_repository_id"=>"959"}, "ptable_id"=>"", "pxe_loader"=>"PXELinux BIOS", "disk"=>"", "host_parameters_attributes"=>{"0"=>{"name"=>"Backup", "parameter_type"=>"string", "value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"false", "id"=>"132"}}, "is_owned_by"=>"16-Users", "enabled"=>"1", "comment"=>"", "overwrite"=>"false"}, "media_selector"=>"synced_content", "id"=>"160"}
2023-11-06T14:53:45 [I|app|3f8eedd0] set_up_content_view_environment: cv_id=, env_id=
2023-11-06T14:53:45 [W|app|3f8eedd0] Lifecycle environment must be specified
2023-11-06T14:53:45 [I|app|3f8eedd0] Backtrace for 'Lifecycle environment must be specified' error (RuntimeError): Lifecycle environment must be specified
 3f8eedd0 | /usr/share/gems/gems/katello-4.9.2/app/models/katello/host/content_facet.rb:100:in `assign_single_environment'
 3f8eedd0 | /usr/share/gems/gems/katello-4.9.2/app/controllers/katello/concerns/content_facet_hosts_controller_extensions.rb:13:in `set_up_content_view_environment'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:427:in `block in make_lambda'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:179:in `block (2 levels) in halting_and_conditional'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/abstract_controller/callbacks.rb:34:in `block (2 levels) in <module:Callbacks>'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:180:in `block in halting_and_conditional'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:512:in `block in invoke_before'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:512:in `each'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:512:in `invoke_before'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:115:in `block in run_callbacks'
 3f8eedd0 | /usr/share/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 3f8eedd0 | /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 3f8eedd0 | /usr/share/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 3f8eedd0 | /usr/share/gems/gems/audited-5.3.3/lib/audited/sweeper.rb:16:in `around'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 3f8eedd0 | /usr/share/gems/gems/audited-5.3.3/lib/audited/sweeper.rb:16:in `around'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:137:in `run_callbacks'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/abstract_controller/callbacks.rb:41:in `process_action'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal/rescue.rb:22:in `process_action'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/notifications.rb:203:in `block in instrument'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/notifications.rb:203:in `instrument'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal/instrumentation.rb:33:in `process_action'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal/params_wrapper.rb:249:in `process_action'
 3f8eedd0 | /usr/share/gems/gems/activerecord-6.1.7.6/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/abstract_controller/base.rb:165:in `process'
 3f8eedd0 | /usr/share/gems/gems/actionview-6.1.7.6/lib/action_view/rendering.rb:39:in `process'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal.rb:190:in `dispatch'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal.rb:254:in `dispatch'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/routing/route_set.rb:33:in `serve'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/journey/router.rb:50:in `block in serve'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/journey/router.rb:32:in `each'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/journey/router.rb:32:in `serve'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/routing/route_set.rb:842:in `call'
 3f8eedd0 | /usr/share/gems/gems/katello-4.9.2/lib/katello/middleware/organization_created_enforcer.rb:18:in `call'
 3f8eedd0 | /usr/share/gems/gems/katello-4.9.2/lib/katello/middleware/event_daemon.rb:10:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 3f8eedd0 | /usr/share/gems/gems/apipie-dsl-2.5.0/lib/apipie_dsl/static_dispatcher.rb:67:in `call'
 3f8eedd0 | /usr/share/gems/gems/apipie-rails-1.1.0/lib/apipie/static_dispatcher.rb:68:in `call'
 3f8eedd0 | /usr/share/gems/gems/apipie-rails-1.1.0/lib/apipie/extractor/recorder.rb:139:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 3f8eedd0 | /usr/share/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in `call'
 3f8eedd0 | /usr/share/foreman/lib/foreman/middleware/telemetry.rb:10:in `call'
 3f8eedd0 | /usr/share/gems/gems/apipie-rails-1.1.0/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
 3f8eedd0 | /usr/share/gems/gems/rack-2.2.7/lib/rack/tempfile_reaper.rb:15:in `call'
 3f8eedd0 | /usr/share/gems/gems/rack-2.2.7/lib/rack/etag.rb:27:in `call'
 3f8eedd0 | /usr/share/gems/gems/rack-2.2.7/lib/rack/conditional_get.rb:40:in `call'
 3f8eedd0 | /usr/share/gems/gems/rack-2.2.7/lib/rack/head.rb:12:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/http/permissions_policy.rb:22:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/http/content_security_policy.rb:19:in `call'
 3f8eedd0 | /usr/share/foreman/lib/foreman/middleware/logging_context_session.rb:22:in `call'
 3f8eedd0 | /usr/share/gems/gems/rack-2.2.7/lib/rack/session/abstract/id.rb:266:in `context'
 3f8eedd0 | /usr/share/gems/gems/rack-2.2.7/lib/rack/session/abstract/id.rb:260:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/cookies.rb:697:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:98:in `run_callbacks'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
 3f8eedd0 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/rack/logger.rb:37:in `call_app'
 3f8eedd0 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/rack/logger.rb:28:in `call'
 3f8eedd0 | /usr/share/gems/gems/sprockets-rails-3.4.2/lib/sprockets/rails/quiet_assets.rb:13:in `call'
 3f8eedd0 | /usr/share/foreman/lib/foreman/middleware/logging_context_request.rb:11:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
 3f8eedd0 | /usr/share/gems/gems/request_store-1.5.1/lib/request_store/middleware.rb:19:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/request_id.rb:26:in `call'
 3f8eedd0 | /usr/share/gems/gems/katello-4.9.2/lib/katello/prevent_json_parsing.rb:12:in `call'
 3f8eedd0 | /usr/share/gems/gems/rack-2.2.7/lib/rack/method_override.rb:24:in `call'
 3f8eedd0 | /usr/share/gems/gems/rack-2.2.7/lib/rack/runtime.rb:22:in `call'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/executor.rb:14:in `call'
 3f8eedd0 | /usr/share/gems/gems/rack-2.2.7/lib/rack/sendfile.rb:110:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/ssl.rb:77:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/host_authorization.rb:142:in `call'
 3f8eedd0 | /usr/share/gems/gems/secure_headers-6.5.0/lib/secure_headers/middleware.rb:11:in `call'
 3f8eedd0 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/engine.rb:539:in `call'
 3f8eedd0 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/railtie.rb:207:in `public_send'
 3f8eedd0 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/railtie.rb:207:in `method_missing'
 3f8eedd0 | /usr/share/gems/gems/rack-2.2.7/lib/rack/urlmap.rb:74:in `block in call'
 3f8eedd0 | /usr/share/gems/gems/rack-2.2.7/lib/rack/urlmap.rb:58:in `each'
 3f8eedd0 | /usr/share/gems/gems/rack-2.2.7/lib/rack/urlmap.rb:58:in `call'
 3f8eedd0 | /usr/share/gems/gems/puma-6.2.2/lib/puma/configuration.rb:270:in `call'
 3f8eedd0 | /usr/share/gems/gems/puma-6.2.2/lib/puma/request.rb:98:in `block in handle_request'
 3f8eedd0 | /usr/share/gems/gems/puma-6.2.2/lib/puma/thread_pool.rb:340:in `with_force_shutdown'
 3f8eedd0 | /usr/share/gems/gems/puma-6.2.2/lib/puma/request.rb:97:in `handle_request'
 3f8eedd0 | /usr/share/gems/gems/puma-6.2.2/lib/puma/server.rb:431:in `process_client'
 3f8eedd0 | /usr/share/gems/gems/puma-6.2.2/lib/puma/server.rb:233:in `block in run'
 3f8eedd0 | /usr/share/gems/gems/puma-6.2.2/lib/puma/thread_pool.rb:147:in `block in spawn_thread'
 3f8eedd0 | /usr/share/gems/gems/logging-2.3.1/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2023-11-06T14:53:45 [I|app|3f8eedd0]   Rendered common/500.html.erb (Duration: 24.0ms | Allocations: 6791)
2023-11-06T14:53:45 [I|app|3f8eedd0] Completed 500 Internal Server Error in 40ms (Views: 24.8ms | ActiveRecord: 2.3ms | Allocations: 10543)
2023-11-06T14:53:47 [I|app|743842fe] Started GET "/notification_recipients" for 10.31.35.68 at 2023-11-06 14:53:47 -0500
2023-11-06T14:53:47 [I|app|743842fe] Processing by NotificationRecipientsController#index as JSON
2023-11-06T14:53:47 [I|app|743842fe] Completed 200 OK in 7ms (Views: 0.2ms | ActiveRecord: 1.0ms | Allocations: 1717)

root@uscdc01tlsat010:~# foreman-rake errors:fetch_log request_id=3f8eedd0
Foreman version: 3.7.1
Plugins:
 - foreman-tasks 8.1.1
 - foreman_ansible 12.0.6
 - foreman_discovery 22.0.4
 - foreman_leapp 0.1.14
 - foreman_openscap 7.0.0
 - foreman_puppet 6.0.0
 - foreman_remote_execution 10.1.0
 - foreman_webhooks 3.2.1
 - katello 4.9.2

2023-11-06T14:53:45 [I|app|3f8eedd0] Started PATCH "/hosts/160" for 10.31.35.68 at 2023-11-06 14:53:45 -0500
2023-11-06T14:53:45 [I|app|3f8eedd0] Processing by HostsController#update as */*
2023-11-06T14:53:45 [I|app|3f8eedd0]   Parameters: {"utf8"=>"✓", "authenticity_token"=>"vxqQTfFMUAgyMWD6YMCa2MZp3LiC4spRTQtHTninmgio9ck3G4IoGSBEx/Q4tcELyHJau9NiXmfeGE0O3oT0zA==", "host"=>{"name"=>"uscdc01tlgrl001", "hostgroup_id"=>"7", "puppet_attributes"=>{"environment_id"=>"2"}, "puppet_proxy_id"=>"1", "puppet_ca_proxy_id"=>"1", "openscap_proxy_id"=>"1", "realm_id"=>"1", "config_group_ids"=>[""], "puppetclass_ids"=>[""], "managed"=>"true", "uuid"=>"50211379-a21a-00a8-47a4-5f2496a423ef", "progress_report_id"=>"[FILTERED]", "interfaces_attributes"=>{"0"=>{"_destroy"=>"0", "identifier"=>"ens160", "name"=>"uscdc01tlgrl001", "domain_id"=>"1", "subnet_id"=>"2", "ip"=>"10.29.148.50", "ip6"=>"", "managed"=>"1", "primary"=>"1", "provision"=>"0", "execution"=>"1", "tag"=>"", "attached_to"=>"", "id"=>"323"}, "1"=>{"_destroy"=>"0", "identifier"=>"ens192", "name"=>"uscdc01tlgrl001-mgmt", "domain_id"=>"5", "subnet_id"=>"5", "ip"=>"10.35.123.165", "ip6"=>"", "managed"=>"1", "primary"=>"0", "provision"=>"1", "execution"=>"0", "tag"=>"", "attached_to"=>"", "id"=>"324"}}, "compute_attributes"=>{"cpus"=>"2", "corespersocket"=>"1", "memory_mb"=>"4096", "boot_order"=>["network", "disk"], "scsi_controllers"=>"{\"scsiControllers\":[{\"type\":\"VirtualLsiLogicController\",\"shared_bus\":\"noSharing\",\"unit_number\":7,\"key\":1000},{\"type\":\"VirtualLsiLogicController\",\"shared_bus\":\"noSharing\",\"unit_number\":7,\"key\":1001}],\"volumes\":[{\"thin\":true,\"name\":\"Hard disk 1\",\"mode\":\"persistent\",\"controllerKey\":1000,\"serverId\":\"50211379-a21a-00a8-47a4-5f2496a423ef\",\"datastore\":\"USCDC01-SAN-SC03-VMW-063\",\"id\":\"6000C292-97f6-5948-08bc-ac11dfbdf7aa\",\"eagerZero\":false,\"filename\":\"[USCDC01-SAN-SC03-VMW-063] uscdc01tlgrl001/uscdc01tlgrl001.vmdk\",\"unitNumber\":0,\"sizeGb\":35},{\"thin\":true,\"name\":\"Hard disk 2\",\"mode\":\"persistent\",\"controllerKey\":1001,\"serverId\":\"50211379-a21a-00a8-47a4-5f2496a423ef\",\"datastore\":\"USCDC01-SAN-SC03-VMW-063\",\"id\":\"6000C29f-4a78-84b3-51ff-375d979230e6\",\"eagerZero\":false,\"filename\":\"[USCDC01-SAN-SC03-VMW-063] uscdc01tlgrl001/uscdc01tlgrl001_1.vmdk\",\"unitNumber\":0,\"sizeGb\":20}]}"}, "architecture_id"=>"1", "operatingsystem_id"=>"42", "medium_id"=>"", "content_facet_attributes"=>{"kickstart_repository_id"=>"959"}, "ptable_id"=>"", "pxe_loader"=>"PXELinux BIOS", "disk"=>"", "host_parameters_attributes"=>{"0"=>{"name"=>"Backup", "parameter_type"=>"string", "value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"false", "id"=>"132"}}, "is_owned_by"=>"16-Users", "enabled"=>"1", "comment"=>"", "overwrite"=>"false"}, "media_selector"=>"synced_content", "id"=>"160"}
2023-11-06T14:53:45 [I|app|3f8eedd0] set_up_content_view_environment: cv_id=, env_id=
2023-11-06T14:53:45 [W|app|3f8eedd0] Lifecycle environment must be specified
2023-11-06T14:53:45 [I|app|3f8eedd0] Backtrace for 'Lifecycle environment must be specified' error (RuntimeError): Lifecycle environment must be specified
 3f8eedd0 | /usr/share/gems/gems/katello-4.9.2/app/models/katello/host/content_facet.rb:100:in `assign_single_environment'
 3f8eedd0 | /usr/share/gems/gems/katello-4.9.2/app/controllers/katello/concerns/content_facet_hosts_controller_extensions.rb:13:in `set_up_content_view_environment'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:427:in `block in make_lambda'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:179:in `block (2 levels) in halting_and_conditional'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/abstract_controller/callbacks.rb:34:in `block (2 levels) in <module:Callbacks>'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:180:in `block in halting_and_conditional'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:512:in `block in invoke_before'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:512:in `each'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:512:in `invoke_before'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:115:in `block in run_callbacks'
 3f8eedd0 | /usr/share/foreman/app/controllers/concerns/foreman/controller/timezone.rb:10:in `set_timezone'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 3f8eedd0 | /usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 3f8eedd0 | /usr/share/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 3f8eedd0 | /usr/share/gems/gems/audited-5.3.3/lib/audited/sweeper.rb:16:in `around'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 3f8eedd0 | /usr/share/gems/gems/audited-5.3.3/lib/audited/sweeper.rb:16:in `around'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:137:in `run_callbacks'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/abstract_controller/callbacks.rb:41:in `process_action'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal/rescue.rb:22:in `process_action'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal/instrumentation.rb:34:in `block in process_action'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/notifications.rb:203:in `block in instrument'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/notifications.rb:203:in `instrument'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal/instrumentation.rb:33:in `process_action'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal/params_wrapper.rb:249:in `process_action'
 3f8eedd0 | /usr/share/gems/gems/activerecord-6.1.7.6/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/abstract_controller/base.rb:165:in `process'
 3f8eedd0 | /usr/share/gems/gems/actionview-6.1.7.6/lib/action_view/rendering.rb:39:in `process'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal.rb:190:in `dispatch'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_controller/metal.rb:254:in `dispatch'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/routing/route_set.rb:33:in `serve'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/journey/router.rb:50:in `block in serve'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/journey/router.rb:32:in `each'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/journey/router.rb:32:in `serve'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/routing/route_set.rb:842:in `call'
 3f8eedd0 | /usr/share/gems/gems/katello-4.9.2/lib/katello/middleware/organization_created_enforcer.rb:18:in `call'
 3f8eedd0 | /usr/share/gems/gems/katello-4.9.2/lib/katello/middleware/event_daemon.rb:10:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 3f8eedd0 | /usr/share/gems/gems/apipie-dsl-2.5.0/lib/apipie_dsl/static_dispatcher.rb:67:in `call'
 3f8eedd0 | /usr/share/gems/gems/apipie-rails-1.1.0/lib/apipie/static_dispatcher.rb:68:in `call'
 3f8eedd0 | /usr/share/gems/gems/apipie-rails-1.1.0/lib/apipie/extractor/recorder.rb:139:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/static.rb:24:in `call'
 3f8eedd0 | /usr/share/foreman/lib/foreman/middleware/libvirt_connection_cleaner.rb:9:in `call'
 3f8eedd0 | /usr/share/foreman/lib/foreman/middleware/telemetry.rb:10:in `call'
 3f8eedd0 | /usr/share/gems/gems/apipie-rails-1.1.0/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
 3f8eedd0 | /usr/share/gems/gems/rack-2.2.7/lib/rack/tempfile_reaper.rb:15:in `call'
 3f8eedd0 | /usr/share/gems/gems/rack-2.2.7/lib/rack/etag.rb:27:in `call'
 3f8eedd0 | /usr/share/gems/gems/rack-2.2.7/lib/rack/conditional_get.rb:40:in `call'
 3f8eedd0 | /usr/share/gems/gems/rack-2.2.7/lib/rack/head.rb:12:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/http/permissions_policy.rb:22:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/http/content_security_policy.rb:19:in `call'
 3f8eedd0 | /usr/share/foreman/lib/foreman/middleware/logging_context_session.rb:22:in `call'
 3f8eedd0 | /usr/share/gems/gems/rack-2.2.7/lib/rack/session/abstract/id.rb:266:in `context'
 3f8eedd0 | /usr/share/gems/gems/rack-2.2.7/lib/rack/session/abstract/id.rb:260:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/cookies.rb:697:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/callbacks.rb:98:in `run_callbacks'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/actionable_exceptions.rb:18:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/debug_exceptions.rb:29:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
 3f8eedd0 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/rack/logger.rb:37:in `call_app'
 3f8eedd0 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/rack/logger.rb:28:in `call'
 3f8eedd0 | /usr/share/gems/gems/sprockets-rails-3.4.2/lib/sprockets/rails/quiet_assets.rb:13:in `call'
 3f8eedd0 | /usr/share/foreman/lib/foreman/middleware/logging_context_request.rb:11:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
 3f8eedd0 | /usr/share/gems/gems/request_store-1.5.1/lib/request_store/middleware.rb:19:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/request_id.rb:26:in `call'
 3f8eedd0 | /usr/share/gems/gems/katello-4.9.2/lib/katello/prevent_json_parsing.rb:12:in `call'
 3f8eedd0 | /usr/share/gems/gems/rack-2.2.7/lib/rack/method_override.rb:24:in `call'
 3f8eedd0 | /usr/share/gems/gems/rack-2.2.7/lib/rack/runtime.rb:22:in `call'
 3f8eedd0 | /usr/share/gems/gems/activesupport-6.1.7.6/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/executor.rb:14:in `call'
 3f8eedd0 | /usr/share/gems/gems/rack-2.2.7/lib/rack/sendfile.rb:110:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/ssl.rb:77:in `call'
 3f8eedd0 | /usr/share/gems/gems/actionpack-6.1.7.6/lib/action_dispatch/middleware/host_authorization.rb:142:in `call'
 3f8eedd0 | /usr/share/gems/gems/secure_headers-6.5.0/lib/secure_headers/middleware.rb:11:in `call'
 3f8eedd0 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/engine.rb:539:in `call'
 3f8eedd0 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/railtie.rb:207:in `public_send'
 3f8eedd0 | /usr/share/gems/gems/railties-6.1.7.6/lib/rails/railtie.rb:207:in `method_missing'
 3f8eedd0 | /usr/share/gems/gems/rack-2.2.7/lib/rack/urlmap.rb:74:in `block in call'
 3f8eedd0 | /usr/share/gems/gems/rack-2.2.7/lib/rack/urlmap.rb:58:in `each'
 3f8eedd0 | /usr/share/gems/gems/rack-2.2.7/lib/rack/urlmap.rb:58:in `call'
 3f8eedd0 | /usr/share/gems/gems/puma-6.2.2/lib/puma/configuration.rb:270:in `call'
 3f8eedd0 | /usr/share/gems/gems/puma-6.2.2/lib/puma/request.rb:98:in `block in handle_request'
 3f8eedd0 | /usr/share/gems/gems/puma-6.2.2/lib/puma/thread_pool.rb:340:in `with_force_shutdown'
 3f8eedd0 | /usr/share/gems/gems/puma-6.2.2/lib/puma/request.rb:97:in `handle_request'
 3f8eedd0 | /usr/share/gems/gems/puma-6.2.2/lib/puma/server.rb:431:in `process_client'
 3f8eedd0 | /usr/share/gems/gems/puma-6.2.2/lib/puma/server.rb:233:in `block in run'
 3f8eedd0 | /usr/share/gems/gems/puma-6.2.2/lib/puma/thread_pool.rb:147:in `block in spawn_thread'
 3f8eedd0 | /usr/share/gems/gems/logging-2.3.1/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2023-11-06T14:53:45 [I|app|3f8eedd0]   Rendered common/500.html.erb (Duration: 24.0ms | Allocations: 6791)
2023-11-06T14:53:45 [I|app|3f8eedd0] Completed 500 Internal Server Error in 40ms (Views: 24.8ms | ActiveRecord: 2.3ms | Allocations: 10543)
root@uscdc01tlsat010:~#

Thank you in advance for the help all.

Does the host inherit from a host group? If so, can you make sure the host group assigns both a CV and an LCE (not just one) and see if you still get the error?

Yes, it comes from the host group. I can make a change on the host group but I don’t want to change all servers. Even further, if I just want to enter a comment in the Additional Information tab in the host edit page and press submit the error is still shown. On the Host tab of the host edit page the information is listed for LCE and it shows the proper CV.

As a troubleshooting step: Can you edit that host so that it’s not associated with the hostgroup?

I just tried to remove the HG, pressed Submit and it still got the same error. I tried moving it to another HG and got the same result.

Thanks for trying!

Do you have a host you could try with that’s not associated to a hostgroup?

See also my reply in "Lifecycle environment must be specified" error when editing a host - #3 by jeremylenz

Thanks but unfortunately all of my hosts are part of HGs and I can’t remove them from a UI, probably from a hammer command

Hi @jeremylenz was there any updates on this issue lately?

Please see my reply on the other thread. The patch that I think might fix the issue, Bug #36721: Discovery Provisioning fails as the sync media is getting diminished from the host page even though it's synced - Katello - Foreman, has now been triaged for Katello 4.9.3, which means that when @wbclark does the next 4.9 release, it will be included. However, that same fix is also in Katello 4.10.0, so ideally you could try upgrading to that.

Great thanks. I’m doing my patching tomorrow so I’ll see how it goes. Will let you know!

I ran my updates today and 4.9.3 was not available as of yet, as soon as it is I’ll run the update again and see if the problem is resolved. Currently on 4.9.2

4.9.3 is not released yet. If you need the patch immediately, you’d have to upgrade to 4.10.

No problem. I can wait for 4.9.3. Thanks!

Hi @jeremylenz Is 4.9.3 going to be released?