Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2016717 - Virtual NIC naming conventions expected by fact_parser.rb cause registrations to fail
Summary: Virtual NIC naming conventions expected by fact_parser.rb cause registrations...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Registration
Version: 6.9.0
Hardware: All
OS: Linux
unspecified
high
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Satellite QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-10-22 21:50 UTC by Pablo Hess
Modified: 2023-11-19 02:22 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-16 08:15:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 33771 0 Normal New Virtual NIC naming conventions expected by fact_parser.rb cause registrations to fail 2021-10-22 22:11:56 UTC
Red Hat Knowledge Base (Solution) 4548081 0 None None None 2023-11-19 02:22:36 UTC

Description Pablo Hess 2021-10-22 21:50:31 UTC
Description of problem:
When registering a host with virtual NICs that do not follow the most common NIC naming patterns, host registration with `subscription-manager` fails to parse NIC facts and results in 422 Unprocesable Entity error by foreman.

Version-Release number of selected component (if applicable):
foreman-2.3.1.24-1.el7sat.noarch

How reproducible:
Every time given the "right" conditions i.e. the "right" NIC names on a host.

Steps to Reproduce:
1. Have a host with a bridge named something other than br0, br1, etc. E.g. my-br.
2. Add a VLAN-tagged vNIC to this host, e.g. my-br.42.
3. Try to register this host to Satellite with `subscription-manager register`.

Actual results:
Registration fails and the client receives an error message:
"HTTP error (422 - Unknown): Validation failed: Attached to can't be blank" 

Expected results:
Registration would succeed.


Additional info:

Satellite logs this to production.log while processing the NIC::Managed events:

2021-10-15T10:18:44 [E|kat|a0a5a5bf] <Class> ActiveRecord::RecordInvalid
2021-10-15T10:18:44 [E|kat|a0a5a5bf] attached_to: ["can't be blank"]
2021-10-15T10:18:44 [I|app|a0a5a5bf] Completed 422 Unprocessable Entity in 13967ms (Views: 0.2ms | ActiveRecord: 3529.9ms | Allocations: 2509109)

If I rename the bridge from `my-br` to e.g. `br2` and the respective VLAN-tagged vNIC from `my-br.42` to `br2.42` then the registration succeeds.


I've investigated the issue and the problem is in the regexes used to identify virtual interfaces while foreman tries to locate the physical interface to mark as primary for the newly-registered host. I have a PR ready and will be submitting it soon and linking it here.

Comment 1 Pablo Hess 2021-10-22 22:11:57 UTC
PR is added to the Foreman issue tracker bug linked here.

https://projects.theforeman.org/issues/33771

Comment 4 Leos Stejskal 2022-06-16 12:19:58 UTC
Hi Pablo,
upstream PR [0] have been closed with the proposal from lzap [1] to fix the Facter reporting instead of changing the regex parsing in the Foreman.
Are there any updates about the fix?

[0] https://github.com/theforeman/foreman/pull/8867
[1] https://github.com/theforeman/foreman/pull/8867#issuecomment-1018267088

Comment 6 Leos Stejskal 2023-01-30 08:08:34 UTC
Hi,
in that case I suggest close the BZ as not a bug, as for the comment [0] in github:

> I think if this is causing any pains, the proper solution is to make contribution into Facter so it actually reports some usable information from linux netlink kernel API - e.g. interface types and relationship (master-slave).
> Then we could utilize it in Foreman and avoid "guessing".

Comment 7 Red Hat Bugzilla 2023-09-18 04:27:25 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days


Note You need to log in before you can comment on or make changes to this bug.