Project

General

Profile

Bug #33917

Let hosts with incorrect IP discover

Added by Lukas Zapletal 6 months ago. Updated 6 months ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:

Description

Some hosts errors out with IP address exception which we are unable to reproduce. To me it looks like some bug in Ruby and IPv6. Symptoms:

error (IPAddr::InvalidAddressError): invalid address

....
/opt/rh/rh-ruby25/root/usr/share/ruby/ipaddr.rb:649:in `in6_addr'
/opt/rh/rh-ruby25/root/usr/share/ruby/ipaddr.rb:586:in `initialize'
/opt/rh/rh-ruby25/root/usr/share/ruby/ipaddr.rb:502:in `new'
/opt/rh/rh-ruby25/root/usr/share/ruby/ipaddr.rb:502:in `mask!'
/opt/rh/rh-ruby25/root/usr/share/ruby/ipaddr.rb:593:in `initialize'
/usr/share/foreman/app/models/subnet.rb:161:in `new'
/usr/share/foreman/app/models/subnet.rb:161:in `ipaddr'
/usr/share/foreman/app/models/subnet.rb:157:in `contains?'
/usr/share/foreman/app/models/subnet.rb:373:in `block in subnet_for'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/relation/delegation.rb:87:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/relation/delegation.rb:87:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/relation/query_methods.rb:271:in `select'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/relation/query_methods.rb:271:in `select'
/usr/share/foreman/app/models/subnet.rb:373:in `subnet_for'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/relation/delegation.rb:107:in `public_send'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/relation/delegation.rb:107:in `block in method_missing'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/relation.rb:407:in `block in scoping'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/relation.rb:784:in `_scoping'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/relation.rb:407:in `scoping'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.1/lib/active_record/relation/delegation.rb:107:in `method_missing'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-16.1.4/app/services/foreman_discovery/subnet_suggestion.rb:17:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-16.1.4/app/services/foreman_discovery/subnet_suggestion.rb:6:in `for'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-16.1.4/app/services/foreman_discovery/import_hooks/subnet_and_taxonomy.rb:24:in `set_subnets'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-16.1.4/app/services/foreman_discovery/import_hooks/subnet_and_taxonomy.rb:15:in `after_populate'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-16.1.4/app/services/foreman_discovery/import_hook_service.rb:20:in `block in after_populate'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-16.1.4/app/services/foreman_discovery/import_hook_service.rb:18:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-16.1.4/app/services/foreman_discovery/import_hook_service.rb:18:in `after_populate'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-16.1.4/app/models/host/discovered.rb:131:in `populate_discovery_fields_from_facts'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-16.1.4/app/models/host/discovered.rb:124:in `populate_fields_from_facts'
/usr/share/foreman/app/models/host/base.rb:174:in `block in parse_facts'
/usr/share/foreman/app/services/foreman/telemetry_helper.rb:27:in `telemetry_duration_histogram'
/usr/share/foreman/app/models/host/base.rb:173:in `parse_facts'
/usr/share/foreman/app/models/host/base.rb:159:in `import_facts'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-16.1.4/app/models/host/discovered.rb:105:in `import_facts'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-16.1.4/app/models/host/discovered.rb:95:in `import_host'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-16.1.4/app/controllers/api/v2/discovered_hosts_controller.rb:104:in `block in facts'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:108:in `as'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:114:in `as_anonymous_admin'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-16.1.4/app/controllers/api/v2/discovered_hosts_controller.rb:103:in `facts'
/opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.1/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
/opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.1/lib/abstract_controller/base.rb:195:in `process_action'
/opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.1/lib/action_controller/metal/rendering.rb:30:in `process_action'
/opt/theforeman/tfm/root/usr/share/gems/gems/actionpack-6.0.3.1/lib/abstract_controller/callbacks.rb:42:in `block in process_action'

Associated revisions

Revision be83a1a1 (diff)
Added by Lukas Zapletal 6 months ago

Fixes #33917 - skip invalid IP address

History

#1 Updated by The Foreman Bot 6 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman_discovery/pull/557 added

#2 Updated by The Foreman Bot 6 months ago

  • Fixed in Releases Discovery Plugin 16.0 added

#3 Updated by Anonymous 6 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF