satellite-installer is failing with traceback rolling_file.rb:368:in `block in roll_by_number': undefined method `[]' for nil:NilClass (NoMethodError)
Environment
- Satellite 6
Issue
- During the upgrade,
satellite-installeris failing with following traceback:
# satellite-installer --scenario satellite --upgrade
/usr/share/gems/gems/logging-2.2.2/lib/logging/appenders/rolling_file.rb:368:in `block in roll_by_number': undefined method `[]' for nil:NilClass (NoMethodError)
from /usr/share/gems/gems/logging-2.2.2/lib/logging/appenders/rolling_file.rb:367:in `sort'
from /usr/share/gems/gems/logging-2.2.2/lib/logging/appenders/rolling_file.rb:367:in `roll_by_number'
from /usr/share/gems/gems/logging-2.2.2/lib/logging/appenders/rolling_file.rb:349:in `roll_files'
from /usr/share/gems/gems/logging-2.2.2/lib/logging/appenders/rolling_file.rb:110:in `initialize'
from /usr/share/gems/gems/logging-2.2.2/lib/logging/appenders/rolling_file.rb:6:in `new'
from /usr/share/gems/gems/logging-2.2.2/lib/logging/appenders/rolling_file.rb:6:in `rolling_file'
from /usr/share/gems/gems/kafo-2.1.0/lib/kafo/logger.rb:57:in `setup'
from /usr/share/gems/gems/kafo-2.1.0/lib/kafo/kafo_configure.rb:96:in `initialize'
from /usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `new'
from /usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run'
from /usr/share/gems/gems/kafo-2.1.0/lib/kafo/kafo_configure.rb:163:in `run'
from /sbin/satellite-installer:8:in `<main>'
Its not limited only to --upgrade, any satellite-installer command is failing with same traceback:
# satellite-installer
/usr/share/gems/gems/logging-2.2.2/lib/logging/appenders/rolling_file.rb:368:in `block in roll_by_number': undefined method `[]' for nil:NilClass (NoMethodError)
from /usr/share/gems/gems/logging-2.2.2/lib/logging/appenders/rolling_file.rb:367:in `sort'
from /usr/share/gems/gems/logging-2.2.2/lib/logging/appenders/rolling_file.rb:367:in `roll_by_number'
from /usr/share/gems/gems/logging-2.2.2/lib/logging/appenders/rolling_file.rb:349:in `roll_files'
from /usr/share/gems/gems/logging-2.2.2/lib/logging/appenders/rolling_file.rb:110:in `initialize'
from /usr/share/gems/gems/logging-2.2.2/lib/logging/appenders/rolling_file.rb:6:in `new'
from /usr/share/gems/gems/logging-2.2.2/lib/logging/appenders/rolling_file.rb:6:in `rolling_file'
from /usr/share/gems/gems/kafo-2.1.0/lib/kafo/logger.rb:57:in `setup'
from /usr/share/gems/gems/kafo-2.1.0/lib/kafo/kafo_configure.rb:96:in `initialize'
from /usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `new'
from /usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run'
from /usr/share/gems/gems/kafo-2.1.0/lib/kafo/kafo_configure.rb:163:in `run'
from /usr/sbin/satellite-installer:8:in `<main>'
Resolution
- Move any file with name satellite.log-$something-$date-$.log or
satellite.log-$something-$date-1.logfrom /var/log/foreman-installer/ directory.
For more KB articles/solutions related to Red Hat Satellite 6.x Installation/Upgrade/Update Issues, please refer to the Red Hat Satellite Consolidated Troubleshooting Article for Red Hat Satellite 6.x Installation/Upgrade/Update Issues.
Root Cause
In this particular case it was failing with back trace due to /var/log/foreman-installer/satellite.log-rename-20171205-1.log
Diagnostic Steps
Check files in directory /var/log/foreman-installer/, if there is any file which would match following mask, remove them:
satellite.log-$something-$date or satellite.log-$something-$date-1
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.