Project

General

Profile

Bug #15213

DHCP conflict detection fails with exception if proxy is unavailable

Added by Marek Hulán about 4 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
DHCP
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1337462
Description of problem:
Following exception raised in production.log while performing "yum update"
to update packages from sat6.1.9 -> Sat6.2 snap12. Though the log-level seems "warning" but following exception is being logged in production.log

==> /var/log/foreman/production.log <==
2016-05-19 04:32:23 [app] [W] failed to detect boot server: ERF12-5139 [ProxyAPI::ProxyException]: Unable to detect TFTP boot server ([Errno::ECONNREFUSED]: Connection refused - connect(2) for "qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.co...) for Capsule https://qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com:9090/tftp
 | ProxyAPI::ProxyException: ERF12-5139 [ProxyAPI::ProxyException]: Unable to detect TFTP boot server ([Errno::ECONNREFUSED]: Connection refused - connect(2) for "qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.co...) for Capsule https://qe-sat6-upgrade-rhel7.satqe.lab.eng.rdu2.redhat.com:9090/tftp
 | /usr/share/foreman/lib/proxy_api/tftp.rb:49:in `rescue in bootServer'
 | /usr/share/foreman/lib/proxy_api/tftp.rb:42:in `bootServer'
 | /usr/share/foreman/app/models/concerns/orchestration/dhcp.rb:72:in `boot_server'
 | /usr/share/foreman/app/models/concerns/orchestration/dhcp.rb:99:in `dhcp_attrs'
 | /usr/share/foreman/app/models/concerns/orchestration/dhcp.rb:20:in `dhcp_record'
 | /usr/share/foreman/app/models/concerns/orchestration/dhcp.rb:179:in `dhcp_conflict_detected?'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:424:in `block in make_lambda'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:231:in `call'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:231:in `block in halting'

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

Sat[6.1.9 -> 6.2 snap12]

How reproducible:

Steps to Reproduce:
1. set sat6.2 repo
2. katello-service stop
3. yum update -y

Actual results:

Expected results:
No such exception in logs. If its a real issue then we need to fix it otherwise, we should suppress the exception, if possible.

Additional info:


Related issues

Related to Foreman - Tracker #14002: Orchestration build around ActiveRecord hooks trackerNew2016-03-02

Related to Foreman - Feature #10782: Add global status for hostsClosed2015-06-11

Associated revisions

Revision 801c2fec (diff)
Added by Marek Hulán about 4 years ago

Fixes #15213 - handle host update when proxy is unreachable

History

#1 Updated by Dominic Cleal about 4 years ago

  • Subject changed from Upgrade [6.1.9 -> 6.2 snap12] failed to detect boot server: ERF12-5139 [ProxyAPI::ProxyException] to Upgrade failed to detect boot server: ERF12-5139 [ProxyAPI::ProxyException]
  • Description updated (diff)

The log is missing context about what was happening (a request?), can you put any more info into this bug report please?

#2 Updated by Marek Hulán about 4 years ago

  • Subject changed from Upgrade failed to detect boot server: ERF12-5139 [ProxyAPI::ProxyException] to DHCP conflict detection fails with exception if proxy is unavailable
  • Category set to DHCP

The root cause is that whenever existing host is saved (updated) we check for DHCP conflicts through proxy. If the communication with proxy fails, the check fails with exception. I think we should ignore such errors when proxy is unreachable and user wants to change e.g. only the host's comment attribute. Until we have better orchestration not driven by active record callbacks...

#3 Updated by Marek Hulán about 4 years ago

  • Status changed from New to Assigned

#4 Updated by The Foreman Bot about 4 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3554 added

#5 Updated by Marek Hulán about 4 years ago

To reproduce: turn off DHCP proxy and try following from console Host.last.update :comment => 'test'. If the last host is managed and has the proxy set correctly, it will fail with exception.

#6 Updated by Marek Hulán about 4 years ago

  • Related to Tracker #14002: Orchestration build around ActiveRecord hooks tracker added

#7 Updated by Marek Hulán about 4 years ago

Unfortunately there's no easy way to disable the orchestration. The original motivation to fix this was host statuses migration so I fixed that instead so it skips validation. That should not do any harm, since we are not modifying any data, just creating sub-statuses and updating global status respectively.

#8 Updated by Marek Hulán about 4 years ago

#9 Updated by Marek Hulán about 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#10 Updated by Dominic Cleal about 4 years ago

  • Legacy Backlogs Release (now unused) set to 160

Also available in: Atom PDF