Foreman 3.6.1 / Katello 3.8.0 UI Hostgroup CV "Inherit Parent" Bug

Problem:

The “Content View” for parent hostgroups are set to “Inherit parent (no value)”. The “Content View” for the ultimate child hostgroup is set to an arbitrary CV. In my example, it is “CV-SRV-EL8-X86_64-BM-WAP”. Upon re-opening the child hostgroup, the UI incorrectly states that the content view is “Inherit parent (CV-SRV-EL8-X86_64-BM-WAP)”. Attempts to save the unmodified hostgroup fail until the CV is set manually to “CV-SRV-EL8-X86_64-BM-WAP”.

Expected outcome:

There should be no child inheritance of the parent’s CV if the child’s CV is set manually. The CV should not need to be set manually each time the hostgroup needs to be updated/saved.

Foreman and Proxy & Plugin versions:

# rpm -qa | grep foreman | sort
ansible-collection-theforeman-foreman-3.10.0-1.el8.noarch
foreman-3.6.1-1.el8.noarch
foreman-assets-3.6.1-1.el8.noarch
foreman-cli-3.6.1-1.el8.noarch
foreman-debug-3.6.1-1.el8.noarch
foreman-dynflow-sidekiq-3.6.1-1.el8.noarch
foreman-installer-3.6.1-1.el8.noarch
foreman-installer-katello-3.6.1-1.el8.noarch
foreman-postgresql-3.6.1-1.el8.noarch
foreman-proxy-3.6.1-1.el8.noarch
foreman-release-3.6.1-1.el8.noarch
foreman-selinux-3.6.1-1.el8.noarch
foreman-service-3.6.1-1.el8.noarch
nodejs-theforeman-builder-12.0.1-1.el8.noarch
nodejs-theforeman-vendor-12.0.1-1.el8.noarch
rubygem-foreman_ansible-11.2.0-1.fm3_6.el8.noarch
rubygem-foreman_maintain-1.3.0-1.el8.noarch
rubygem-foreman_remote_execution-9.1.0-1.fm3_6.el8.noarch
rubygem-foreman-tasks-7.2.1-2.fm3_6.el8.noarch
rubygem-foreman_webhooks-3.0.5-1.fm3_5.el8.noarch
rubygem-hammer_cli_foreman-3.6.0-1.el8.noarch
rubygem-hammer_cli_foreman_ansible-0.5.0-1.fm3_6.el8.noarch
rubygem-hammer_cli_foreman_remote_execution-0.2.2-1.fm3_0.el8.noarch
rubygem-hammer_cli_foreman_tasks-0.0.18-1.fm3_5.el8.noarch
rubygem-hammer_cli_foreman_webhooks-0.0.4-1.fm3_5.el8.noarch

# rpm -qa | grep katello | sort
foreman-installer-katello-3.6.1-1.el8.noarch
katello-4.8.0-1.el8.noarch
katello-certs-tools-2.9.0-1.el8.noarch
katello-client-bootstrap-1.7.9-1.el8.noarch
katello-common-4.8.0-1.el8.noarch
katello-debug-4.8.0-1.el8.noarch
katello-repos-4.8.0-1.el8.noarch
katello-selinux-4.0.2-3.el8.noarch
rubygem-hammer_cli_katello-1.8.1-1.el8.noarch
rubygem-katello-4.8.0-1.el8.noarch

Distribution and version:
CentOS Stream 8

Other relevant data:

Order of operations:
0.) Parent hostgroup CV is set to “Inherit parent (no value)”.
1.) Attempt to save an unmodified child hostgroup with the CV set incorrectly to “Inherit parent (CV-SRV-EL8-X86_64-BM-WAP)”
2.) Reset the CV to “CV-SRV-EL8-X86_64-BM-WAP” and save the hostgroup successfully.
3.) Re-open the hostgroup in the UI and see that the CV is again set incorrectly to “Inherit parent (CV-SRV-EL8-X86_64-BM-WAP)”.

0.) Screen of parent hostgroup with no value set for CV.

1a.) Screenshot when attempting to save with “Inherit parent (CV-SRV-EL8-X86_64-BM-WAP)”


1b.) Relevant log from /var/log/foreman/production.log when attempting to save with “Inherit parent (CV-SRV-EL8-X86_64-BM-WAP)”

