Project

General

Profile

Bug #9198

undefined method `to_enc' for #<Nic::Base:xxx> after migrating from older DB

Added by Anonymous almost 7 years ago. Updated over 3 years ago.

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

Description

As promised here the issue. After migrating the DB for the Nic:Base changes coming with #7456 and friends the following is happening on some hosts when requesting the Puppet YAML:

Processing by HostsController#externalNodes as YML
  Parameters: {"name"=>"katello-centos7.example.com"}
Failed to generate external nodes for katello-centos7.example.com with undefined method `to_enc' for #<Nic::Base:0x007f17293b07a8>


Related issues

Related to Foreman - Tracker #2409: NetworkingNew

Associated revisions

Revision b328d4c3 (diff)
Added by Marek Hulán almost 7 years ago

Fixes #9198 - migration sets type explicitly

History

#1 Updated by Marek Hulán almost 7 years ago

As a quick fix, one may manually change interface type in DB to Nic::Managed, from foreman console, something like this may help

Nic::Base.where(:type => ['Nic::Base', nil]).all.each {|n| n.type = 'Nic::Managed'; n.save!}

We'll have to fix the migration, I suspect STI classes are not loaded so STI is ignored. Thanks Michael for reporting.

#2 Updated by Marek Hulán almost 7 years ago

  • Status changed from New to Assigned

#3 Updated by Marek Hulán almost 7 years ago

#4 Updated by The Foreman Bot almost 7 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2134 added
  • Pull request deleted ()

#5 Updated by Marek Hulán almost 7 years ago

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

Also available in: Atom PDF