Refactor #7010


Improve Error/Debug Log messaging

Added by Andrew N almost 10 years ago. Updated about 7 years ago.

Target version:
Fixed in Releases:
Found in Releases:


I'm trying to get a DHCP smart proxy configured on RHEL 6, but the default error message is practically useless. The error message I'm seeing is "Unable to find the DHCP configuration or lease files". It would be beneficial if all such error messages displayed the path which the program is attempting to access. As an end user/consultant this is beyond frustrating when I need to go back and forth to configuration files trying to figure out exactly where a program is looking.

Actions #1

Updated by Andrew N almost 10 years ago

Turns out issue was related to permissions. Perhaps it would be useful to break up configuration and access checks into two pieces rather than do them all in one line. This way you can error if a configuration value is not set, or error if a file cannot be accessed and give a better clue to the end user about where the error is.

Actions #2

Updated by Dominic Cleal almost 10 years ago

  • Project changed from Foreman to Smart Proxy
  • Category set to DHCP
Actions #3

Updated by Lukas Zapletal almost 10 years ago


all our error messages should have got error codes and these are explained here:

If an error message does not have the ERF code, it's a bug that must be fixed.

Please help us to maintain the wiki page with descriptions of the possible solutions.

Actions #4

Updated by Dominic Cleal almost 10 years ago

ERF error codes aren't applicable here, it's an error in the proxy DHCP module initialisation.

Actions #5

Updated by Andrew N almost 10 years ago

I think setting the scope to only DHCP proxy misses the point of what I opened the bug for. The intent was to help ensure ALL logging/error messages were more useful I cited the DHCP proxy as the example. The main issue in my example was this piece of code:

      unless SETTINGS.dhcp_config and SETTINGS.dhcp_leases \
        and File.exist?(SETTINGS.dhcp_config) and File.exist?(SETTINGS.dhcp_leases)

First it would have been most beneficial to split this into two tests, the first being to ensure the variable is set, if not error on the variable not being set. Next check to see if it is possible to access the file, if not error out and show the paths being attempted.

As an end user of software little is more infuriating than error messages which say there is a problem, but don't give you much clue about where the error is.

Again, if you leave the scope to just DHCP and proxy, I feel the point of the ticket will have been lost. However if there is a better way I should have gone about it then please educate me.

Actions #6

Updated by Dominic Cleal almost 10 years ago

Setting the category of a bug isn't to say we'll only fix the DHCP module, we'll likely check for other occurrences in the same codebase when it's fixed. It helps us and others find the ticket again quickly. Occurrences in other projects will likely need another ticket if they exist.

Actions #7

Updated by Anonymous over 8 years ago

  • Status changed from New to Feedback

This has been addressed in puppet module already, and has been proposed for dhcp module (please see The general idea is to verify during startup that files necessary for module to function are accessible. In case there were problems accessing config or lease files, log the issues and disable the module.

Actions #8

Updated by Anonymous about 7 years ago

  • Status changed from Feedback to Resolved

should be better now


Also available in: Atom PDF