Project

General

Profile

Actions

Bug #10642

closed

Migration of unmanaged host can fail on primary interface

Added by Marek Hulán almost 9 years ago. Updated almost 6 years ago.

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

Description

If there's unmanaged host with interface that has IP set to it's primary interface but is not marked as primary the migration ends up in invalid state because db/migrate/20140910153654_move_host_nics_to_interfaces.rb creates new interface (skipping validations) with this IP and marks it primary. Then second migration - 20150508124600_copy_unmanaged_hosts_to_interfaces.rb - runs but here it finds the existing one from previous migration and tries to set it's hostname and save it. Unfortunately it's not FakeNic instance so it runs validations and fails on IP uniqueness validation. We can either try to skip saving of interface if it didn't change or improve detection of existing primary interface (probably in both migrations). Setting as release 1.8.2, all users with unmanaged hosts with interfaces created by puppet will hit this.

Migration error that pops up

==  CopyUnmanagedHostsToInterfaces: migrating =================================
-- Migrating Unmanaged Host interfaces to standalone Interfaces
rake aborted!
An error has occurred, all later migrations canceled:

Validation failed: IP address has already been taken


Related issues 3 (0 open3 closed)

Related to Foreman - Bug #10403: Smart Class Parameter Overrides using the FQDN fact as a match no longer applies the overrideClosedDominic Cleal05/06/2015Actions
Related to Foreman - Feature #10260: Allow interfaces management for unmanaged hostsClosedMarek Hulán04/24/2015Actions
Related to Foreman - Bug #10571: LDAP authentication management errorResolved05/21/2015Actions
Actions

Also available in: Atom PDF