Bug 1630305

Summary: Discovery to organization without subnet works after reboot
Product: Red Hat Satellite Reporter: Roman Plevka <rplevka>
Component: Discovery ImageAssignee: Lukas Zapletal <lzap>
Status: CLOSED WONTFIX QA Contact: Roman Plevka <rplevka>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.4CC: lzap, rabajaj, rplevka
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-04 14:01:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Roman Plevka 2018-09-18 11:07:27 UTC
Description of problem:
there is a validation in place where on POSTing to /facts, satellite ensures that the default discovery org/loc has a subnet assigned.
If it doesn't discovery fails with a proepr 422 message.

However, it looks like foreman somehow keeps the host record as if one re-runs the discovery (or POST to /facts again with the same facts), the discovery passes and the discovery host is created.

This is an inconsistent behaviour.

- i don't see a reason of denying a discovery on a satellite misconfig (since that one might get remediated after discovery) - the only problem arises when one has some auto-provision rules in place. But i would treat a failed auto provisioning as a reasonable "answer".

Also, it should be possible to check the "misconfig" much sooner than the during the discovery - one could get notified at discovered hosts pages about the existing misconfig (like showing a warning that the currently used organization does not come with a subnet assigned and thus the provisioning won't work).

Version-Release number of selected component (if applicable):
6.4.0-21

How reproducible:
always

Steps to Reproduce:
1. create a subnet
2. create an organization and assure it has no subnets assigned
2.b repeat the #1 with a location
3. set this org/locs as the default discovery taxonomies using global settings -> discovery
4. get a host and boot FDI
5. the discovery should fail (production.log shows 422 complaining about org not belonging to the subnet
6. now rerun (reboot) the discovery image to send the facts again
7. the discovery should now be successful with a message that some fact got updated

Actual results:
inconsistent behaviour across reboots (1st run fails, all the future run succeed)

Expected results:
consistent behaviour. 
bonus points for allowing discovery to pass even if no subnet is attached to the hosts taxonomies (only if there is no good reason for this)

Comment 2 Lukas Zapletal 2018-11-12 11:21:26 UTC
Roman, I am unable to reproduce both on 6.4 and develop. Discovered host is not allowed. Maybe you had some old host entry from different org or something?

==> /var/log/foreman/production.log <==
2018-11-12T11:19:12 [I|app|] Started POST "/api/v2/discovered_hosts/facts" for 192.168.199.1 at 2018-11-12 11:19:12 +0000
2018-11-12T11:19:12 [I|app|1df49] Processing by Api::V2::DiscoveredHostsController#facts as JSON
2018-11-12T11:19:12 [I|app|1df49]   Parameters: {"facts"=>"[FILTERED]", "apiv"=>"v2", "discovered_host"=>{"facts"=>"[FILTERED]"}}
2018-11-12T11:19:12 [I|app|1df49] Current user: foreman_admin (administrator)
2018-11-12T11:19:12 [I|app|1df49] Import facts for 'macaabbccddee1a' completed. Added: 0, Updated: 0, Deleted 0 facts
2018-11-12T11:19:12 [I|app|1df49] Detected subnet: c199 with taxonomy ["MyOrg", "SecondOrg"]/["MyLoc"]
2018-11-12T11:19:12 [I|app|1df49] Assigned location: NoSubnet2
2018-11-12T11:19:12 [I|app|1df49] Assigned organization: NoSubnet2
2018-11-12T11:19:12 [W|app|1df49] Not queueing Nic::Managed: ["Subnet is not defined for host's location", "Subnet is not defined for host's organization"]
2018-11-12T11:19:12 [W|app|1df49] Not queueing Nic::Managed: ["Subnet is not defined for host's location", "Subnet is not defined for host's organization"]
2018-11-12T11:19:12 [W|app|1df49] Not queueing Nic::Managed: ["Subnet is not defined for host's location", "Subnet is not defined for host's organization"]
2018-11-12T11:19:12 [W|app|1df49] Host discovery failed, facts: {"physicalprocessorcount"=>"3", "memorysize_mb"=>"900", "blockdevice.sda_size"=>"1234567890", "blockdevice.sdb_size"=>"123456700", "hardwaremodel"=>"Fake Host FH420", "discovery_version"=>"3.4.0", "interfaces"=>"eth0,eth0", "macaddress_eth0"=>"AA:BB:CC:DD:EE:1A", "ipaddress_eth0"=>"192.168.199.92", "macaddress"=>"AA:BB:CC:DD:EE:1A", "ipaddress"=>"192.168.199.92", "discovery_bootif"=>"AA:BB:CC:DD:EE:1A", "_type"=>:foreman_discovery}
ActiveRecord::RecordInvalid: Validation failed: Interfaces.subnet is not defined for host's location, Interfaces.subnet is not defined for host's organization
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/validations.rb:78:in `raise_validation_error'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/validations.rb:50:in `save!'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/attribute_methods/dirty.rb:43:in `save!'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:313:in `block in save!'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:384:in `block in with_transaction_returning_status'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/database_statements.rb:235:in `block in transaction'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/transaction.rb:194:in `block in within_new_transaction'
/opt/rh/rh-ruby24/root/usr/share/ruby/monitor.rb:214:in `mon_synchronize'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/transaction.rb:191:in `within_new_transaction'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/connection_adapters/abstract/database_statements.rb:235:in `transaction'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:210:in `transaction'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:381:in `with_transaction_returning_status'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/transactions.rb:313:in `save!'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/suppressor.rb:46:in `save!'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-12.0.2.1/app/models/host/discovered.rb:166:in `populate_discovery_fields_from_facts'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-12.0.2.1/app/models/host/discovered.rb:124:in `populate_fields_from_facts'
/usr/share/foreman/app/models/host/base.rb:162: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:161:in `parse_facts'
/usr/share/foreman/app/models/host/base.rb:150:in `import_facts'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-12.0.2.1/app/models/host/discovered.rb:99:in `import_facts'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-12.0.2.1/app/models/host/discovered.rb:89:in `import_host'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-12.0.2.1/app/controllers/api/v2/discovered_hosts_controller.rb:104:in `block in facts'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:94:in `as'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:100:in `as_anonymous_admin'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_discovery-12.0.2.1/app/controllers/api/v2/discovered_hosts_controller.rb:103:in `facts'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/abstract_controller/base.rb:186:in `process_action'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_controller/metal/rendering.rb:30:in `process_action'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:108:in `block in run_callbacks'
/usr/share/foreman/app/controllers/api/v2/base_controller.rb:162:in `disable_json_root'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
/usr/share/foreman/app/controllers/concerns/application_shared.rb:15:in `set_timezone'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
/usr/share/foreman/app/controllers/concerns/foreman/controller/topbar_sweeper.rb:12:in `set_topbar_sweeper_controller'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
/opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.7.0/lib/audited/sweeper.rb:14:in `around'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
/opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.7.0/lib/audited/sweeper.rb:14:in `around'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:135:in `run_callbacks'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/abstract_controller/callbacks.rb:19:in `process_action'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_controller/metal/rescue.rb:20:in `process_action'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.6/lib/active_support/notifications.rb:166:in `block in instrument'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.6/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.6/lib/active_support/notifications.rb:166:in `instrument'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_controller/metal/params_wrapper.rb:252:in `process_action'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activerecord-5.1.6/lib/active_record/railties/controller_runtime.rb:22:in `process_action'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/abstract_controller/base.rb:124:in `process'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionview-5.1.6/lib/action_view/rendering.rb:30:in `process'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_controller/metal.rb:189:in `dispatch'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_controller/metal.rb:253:in `dispatch'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/routing/route_set.rb:31:in `serve'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/routing/mapper.rb:16:in `block in <class:Constraints>'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/routing/mapper.rb:46:in `serve'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/journey/router.rb:50:in `block in serve'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/journey/router.rb:33:in `each'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/journey/router.rb:33:in `serve'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/routing/route_set.rb:844:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/middleware/static.rb:125:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/middleware/static.rb:125:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.7/lib/apipie/static_dispatcher.rb:65:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.7/lib/apipie/extractor/recorder.rb:136:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/middleware/static.rb:125:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/middleware/static.rb:125:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/middleware/static.rb:125:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/middleware/static.rb:125:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/middleware/static.rb:125:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/middleware/static.rb:125:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/middleware/static.rb:125:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/middleware/static.rb:125:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/middleware/static.rb:125:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/middleware/static.rb:125:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/middleware/static.rb:125:in `call'
/usr/share/foreman/lib/middleware/telemetry.rb:9:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.7/lib/apipie/middleware/checksum_in_headers.rb:27:in `call'
/usr/share/foreman/lib/middleware/catch_json_parse_errors.rb:8:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/rack-2.0.3/lib/rack/etag.rb:25:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/rack-2.0.3/lib/rack/conditional_get.rb:38:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/rack-2.0.3/lib/rack/head.rb:12:in `call'
/usr/share/foreman/lib/middleware/logging_context.rb:23:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/rack-2.0.3/lib/rack/session/abstract/id.rb:232:in `context'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/rack-2.0.3/lib/rack/session/abstract/id.rb:226:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/middleware/cookies.rb:613:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/middleware/callbacks.rb:26:in `block in call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.6/lib/active_support/callbacks.rb:97:in `run_callbacks'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/middleware/callbacks.rb:24:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/middleware/debug_exceptions.rb:59:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/railties-5.1.6/lib/rails/rack/logger.rb:36:in `call_app'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/railties-5.1.6/lib/rails/rack/logger.rb:26:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/sprockets-rails-3.2.1/lib/sprockets/rails/quiet_assets.rb:13:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/middleware/request_id.rb:25:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0.41/lib/katello/prevent_json_parsing.rb:12:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/rack-2.0.3/lib/rack/method_override.rb:22:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/rack-2.0.3/lib/rack/runtime.rb:22:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activesupport-5.1.6/lib/active_support/cache/strategy/local_cache_middleware.rb:27:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/middleware/executor.rb:12:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/middleware/static.rb:125:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/actionpack-5.1.6/lib/action_dispatch/middleware/static.rb:125:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/rack-2.0.3/lib/rack/sendfile.rb:111:in `call'
/opt/theforeman/tfm/root/usr/share/gems/gems/secure_headers-5.0.5/lib/secure_headers/middleware.rb:13:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/railties-5.1.6/lib/rails/engine.rb:522:in `call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/railties-5.1.6/lib/rails/railtie.rb:185:in `public_send'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/railties-5.1.6/lib/rails/railtie.rb:185:in `method_missing'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/rack-2.0.3/lib/rack/urlmap.rb:68:in `block in call'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/rack-2.0.3/lib/rack/urlmap.rb:53:in `each'
/opt/theforeman/tfm-ror51/root/usr/share/gems/gems/rack-2.0.3/lib/rack/urlmap.rb:53:in `call'
/usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/rack/thread_handler_extension.rb:77:in `process_request'
/usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/request_handler/thread_handler.rb:140:in `accept_and_process_next_request'
/usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/request_handler/thread_handler.rb:108:in `main_loop'
/usr/share/gems/gems/passenger-4.0.18/lib/phusion_passenger/request_handler.rb:441:in `block (3 levels) in start_threads'
/opt/theforeman/tfm/root/usr/share/gems/gems/logging-2.2.2/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2018-11-12T11:19:12 [I|app|1df49] Completed 422 Unprocessable Entity in 121ms (Views: 0.2ms | ActiveRecord: 43.6ms)

==> /var/log/httpd/foreman-ssl_access_ssl.log <==
192.168.199.1 - - [12/Nov/2018:11:19:13 +0000] "GET /notification_recipients HTTP/1.1" 200 287 "https://next.nat.lan/subnets" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36"

==> /var/log/foreman/production.log <==
2018-11-12T11:19:13 [I|app|] Started GET "/notification_recipients" for 192.168.199.1 at 2018-11-12 11:19:13 +0000
2018-11-12T11:19:13 [I|app|7ee5b] Processing by NotificationRecipientsController#index as JSON
2018-11-12T11:19:13 [I|app|7ee5b] Current user: admin (administrator)
2018-11-12T11:19:13 [I|app|7ee5b] Completed 200 OK in 4ms (Views: 0.2ms | ActiveRecord: 0.6ms)


I was sending:

{
  "physicalprocessorcount": "3",
  "memorysize_mb": "900",
  "blockdevice.sda_size": "1234567890",
  "blockdevice.sdb_size": "123456700",
  "hardwaremodel": "Fake Host FH420",
  "discovery_version": "3.4.0",
  "interfaces": "eth0",
  "macaddress_eth0": "AA:BB:CC:DD:EE:1A",
  "ipaddress_eth0": "192.168.199.92",
  "macaddress": "AA:BB:CC:DD:EE:1A",
  "ipaddress": "192.168.199.92",
  "discovery_bootif": "AA:BB:CC:DD:EE:1A"
}

Comment 4 Roman Plevka 2019-01-14 16:29:33 UTC
nope, trying on the completely fresh and new environment againt and am still hitting it.

- just to make sure we're on the same page - the first discovery attempt indeed finishes with 422. but after rebooting the host and booting to discovery again, it manages to get discovered successfully (201).

Comment 5 Lukas Zapletal 2019-01-16 10:12:53 UTC
After chat with Roman, it looks like the problem is that when Subnet does not belong to taxonomy a discovered host appears in, the discovery entry is created with taxonomy set to nil. This makes users think discovery process failed (since error was 422 it is logical). Yet, discovered host does exist.

Solution: Do not let discovered host to be discovered if taxonomy is not correct.

Comment 6 Marek Hulan 2019-02-12 08:27:23 UTC
Created redmine issue https://projects.theforeman.org/issues/26035 from this bug

Comment 8 Bryan Kearney 2019-11-04 14:01:46 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and while we recognize that it is a valid request, we do not expect this to be implemented in the product in the foreseeable future. This is due to other priorities for the product, and not a reflection on the request itself. We are therefore closing this out as WONTFIX. If you have any concerns about this, please do not reopen. Instead, feel free to contact Red Hat Technical Support. Thank you.