Project

General

Profile

Actions

Bug #12441

closed

Duplicate entries in `nics` table

Added by Brandon Weeks over 8 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Network
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Foreman is inserting entires into the `nics` table during facts import/parse that have identical (host_id, identifier) columns as existing rows. This causes validation errors when trying to edit the host via the GUI.


Related issues 1 (0 open1 closed)

Related to Foreman - Bug #15238: Multiple interfaces with empty identifier are marked as invalidClosedMarek Hulán05/31/2016Actions
Actions #1

Updated by Brandon Weeks over 8 years ago

foreman=# SELECT id,identifier,mac,attrs,created_at FROM nics WHERE host_id = 690 AND identifier = 'br_tun' ORDER BY identifier;
id | identifier | mac | attrs | created_at
--------+------------+-------------------+---------------------------------------------------------+----------------------------
125 | br_tun | 92:60:6f:d8:23:4c | --- !ruby/hash:ActiveSupport::HashWithIndifferentAccess+| 2015-03-31 21:45:41.582826 | | | mtu: '1500' +| | | | |
220002 | br_tun | ea:e5:ed:bd:a8:4a | --- !ruby/hash:ActiveSupport::HashWithIndifferentAccess+| 2015-11-10 20:52:03.44866 | | | mtu: '1500' +| | | | lldp_neighbor_portdesc: '' +| | | | lldp_neighbor_portid: '' +| | | | lldp_neighbor_sysname: '' +| | | | lldp_neighbor_mngaddr_ipv4: '' +| | | | lldp_neighbor_mngaddr_ipv6: '' +| | | | lldp_neighbor_pvid: '' +| | | | lldp_neighbor_mtu: '' +| | | | |
(2 rows)

foreman=#

example bad data

Actions #2

Updated by Brandon Weeks over 8 years ago

host = Host::Managed.find(690)
macaddress_br_tun_fact_name = FactName.where(name: 'macaddress_br_tun').first
macaddress_br_tun_fact_value = FactValue.where(fact_name_id: macaddress_br_tun_fact_name, host_id: host).first
macaddress_br_tun_fact_value.value = 'aa:aa:aa:aa:aa:a1'
macaddress_br_tun_fact_value.save

host.populate_fields_from_facts

Test case to reproduce.

Actions #3

Updated by The Foreman Bot over 8 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2902 added
Actions #4

Updated by Dominic Cleal over 8 years ago

  • Category changed from Database to Network
  • Assignee set to Brandon Weeks
  • Priority changed from Urgent to Normal
  • translation missing: en.field_release set to 71
Actions #5

Updated by Brandon Weeks over 8 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #6

Updated by Marek Hulán almost 8 years ago

  • Related to Bug #15238: Multiple interfaces with empty identifier are marked as invalid added
Actions

Also available in: Atom PDF