Project

General

Profile

Actions

Bug #13158

closed

Error updating host name after removing primary interface flag

Added by Stephen Wadeley over 8 years ago. Updated about 7 years ago.

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

Description

Hello

While testing the new "Interfaces" web UI, I removed both Primary and Provisioning tags from the only interface for the host.
I clicked Submit. All seemed OK, although I was expecting the system to complain.
I then tried to reapply the Primary and Provisioning tags and got this error:

Warning!
Host::Base#name= delegated to primary_interface.name=, but primary_interface is nil: #<Host::Managed id: 1, name: "ad-foreman", last_compile: "2016-01-12 05:04:08", last_report: "2016-01-12 05:04:06", updated_at: "2016-01-12 05:20:33", created_at: "2015-11-21 21:42:40", root_pass: nil, puppet_status: 100663296, architecture_id: 1, operatingsystem_id: 1, environment_id: 1, ptable_id: nil, medium_id: nil, build: false, comment: "", disk: nil, installed_at: nil, model_id: 1, hostgroup_id: nil, owner_id: 3, owner_type: "User", enabled: true, puppet_ca_proxy_id: 1, managed: false, use_image: nil, image_file: nil, uuid: nil, compute_resource_id: nil, puppet_proxy_id: 1, certname: "ad-foreman.redhat.com", image_id: nil, organization_id: nil, location_id: nil, type: "Host::Managed", otp: nil, realm_id: nil, compute_profile_id: nil, provision_method: nil, grub_pass: "">

= =

Thank you


Files

Bug#13158_Runtime_Error.txt Bug#13158_Runtime_Error.txt 14.1 KB Stephen Wadeley, 01/12/2016 10:38 AM
Actions #2

Updated by Stephen Wadeley over 8 years ago

Please edit the subject, seems I do not have the permissions required: s/anf/and/
Thank you

Actions #3

Updated by Dominic Cleal over 8 years ago

  • Subject changed from Error when removing anf adding tags to interface to Error updating host name after removing primary interface flag
  • Category set to Network

Not sure how you managed to remove the primary flag, frankly. It ought to be validated.

Actions #4

Updated by Stephen Wadeley over 8 years ago

Now I cannot add any tags without getting an error when I click Submit.

Actions #5

Updated by Stephen Wadeley over 8 years ago

BTW, I noticed "Provision" next to the check box while it is "Provisioning" for the icon label.

Actions #6

Updated by Marek Hulán over 8 years ago

Is the host managed or unamanged? If it was unmanaged when you removed the flags, this would explain it. The logic was changed, so in 1.10 it shouldn't happen anymore.

Actions #7

Updated by Stephen Wadeley over 8 years ago

Hello

The host was unmanaged, but setting it to managed does not stop the error now. I have asked for update and restart of the test VM.

Thank you

Actions #8

Updated by Stephen Wadeley over 8 years ago

Hello

I built new test VM and I confirm error does not occur in Version 1.10.0. Now it just discards the changes (but without telling you).

Thank you

Actions #9

Updated by Diego Lucas about 8 years ago

Stephen Wadeley wrote:

Hello

I built new test VM and I confirm error does not occur in Version 1.10.0. Now it just discards the changes (but without telling you).

Thank you

I have a Foreman 1.10.2 and the error still there.
I needed to manually edit the DB to correct it.

Actions #10

Updated by Stefan Lasiewski almost 8 years ago

This is still happening with Foreman 1.11.3.

Here are some details:

1. Our hosts were created previous to Foreman 1.10.0. We've since upgraded to Foreman 1 .11.3.
2. In some cases, we used the Discovery Plugin previous to provisioning the hosts.
3. The network configuration was generally changed outside of Puppet or Foreman.
4. This happens on a variety of hosts with a variety of network connections-- Bonded or not, eth0 as primary or not; some have network aliases, others don't.
5. The one common factor is that we remove the 'primary' flag from an interface, and then hit save. Afterwards we are unable to perform many tasks because Foreman or Hammer continually complain with an error like `Host::Base#name= delegated to primary_interface.name=, but primary_interface is nil`.

Any workarounds, or steps to fix in the database, would be appreciated.

Actions #11

Updated by Daniel Lobato Garcia almost 8 years ago

Stefan,

5. The one common factor is that we remove the 'primary' flag from an interface, and then hit save. Afterwards we are unable to perform many tasks because Foreman or Hammer continually complain with an error like `Host::Base#name= delegated to primary_interface.name=, but primary_interface is nil`.

I assume you were able to do that before 1.11 but not now, right?

If you want a workaround, you can run `foreman-rake console` , then something like

Host.find_by_name("fqdnofyourhost").interfaces[0].update_attribute(:primary, true)
Substitute 0 for the interface you want to fix

Actions #12

Updated by Stefan Lasiewski almost 8 years ago

I assume you were able to do that before 1.11 but not now, right?

No, we had the same problems with Foreman 1.9 and even earlier versions.

If you want a workaround, you can run `foreman-rake console`

Thanks. I'm not super familiar with the rake console, but this helped me to force values to sane values.

Actions #13

Updated by Marek Hulán about 7 years ago

  • Status changed from New to Resolved

Thanks for confirmation, I'm marking as resolved. Please let us know if there's something else required.

Actions

Also available in: Atom PDF