Project

General

Profile

Actions

Bug #39613

closed

HTTP 500 during subscription-manager register due to undefined method cvenvs_changed= on ContentFacet

Added by Zach Huntington-Meath 27 days ago. Updated 26 days ago.

Status:
Closed
Priority:
High
Category:
Hosts
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

  1. Problem

On Katello 4.21.1, calling `subscription-manager register` with an activation key returns HTTP 500:

```
undefined method `cvenvs_changed=` for #<Katello::Host::ContentFacet ...>
Did you mean? cves_changed=
(HTTP error code 500: Internal Server Error)
```

This breaks host registration entirely, causing all downstream content operations (enable repo, install package, apply errata) to fail.

  1. Timeline / Root Cause

May 28 — commit a46d7afdf6 (#39330, "Remove deprecated CV/LCE params") lands on master. It renames the attribute everywhere: `attr_accessor :cves_changed` → `attr_accessor :cvenvs_changed`, updating all callers. This commit was never cherry-picked to KATELLO-4.21.

July 9 — commit def4db08f6 (#39493, "Fix duplicate Candlepin PUT requests during registration") lands on master. Written against master after the rename, it adds `self.cvenvs_changed = true` to `content_view_environments=` — valid on master because the rename already happened there.

July 9 — def4db08f6 is cherry-picked to KATELLO-4.21 as 6363ae3628. This brings over `self.cvenvs_changed = true`, but KATELLO-4.21 still has `attr_accessor :cves_changed` (the May 28 rename was never backported). The branch now calls a setter that does not exist.

  1. Fix

Change line 161 of `app/models/katello/host/content_facet.rb` on KATELLO-4.21 from:

```ruby
self.cvenvs_changed = true unless self.new_record?
```

to:

```ruby
self.cves_changed = true unless self.new_record?
```

All other references on the KATELLO-4.21 branch — the `attr_accessor`, `mark_cves_changed`, `cves_changed?`, and callers in `subscription_facet.rb`, `registration_manager.rb`, and `subscription_facet_host_extensions.rb` — consistently use `cves_changed`. The consumer that reads the flag (`subscription_facet.rb:259`) checks `cves_changed?`. Only this one line is wrong.

Actions #1

Updated by The Foreman Bot 27 days ago

  • Status changed from New to Ready For Testing
  • Assignee set to Zach Huntington-Meath
  • Pull request https://github.com/Katello/katello/pull/11831 added
Actions #2

Updated by The Foreman Bot 26 days ago

  • Fixed in Releases Katello 4.21.1 added
Actions #3

Updated by Ian Ballou 26 days ago

  • Category set to Hosts
  • Status changed from Ready For Testing to Closed
  • Triaged changed from No to Yes
Actions

Also available in: Atom PDF