Bug #7749

Calling log_halt causes 500 internal server error on foreman proxy

Added by Marek Hulán almost 4 years ago. Updated 6 days ago.

Status:Closed
Priority:Normal
Assignee:Marek Hulán
Category:Core
Target version:1.6.1
Difficulty: Team Backlog:
Triaged: Fixed in Releases:
Bugzilla link: Found in Releases:Foreman - Nightly
Pull request:https://github.com/theforeman/smart-proxy/pull/215

Description

I found this error when provisioning staypuft hosts, in foreman log I saw only

Remove puppet certificate for mac5254001adcc9.example.com
and even after I set debug log level on foreman proxy I saw messages like
D, [2014-09-30T08:27:55.252242 #21635] DEBUG -- : Found puppetca at /usr/sbin/puppetca
D, [2014-09-30T08:27:55.252348 #21635] DEBUG -- : Found sudo at /usr/bin/sudo
D, [2014-09-30T08:27:55.252381 #21635] DEBUG -- : Executing /usr/bin/sudo -S /usr/sbin/puppetca --ssldir /var/lib/puppet/ssl --clean mac5254001adcc9.example.com
I, [2014-09-30T08:27:55.959318 #21635]  INFO -- : Attempt to remove nonexistant client certificate for mac5254001adcc9.example.com
with no error. It turned out that foreman proxy fails while using log_halt in ProxyHelpers module because it was unable to use logger. This resulted in RestClient exception in foreman which backtrace is swallowed.

While the fix for the issue with puppetca is trivial, it was hard to debug. I wonder whether we should create refactoring issue to review all rescue and never swallow backtrace, plus second to revisit smart proxy logging (so every exception is logged)

Associated revisions

Revision 2fe082ea
Added by Marek Hulán almost 4 years ago

Fixes #7749 - allow using logger in log_halt helper

History

#1 Updated by The Foreman Bot almost 4 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/smart-proxy/pull/215 added

#2 Updated by Dominic Cleal almost 4 years ago

  • Legacy Backlogs Release (now unused) set to 22

#3 Updated by Dominic Cleal almost 4 years ago

  • Target version changed from 1.7.3 to 1.7.2

#4 Updated by Marek Hulán almost 4 years ago

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

Also available in: Atom PDF