Project

General

Profile

Actions

Bug #11247

closed

IP address is invalid, can't add or remove `.` from identifier

Added by El Joppa over 8 years ago. Updated almost 7 years ago.

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

Description

Foreman 1.8.2
Debian Wheezy

This shows up in the logs after upgrade from 1.8.1 to 1.8.2:

2015-07-29 15:10:11 [W] Saving bond0.1 NIC for host webnyh9.x.com failed, skipping because:
2015-07-29 15:10:11 [W]  IP address is invalid
2015-07-29 15:10:11 [W]  Identifier Can't add or remove `.` from identifier

Shows up for alot of hosts (probably all hosts)
Nic shows up fine for host in webinterface (as bond0, as there is no bond0.1)


Related issues 3 (1 open2 closed)

Related to Foreman - Bug #10566: Unique interface identifier requirement prevents host from being edited if duplicate identifier existsClosedMarek Hulán05/20/2015Actions
Related to Foreman - Bug #13161: bond0.vlan breaks fact uploadResolved01/12/2016Actions
Related to foreman-tasks - Bug #11235: Non-English exception on some runs of Actions::Foreman::Host::ImportFactsNew07/28/2015Actions
Actions #1

Updated by Dominic Cleal over 8 years ago

  • Related to Bug #10566: Unique interface identifier requirement prevents host from being edited if duplicate identifier exists added
Actions #2

Updated by Dominic Cleal over 8 years ago

  • Subject changed from IP address is invalid to IP address is invalid, can't add or remove `.` from identifier
  • Category set to Network

It might be useful for further debugging if you can attach facter --json output from an affected host to the ticket and ideally also data from Foreman about the interfaces already configured (either from the 'nics' database table or the interfaces part of the YAML output on the host page).

Actions #3

Updated by El Joppa over 8 years ago

Should note that this is a Salt managed node. Not sure how the grains are pulled but i guess something like this:

# salt-call grains.items --out=json
...
        "ip_interfaces": {
            "lo": [
                "127.0.0.1", 
                "::1" 
            ], 
            "bond0": [
                "77.x.x.x", 
                "fe80::b283:xxxx:xxxx:xxxx" 
            ], 
            "eth1": [], 
            "eth0": []
        }, 

YAML:

...
  foreman_interfaces:
  - mac: b0:83:fe:c7:65:77
    ip: 77.x.x.x.x
    type: Interface
    name: webnyh9.x.com
    attrs: {}
    virtual: false
    link: true
    identifier: bond0
    managed: true
    primary: true
    provision: true
    subnet: 
...

From nics table:

-[ RECORD 1 ]------+---------------------------
id                 | 38
mac                | b0:83:fe:c7:65:77
ip                 | 77.x.x.x
type               | Nic::Managed
name               | webnyh9.X.com
host_id            | 35
subnet_id          | 
domain_id          | 4
attrs              | --- {}
                   | 
created_at         | 2015-04-20 09:49:38.761628
updated_at         | 2015-07-30 06:58:54.804385
provider           | 
username           | 
password           | 
virtual            | f
link               | t
identifier         | bond0
tag                | 
attached_to        | 
managed            | t
mode               | balance-rr
attached_devices   | 
bond_options       | 
primary            | t
provision          | t
compute_attributes | --- {}

Actions #4

Updated by Anton Dollmaier over 8 years ago

Hi,

Shows up for alot of hosts (probably all hosts)
Nic shows up fine for host in webinterface (as bond0, as there is no bond0.1)

we have the same issue here as well: after migration of existing external puppet host to Foreman, the facts have been imported successfully, but the host properties (at host details) did not reflect the facts (model, architecture, OS, ... were missing).

The physical host has "bond0" as well as "bond0:0" (virtual IP), so this probably causes the following error:

Backtrace:

