Bug 1288215 - Built call can fail due to orchestration conflict checking
Summary: Built call can fail due to orchestration conflict checking
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Orchestration
Version: 6.1.3
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Katello QA List
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-12-03 21:21 UTC by Stephen Benjamin
Modified: 2017-01-11 21:40 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-11 21:40:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 12696 0 'Normal' 'New' 'Built call can fail due to orchestration conflict checking' 2019-12-06 16:44:16 UTC

Description Stephen Benjamin 2015-12-03 21:21:52 UTC
Description of problem:
The built url calls `save!` which triggers checking orchestration conflicts.  This seems unnecessary, and can even prevent the host from being built, putting it in a reboot loop.  To give you an example, a host with DNS has its record checked for conflicts when built is called. On very slow DNS servers this could time out and cause the call to fail.

Upstream Foreman makes the timeout at least configurable (http://projects.theforeman.org/issues/11709), but I wonder why it should check  conflicts at all when we're marking the host built?

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

How reproducible:
Sometimes, if your DNS is very, very slow


Additional info:

Traceback from the failed built call:


/usr/share/foreman/lib/net/dns.rb:37:in `rescue in lookup'
/usr/share/foreman/lib/net/dns.rb:15:in `lookup'
/usr/share/foreman/lib/net/dns.rb:63:in `dns_lookup'
/usr/share/foreman/lib/net/dns/a_record.rb:28:in `conflicts'
/usr/share/foreman/lib/net.rb:24:in `conflicting?'
/usr/share/foreman/app/models/concerns/orchestration/dns.rb:121:in `dns_conflict_detected?'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:512:in `_run__3613348864840830943__validation__1758447277780704494__callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in `_run_validation_callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks'
/opt/rh/ruby193/root/usr/share/gems/gems/activemodel-3.2.8/lib/active_model/validations/callbacks.rb:53:in `run_validations!'
/opt/rh/ruby193/root/usr/share/gems/gems/activemodel-3.2.8/lib/active_model/validations.rb:194:in `valid?'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/validations.rb:69:in `valid?'
/usr/share/foreman/app/models/concerns/orchestration.rb:47:in `valid?'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/validations.rb:77:in `perform_validations'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/validations.rb:56:in `save!'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/attribute_methods/dirty.rb:33:in `save!'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:246:in `block in save!'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:295:in `block in with_transaction_returning_status'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:208:in `transaction'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:293:in `with_transaction_returning_status'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:246:in `save!'
/usr/share/foreman/app/models/host/managed.rb:251:in `built'
/usr/share/foreman/app/controllers/unattended_controller.rb:40:in `built'

Comment 1 Stephen Benjamin 2015-12-03 21:22:31 UTC
Created redmine issue http://projects.theforeman.org/issues/12696 from this bug

Comment 2 Bryan Kearney 2015-12-03 23:03:39 UTC
Upstream bug component is Orchestration

Comment 4 Rodrique Heron 2016-02-08 21:47:08 UTC
Seems like i'm hitting this bug with 6.1.6, single host install with the capsule functioning as a DNS server.

This happens when I edit a host, then try to submit changes.

Snippet from production.log

2016-02-08 16:30:27 [W] Unable to find IP address for 'sat6.rhlab.com': execution expired
2016-02-08 16:30:27 [W] failed to detect boot server: ERF50-9294 [Foreman::WrappedException]: Unable to find IP address for 'sat6.rhlab.com' ([Net::Error]: execution expired)

Full Trace:

Net::Error
execution expired
lib/net/dns.rb:36:in `rescue in lookup'
lib/net/dns.rb:15:in `lookup'
lib/net/dns.rb:62:in `dns_lookup'
lib/net/dns/a_record.rb:28:in `conflicts'
lib/net.rb:24:in `conflicting?'
app/models/concerns/orchestration/dns.rb:121:in `dns_conflict_detected?'
app/models/concerns/orchestration.rb:47:in `valid?'
app/models/concerns/foreman/sti.rb:29:in `save_with_type'
app/controllers/hosts_controller.rb:110:in `block in update'
app/models/taxonomy.rb:58:in `block in no_taxonomy_scope'
app/models/taxonomy.rb:65:in `block (2 levels) in as_taxonomy'
app/models/concerns/foreman/thread_session.rb:148:in `as_location'
app/models/taxonomy.rb:64:in `block in as_taxonomy'
app/models/concerns/foreman/thread_session.rb:113:in `as_org'
app/models/taxonomy.rb:63:in `as_taxonomy'
app/models/taxonomy.rb:57:in `no_taxonomy_scope'
app/controllers/hosts_controller.rb:102:in `update'
app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call'
lib/net/dns.rb:21:in `block in lookup'

Comment 5 Bryan Kearney 2016-07-08 20:39:47 UTC
Per 6.3 planning, moving out non acked bugs to the backlog

Comment 7 Bryan Kearney 2017-01-11 21:40:33 UTC
This is an older bug which has been reported upstream. We are not going to track this bug downstream. When the upstream issue is resolved, the next build will contain the fix. Thank you.


Note You need to log in before you can comment on or make changes to this bug.