2023-05-08T10:57:59 [I|app|c3e6b9b4]   Parameters: {"utf8"=>"✓", "authenticity_token"=>"[filtered]", "hostgroup"=>{"parent_id"=>"3", "name"=>"HG-EL8-X86_64-BM-WAP", "description"=>"HG-EL8-X86_64-BM-WAP Host Group", "lifecycle_environment_id"=>"4", "content_view_id"=>"", "content_source_id"=>"", "compute_resource_id"=>"", "compute_profile_id"=>"", "hostgroup_ansible_roles_attributes"=>{"0"=>{"id"=>"29", "ansible_role_id"=>"88", "position"=>"1", "_destroy"=>"false"}}, "domain_id"=>"", "subnet_id"=>"", "realm_id"=>"", "architecture_id"=>"", "operatingsystem_id"=>"", "medium_id"=>"", "kickstart_repository_id"=>"2280", "ptable_id"=>"", "pxe_loader"=>"", "group_parameters_attributes"=>{"0"=>{"name"=>"chrony_server_s2", "parameter_type"=>"boolean", "value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"false", "id"=>"307"}, "1"=>{"name"=>"frr_rrc", "parameter_type"=>"boolean", "value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"false", "id"=>"188"}, "2"=>{"name"=>"kernel_builder", "parameter_type"=>"boolean", "value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"false", "id"=>"197"}, "3"=>{"name"=>"kt_activation_keys", "parameter_type"=>"string", "value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"0", "id"=>"187"}, "4"=>{"name"=>"memory", "parameter_type"=>"integer", "value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"false", "id"=>"189"}, "5"=>{"name"=>"network", "parameter_type"=>"boolean", "value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"false", "id"=>"190"}, "6"=>{"name"=>"network_phys_intf", "parameter_type"=>"boolean", "value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"false", "id"=>"191"}, "7"=>{"name"=>"powerpanel", "parameter_type"=>"boolean", "value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"false", "id"=>"192"}, "8"=>{"name"=>"wap", "parameter_type"=>"boolean", "value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"false", "id"=>"194"}}, "location_ids"=>["2", ""], "organization_ids"=>["1", ""], "id"=>"18"}, "media_selector"=>"synced_content", "commit"=>"Submit", "id"=>"18-HG-EL-HG-EL8-HG-EL8-X86_64-HG-EL8-X86_64-BM-HG-EL8-X86_64-BM-WAP"}
2023-05-08T10:57:59 [E|app|c3e6b9b4] Failed to save: Kickstart repository The selected kickstart repository is not part of the assigned content view, lifecycle environment, content source, operating system, and architecture

2a.) Screenshots when setting CV to correct value and saving.


2b.) Relevant log from /var/log/foreman/production.log when attempting to save with CV “CV-SRV-EL8-X86_64-BM-WAP” set manually.

2023-05-08T11:19:21 [I|app|8d5fd166] Started PATCH "/hostgroups/18-HG-EL-HG-EL8-HG-EL8-X86_64-HG-EL8-X86_64-BM-HG-EL8-X86_64-BM-WAP" for **** at 2023-05-08 11:19:21 -0700
2023-05-08T11:19:21 [I|app|8d5fd166] Processing by HostgroupsController#update as HTML
2023-05-08T11:19:21 [I|app|8d5fd166]   Parameters: {"utf8"=>"✓", "authenticity_token"=>"[filtered]", "hostgroup"=>{"parent_id"=>"3", "name"=>"HG-EL8-X86_64-BM-WAP", "description"=>"HG-EL8-X86_64-BM-WAP Host Group", "lifecycle_environment_id"=>"4", "content_view_id"=>"62", "content_source_id"=>"", "compute_resource_id"=>"", "compute_profile_id"=>"", "hostgroup_ansible_roles_attributes"=>{"0"=>{"id"=>"29", "ansible_role_id"=>"88", "position"=>"1", "_destroy"=>"false"}}, "domain_id"=>"", "subnet_id"=>"", "realm_id"=>"", "architecture_id"=>"", "operatingsystem_id"=>"", "medium_id"=>"", "kickstart_repository_id"=>"2280", "ptable_id"=>"", "pxe_loader"=>"", "group_parameters_attributes"=>{"0"=>{"name"=>"chrony_server_s2", "parameter_type"=>"boolean", "value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"false", "id"=>"307"}, "1"=>{"name"=>"frr_rrc", "parameter_type"=>"boolean", "value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"false", "id"=>"188"}, "2"=>{"name"=>"kernel_builder", "parameter_type"=>"boolean", "value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"false", "id"=>"197"}, "3"=>{"name"=>"kt_activation_keys", "parameter_type"=>"string", "value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"0", "id"=>"187"}, "4"=>{"name"=>"memory", "parameter_type"=>"integer", "value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"false", "id"=>"189"}, "5"=>{"name"=>"network", "parameter_type"=>"boolean", "value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"false", "id"=>"190"}, "6"=>{"name"=>"network_phys_intf", "parameter_type"=>"boolean", "value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"false", "id"=>"191"}, "7"=>{"name"=>"powerpanel", "parameter_type"=>"boolean", "value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"false", "id"=>"192"}, "8"=>{"name"=>"wap", "parameter_type"=>"boolean", "value"=>"[FILTERED]", "hidden_value"=>"[FILTERED]", "_destroy"=>"false", "id"=>"194"}}, "location_ids"=>["2", ""], "organization_ids"=>["1", ""], "id"=>"18"}, "media_selector"=>"synced_content", "commit"=>"Submit", "id"=>"18-HG-EL-HG-EL8-HG-EL8-X86_64-HG-EL8-X86_64-BM-HG-EL8-X86_64-BM-WAP"}
2023-05-08T11:19:21 [I|app|8d5fd166] ForemanWebhooks::EventSubscriber: hostgroup_updated.event.foreman event received
2023-05-08T11:19:21 [I|app|8d5fd166] Redirected to https://forewoman.bnerickson.net/hostgroups

3.) Re-opening hostgroup and CV is set incorrectly again.

Pretty sure I’m running into this same issue from what I posted here Cloud-init not running properly - #2 by lravelo

not quite sure if this is the cause of why the incorrect provisioning template is chosen for some host groups in my setup though.

After restoring back to 3.5.3, the same issue happens for me with the provisioning templates. So I’m back to square one with that. But the inheritance issue is definitely a thing.

This problem is no longer present after upgrading to Foreman 3.7.0 / Katello 3.9.0.

I will try this to see if it resolves the issue for me.

no dice. after saving, everything seems to go back to a hard coded value and then when I try to set the inherited synced content it just gives me this:

Either something is broken with my install or there’s a bug somewhere.