2015-08-11 13:19:38 [E] Validation failed: Identifier Can't add or remove `.` from identifier (ActiveRecord::RecordInvalid)
/usr/share/foreman/vendor/ruby/2.1.0/gems/activerecord-3.2.21/lib/active_record/validations.rb:56:in `save!'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activerecord-3.2.21/lib/active_record/attribute_methods/dirty.rb:33:in `save!'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activerecord-3.2.21/lib/active_record/transactions.rb:264:in `block in save!'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activerecord-3.2.21/lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activerecord-3.2.21/lib/active_record/transactions.rb:208:in `transaction'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activerecord-3.2.21/lib/active_record/transactions.rb:311:in `with_transaction_returning_status'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activerecord-3.2.21/lib/active_record/transactions.rb:264:in `save!'
/usr/share/foreman/app/models/host/base.rb:170:in `set_interfaces'
/usr/share/foreman/app/models/host/base.rb:150:in `populate_fields_from_facts'
/usr/share/foreman/app/models/host/managed.rb:441:in `populate_fields_from_facts'
/usr/share/foreman/app/models/host/base.rb:126:in `import_facts'
/usr/share/foreman/app/models/host/managed.rb:432:in `import_host_and_facts'
/usr/share/foreman/app/controllers/api/v2/hosts_controller.rb:177:in `facts'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/abstract_controller/base.rb:167:in `process_action'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/action_controller/metal/rendering.rb:10:in `process_action'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/abstract_controller/callbacks.rb:18:in `block in process_action'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:507:in `block (5 levels) in _run__23286316909410783__process_action__2703115256617301245__callbacks'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_7458'
/usr/share/foreman/app/controllers/api/v2/base_controller.rb:151:in `disable_json_root'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_7458'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:484:in `block (4 levels) in _run__23286316909410783__process_action__2703115256617301245__callbacks'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_7457'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:326:in `around'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:310:in `_callback_around_1763'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_7457'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:472:in `block (3 levels) in _run__23286316909410783__process_action__2703115256617301245__callbacks'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_7456'
/usr/share/foreman/app/controllers/concerns/application_shared.rb:13:in `set_timezone'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_7456'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:471:in `block (2 levels) in _run__23286316909410783__process_action__2703115256617301245__callbacks'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_7455'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_7455'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:437:in `block in _run__23286316909410783__process_action__2703115256617301245__callbacks'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:215:in `block in _conditional_callback_around_7454'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:326:in `around'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:310:in `_callback_around_13'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:214:in `_conditional_callback_around_7454'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:403:in `_run__23286316909410783__process_action__2703115256617301245__callbacks'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:405:in `__run_callback'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:81:in `run_callbacks'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/abstract_controller/callbacks.rb:17:in `process_action'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/action_controller/metal/rescue.rb:29:in `process_action'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/notifications.rb:123:in `block in instrument'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/notifications.rb:123:in `instrument'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activerecord-3.2.21/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/abstract_controller/base.rb:121:in `process'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/abstract_controller/rendering.rb:45:in `process'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/action_controller/metal.rb:203:in `dispatch'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/action_controller/metal.rb:246:in `block in action'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/action_dispatch/routing/route_set.rb:73:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/action_dispatch/routing/route_set.rb:36:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/action_dispatch/routing/mapper.rb:43:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/journey-1.0.4/lib/journey/router.rb:68:in `block in call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/journey-1.0.4/lib/journey/router.rb:56:in `each'
/usr/share/foreman/vendor/ruby/2.1.0/gems/journey-1.0.4/lib/journey/router.rb:56:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/action_dispatch/routing/route_set.rb:608:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/apipie-rails-0.2.6/lib/apipie/static_dispatcher.rb:65:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/apipie-rails-0.2.6/lib/apipie/extractor/recorder.rb:97:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/apipie-rails-0.2.6/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/rack-1.4.5/lib/rack/etag.rb:23:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/rack-1.4.5/lib/rack/conditionalget.rb:35:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/action_dispatch/middleware/head.rb:14:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/usr/share/foreman/lib/middleware/catch_json_parse_errors.rb:9:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/action_dispatch/middleware/flash.rb:242:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:210:in `context'
/usr/share/foreman/vendor/ruby/2.1.0/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:205:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/action_dispatch/middleware/cookies.rb:341:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activerecord-3.2.21/lib/active_record/query_cache.rb:64:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:405:in `_run__3582168535598898751__call__610153613818188632__callbacks'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:405:in `__run_callback'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:81:in `run_callbacks'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/railties-3.2.21/lib/rails/rack/logger.rb:32:in `call_app'
/usr/share/foreman/vendor/ruby/2.1.0/gems/railties-3.2.21/lib/rails/rack/logger.rb:16:in `block in call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/tagged_logging.rb:22:in `tagged'
/usr/share/foreman/vendor/ruby/2.1.0/gems/railties-3.2.21/lib/rails/rack/logger.rb:16:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/action_dispatch/middleware/request_id.rb:22:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/activesupport-3.2.21/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/actionpack-3.2.21/lib/action_dispatch/middleware/static.rb:83:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
/usr/share/foreman/vendor/ruby/2.1.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:143:in `pass'
/usr/share/foreman/vendor/ruby/2.1.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:155:in `invalidate'
/usr/share/foreman/vendor/ruby/2.1.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:71:in `call!'
/usr/share/foreman/vendor/ruby/2.1.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/railties-3.2.21/lib/rails/engine.rb:484:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/railties-3.2.21/lib/rails/application.rb:231:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/railties-3.2.21/lib/rails/railtie/configurable.rb:30:in `method_missing'
/usr/share/foreman/vendor/ruby/2.1.0/gems/rack-1.4.5/lib/rack/builder.rb:134:in `call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/rack-1.4.5/lib/rack/urlmap.rb:64:in `block in call'
/usr/share/foreman/vendor/ruby/2.1.0/gems/rack-1.4.5/lib/rack/urlmap.rb:49:in `each'
/usr/share/foreman/vendor/ruby/2.1.0/gems/rack-1.4.5/lib/rack/urlmap.rb:49:in `call'
/usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:74:in `process_request'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:141:in `accept_and_process_next_request'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:109:in `main_loop'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:455:in `block (3 levels) in start_threads'
2015-08-11 13:19:38 [I]   Rendered api/v2/errors/standard_error.json.rabl within api/v2/layouts/error_layout (0.9ms)
2015-08-11 13:19:38 [I] Completed 500 Internal Server Error in 142.3ms (Views: 2.7ms | ActiveRecord: 23.4ms)
Actions #5

Updated by Dominic Cleal over 8 years ago

  • Related to Bug #13161: bond0.vlan breaks fact upload added
Actions #6

Updated by Marek Hulán about 8 years ago

  • Related to Bug #11235: Non-English exception on some runs of Actions::Foreman::Host::ImportFacts added
Actions #7

Updated by Luca Lorenzetto about 8 years ago

I'm experiencing the same issue. I've an host running RHEL 5, with bond0 and bond0:0 interface. When running puppet agent -t, facts are not uploaded at all and the host is not assigned to the right organization.

Removing the interface bond0:0 allowed the correct facts upload.

My foreman server is running at version 1.9.3

Actions #8

Updated by joe barnes almost 8 years ago

2016-05-11 16:47:40 [app] [I] Processing by TasksController#show as /*
2016-05-11 16:47:40 [app] [I] Parameters: {"id"=>"
**************************"}
2016-05-11 16:47:40 [app] [I] Rendered tasks/_list.html.erb (0.1ms)
2016-05-11 16:47:40 [app] [I] Completed 200 OK in 10ms (Views: 1.4ms | ActiveRecord: 2.5ms)
2016-05-11 16:47:41 [app] [I] Failed to save: Identifier Can't add or remove `.` from identifier, Identifier Can't add or remove `:` from identifier

foreman 1.9.2 on redhat 6.7

this is troublesome because the in-interface iframe says "For virtual interfaces, use either alias notation (eth0:1, name:index) or VLAN notation (eth0.15, name.tag)." and :1 notation does not work.

Actions #9

Updated by Marek Hulán over 7 years ago

This might be specific to salt or the fact, that vlan/alias interface is the only interface uploaded in facts so it somehow mismatched and tries to update existing interface that does not have dot or colon in identifier. If you don't need facts import to update host interfaces, you can disable it in settings to avoid errors in logs.

Actions #10

Updated by Marek Hulán about 7 years ago

  • Status changed from New to Feedback

I think this issue combines multiple different problems. The first one was skipping update of an interface because the identifier has changed "virtuality" of the device. This might or might not be specific to how foreman_salt parses interfaces. I think this has should no longer block the interface saving after #16935 fixed fixed in 1.14. The second issue seems to be from older Foreman where we didn't skip invalid interfaces and the import fails completely. I think this should not happen anymore. Please let us know if you experience similar problems with Foreman 1.14+.

Actions #11

Updated by Anonymous almost 7 years ago

  • Status changed from Feedback to Resolved

no reaction, closing

Actions

Also available in: Atom PDF