Can't disable subscription Auto-attach on Host

Problem:
Unable change Auto-attach from “Yes” to “No” in Legacy UI. Button “Save” works only if value is set to “Yes”. When “No” value is selcted “Save” button does nothing.

Such action in production.log is described as change of “autoheal” attribute to “false”. Action constantly fails.

Expected outcome:
Auto-attach in Legacy UI will be disabled at will.

Foreman and Proxy versions:
foreman-3.9.1-1.el8.noarch
katello-4.11.0-1.el8.noarch

Problem is not specific to foreman 3.9. It was observed also in version 3.7

Foreman and Proxy plugin versions:

Distribution and version:
RHEL 8.9

Other relevant data:

Disable_Auto_attach.log (18.2 KB)

As I’m sure you know, this will not be relevant soon, since Simple Content Access will be required in the next version of Katello (4.12).

For now, though, I am still not able to reproduce this with a RHEL 8.9 host in my dev environment.

You could perhaps try the CLI as a workaround? hammer host update --id xxx --autoheal false

Hammer is not working too. Action ends with same error.

2024-01-11T10:02:21 [I|app|f9bd9110] Backtrace for 'Action failed' error (RestClient::BadRequest): Katello::Resources::Candlepin::Consumer: 400 Bad Request {"displayMessage":"Runtime Error com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `java.util.ArrayList<org.candlepin.dto.api.server.v1.EnvironmentDTO>` from String value (token `JsonToken.VALUE_STRING`)\n at [Source: (org.candlepin.servlet.filter.logging.TeeHttpServletRequest$1); line: 1, column: 103] (through reference chain: org.candlepin.dto.api.server.v1.ConsumerDTO[\"environments\"]) at com.fasterxml.jackson.databind.exc.MismatchedInputException.from:59","requestUuid":"623bd637-4d76-4f17-a600-ac6022b83825"} (PUT /candlepin/consumers/c93260b5-6748-49bd-93ba-65a4d3e5c846)

Ah, I see the error now. I haven’t seen this Candlepin error before. Does it happen on every host or just this host? It may help to unregister and re-register the host.

Host re-registration does’t help. Affected hosts are virtualization hosts (hypervisors) registered via virt-who.
I am able change “Auto-Attach/Autoheal” to False only for Virtual machines registered manually.

@mdedek

Are the hypervisors RHEL, VMware or some other type like Hyper-V? Has this ever worked? Typically, the use case for not using SCA is to just attach a subscription to the hypervisor and then it just serves for host/guest mapping. Typically, if you have subscriptions allocated across the hypervisors, they should not grab them. Since we are technically creating a fake host for the hypervisors in the backend just for mapping purposes, I would think most commands would fail for them since they can’t be registered if they are non RHEL hypervisors.

I would switch to SCA when you can, so then you can either eliminate virt-who all together if you are not using Red Hat Subscriptions or keep virt-who if you are using Red Hat Insights so the Subscription Watch piece works correctly. Either way switching to SCA will make your life a lot easier, since SCA is becoming the default in the next Katello version.

1 Like

In our case are affected VMware hypervisors. It worked some time ago. Breakdown was initially observed in Foreman 3.7 but I can’t confirm that this is the exact version where problem started.

SCA is another story. Last time when I tried enable/install plugin plugin-rh-cloud the Katello ended in crashed state. I guess that I will come soon with new problem(s) regarding SCA enablement.

It is difficult to switch on Simple Content Access when Subscription reporting is not working properly. Hopefully someone will soon give hints how to fix it.

https://community.theforeman.org/t/empty-report-generated-by-plugin-foreman-rh-cloud/36880