"Lifecycle environment must be specified" error when editing a host

Problem: “Lifecycle environment must be specified” error when editing a host

Expected outcome: Able to modify/edit hosts

Foreman and Proxy versions: F 3.7.1 K 4.9.2

Foreman and Proxy plugin versions:

Distribution and version: Rocky 8

Other relevant data:
First off, I have always appreciated the help and support that this community has provided for us but I am a bit disappointed here with this issue.

I see there is a bug reported for this issue Bug #36845: "Lifecycle environment must be specified" error when editing a host - Foreman but I have to express disappointment on the resolution to fix it, which would be upgrade to 3.8. I am frustrated as we just updated to 3.7 from 3.6 as it was no longer supported and now discovered this issue will not be fixed unless we yet again upgrade.

The lifecycle of Foreman/Katello is already short, it seems as every month or two there is a new version and then there is no longer support for previous versions.

So, is there a reason why fixes aren’t backported to a “supported” version, in this case 3.7? Why list 3.7 as being supported when fixes can’t be applied?

I don’t know what error you get but editing a host works for me. But I’ve only tested a few changes. As you don’t write where exactly it’s hard to guess. There are so many different ways to change a host and different changes you can make.

Second, I think you misunderstood the information in Bug #36845: "Lifecycle environment must be specified" error when editing a host - Foreman

It’s a new ticket. None of the developers really looked at it. Only the person who created the issue noted that the problem when away after upgrading to 4.10.0. So it’s futile to assume if or not it has been or will be backported. At this time it’s all completely circumstantial…

I suggest you describe what you do exactly and what happens exactly and provide the necessary logs/traces when it happens. I am on 3.7.0/4.9.2 and I can edit host information through the old gui via the edit button as well through the new gui. I can also change the content view and lifecycle environment either way in any way I want (or better: tested).

Looking at the issue 36845 and reading that “Since upgrading from Katello 4.9.0 to 4.9.2 any attempt to edit a host will result” I wonder though, whether that issue came from upgrading and not running foreman-installer afterwards. It sounds a lot like some necessary migration didn’t run…

As a workaround, ensure that either

(a) the host is not assigned to a hostgroup; or
(b) the hostgroup(s) associated with the host assign both a lifecycle environment and content view.

One of the above should get you unblocked, hopefully.

I think the issue may be resolved by Bug #36721: Discovery Provisioning fails as the sync media is getting diminished from the host page even though it's synced - Katello - Foreman, which wasn’t selected for backport to 4.9. However, I marked it as un-triaged again so that we can reconsider that in this week’s triage meeting.

Side note: the bug you mentioned Bug #36845: "Lifecycle environment must be specified" error when editing a host - Katello - Foreman was raised in the Foreman project, which is why no one from Katello had seen it yet. It may end up being closed as a duplicate, but for now I changed it to the correct project, Katello.

As you are mentioning this: is that bug related or the same issue? Whenever I edit a host (via the edit button) it’ll reset the selected LE and CV of the host to the one in the host group. Quiet annoying but a quick search did’t find me a existing issue for that…

As far as I understand, I think this is by design. Host groups always try to keep all their hosts in sync, so if you go into the host edit screen and then save, the first thing it does is always to inherit all the values from the hostgroup.

That is very unexpected. If I go into the host edit screen and only make a minor change (e.g. change the comment) I would expect everything else to remain as it is. It did so in previous versions and it doesn’t make sense to me because you don’t see the change. If you check the settings before pressing Submit it’s all the way it’s supposed to be, but after the submit it has been changed. That makes that whole thing pretty hard to use.

After testing a bit I think you may be right. I don’t see the same behavior with other inherited fields.

Opened Bug #36897: Host content view environment is reset on any host edit when hostgroup assigns a CVE - Katello - Foreman for investigation.

1 Like

@Marek_Hulan any thoughts? I’m not as familiar with what the behavior should be on the host edit form…

1 Like

Hey @jeremylenz. This forum topic was one that I opened but I asked to delete since it was just a rant post but my other post regarding the issue with logs is here which you have responded to as well:

Just don’t want to create any confusion with this. Thank you for your help and looking into this issue.

1 Like

yeah, I probably should have closed this topic and linked to the other one. No worries!

1 Like