Bug 1698395

Summary: satellite-installer fails with traceback when there is a log file with name /var/log/foreman-installer/satellite.log-$something-$date.log
Product: Red Hat Satellite Reporter: Michal Dekan <mdekan>
Component: InstallationAssignee: Eric Helms <ehelms>
Status: CLOSED ERRATA QA Contact: Devendra Singh <desingh>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.4CC: egolov, ehelms, zhunting
Target Milestone: 6.9.0Keywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: tfm-rubygem-kafo-6.1.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-21 13:11:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michal Dekan 2019-04-10 10:03:01 UTC
Description of problem:

satellite-installer fails with traceback when there is a log file with name /var/log/foreman-installer/satellite.log-$something-$date.log

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


How reproducible: 100 %


Steps to Reproduce:
1. touch /var/log/foreman-installer/satellite.log-rename-20171205.log
2. or touch /var/log/foreman-installer/satellite.log-rename-20171205-1.log


Actual results:

# 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>'


# satellite-installer --help
/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>'


Expected results:

No traceback from satellite-installer with /var/log/foreman-installer/satellite.log-$something-$date.log or /var/log/foreman-installer/satellite.log-$something-$date-1.log

Comment 3 Brad Buckingham 2019-04-12 15:27:41 UTC
Is the renamed log file being created manually or by the tooling?

Comment 4 Brad Buckingham 2019-04-12 15:28:58 UTC
Note: if rename the file without the .log at the end, the installer should continue.

Comment 5 Michal Dekan 2019-04-16 13:38:55 UTC
(In reply to Brad Buckingham from comment #3)
> Is the renamed log file being created manually or by the tooling?

File /var/log/foreman-installer/satellite.log-rename-20171205-1.log has been created manually by customer.

Comment 6 Bryan Kearney 2020-11-05 20:02:25 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/31269 has been resolved.

Comment 7 Devendra Singh 2020-12-16 07:01:49 UTC
Verified on 6.9 Snap 5

Verification steps:

1-  touch /var/log/foreman-installer/satellite.log-rename-20201214-082535.log

ls  /var/log/foreman-installer/
capsule.20201209-162331.log  satellite.log-rename-20171205-1.log  satellite.log-rename-20201214-082535.log
capsule.log 
.....
.....   
             
3-  run satellite-installer

[root@dhcp-2-100 ~]# satellite-installer
2020-12-16 01:38:53 [NOTICE] [pre_migrations] Executing hooks in group pre_migrations
2020-12-16 01:38:53 [NOTICE] [pre_migrations] All hooks in group pre_migrations finished
2020-12-16 01:38:53 [NOTICE] [boot] Executing hooks in group boot
2020-12-16 01:38:53 [NOTICE] [boot] All hooks in group boot finished
2020-12-16 01:38:53 [NOTICE] [init] Executing hooks in group init
2020-12-16 01:38:53 [NOTICE] [init] All hooks in group init finished
2020-12-16 01:38:53 [NOTICE] [root] Loading default values from puppet modules...
2020-12-16 01:38:58 [NOTICE] [root] ... finished
2020-12-16 01:38:58 [NOTICE] [pre_values] Executing hooks in group pre_values
2020-12-16 01:38:58 [NOTICE] [pre_values] All hooks in group pre_values finished
2020-12-16 01:39:00 [NOTICE] [pre_validations] Executing hooks in group pre_validations
2020-12-16 01:39:01 [NOTICE] [pre_validations] All hooks in group pre_validations finished
2020-12-16 01:39:01 [NOTICE] [root] Running validation checks
2020-12-16 01:39:01 [NOTICE] [pre_commit] Executing hooks in group pre_commit
Package versions are locked. Continuing with unlock.
2020-12-16 01:39:05 [NOTICE] [pre_commit] All hooks in group pre_commit finished
2020-12-16 01:39:05 [NOTICE] [pre] Executing hooks in group pre
2020-12-16 01:39:09 [NOTICE] [pre] All hooks in group pre finished
2020-12-16 01:39:09 [NOTICE] [configure] Starting system configuration.
  The total number of configuration tasks may increase during the run.
  Observe logs or specify --verbose-log-level to see individual configuration tasks.
2020-12-16 01:39:22 [NOTICE] [configure] 100 out of 2163 done.
2020-12-16 01:39:23 [NOTICE] [configure] 200 out of 2163 done.
2020-12-16 01:39:23 [NOTICE] [configure] 300 out of 2163 done.
2020-12-16 01:39:24 [NOTICE] [configure] 400 out of 2163 done.
2020-12-16 01:39:40 [NOTICE] [configure] 500 out of 2163 done.
2020-12-16 01:39:56 [NOTICE] [configure] 600 out of 2163 done.
2020-12-16 01:39:56 [NOTICE] [configure] 700 out of 2165 done.
2020-12-16 01:39:57 [NOTICE] [configure] 800 out of 2165 done.
2020-12-16 01:39:57 [NOTICE] [configure] 900 out of 2167 done.
2020-12-16 01:39:59 [NOTICE] [configure] 1000 out of 2168 done.
2020-12-16 01:39:59 [NOTICE] [configure] 1100 out of 2169 done.
2020-12-16 01:39:59 [NOTICE] [configure] 1200 out of 2170 done.
2020-12-16 01:39:59 [NOTICE] [configure] 1300 out of 2174 done.
2020-12-16 01:40:01 [NOTICE] [configure] 1400 out of 2174 done.
2020-12-16 01:40:18 [NOTICE] [configure] 1500 out of 2175 done.
2020-12-16 01:40:18 [NOTICE] [configure] 1600 out of 2176 done.
2020-12-16 01:41:17 [NOTICE] [configure] 1700 out of 2176 done.
2020-12-16 01:41:17 [NOTICE] [configure] 1800 out of 2176 done.
2020-12-16 01:41:17 [NOTICE] [configure] 1900 out of 2176 done.
2020-12-16 01:41:17 [NOTICE] [configure] 2000 out of 2176 done.
2020-12-16 01:41:17 [NOTICE] [configure] 2100 out of 2176 done.
2020-12-16 01:41:24 [NOTICE] [configure] System configuration has finished.
2020-12-16 01:41:24 [NOTICE] [post] Executing hooks in group post
Executing: foreman-rake upgrade:run
=============================================
Upgrade Step 1/3: katello:correct_repositories. This may take a long while.
=============================================
Upgrade Step 2/3: katello:correct_puppet_environments. This may take a long while.
=============================================
Upgrade Step 3/3: katello:clean_backend_objects. This may take a long while.
0 orphaned consumer id(s) found in candlepin.
Candlepin orphaned consumers: []
0 orphaned consumer id(s) found in pulp.
Pulp orphaned consumers: []
  Success!

Comment 10 errata-xmlrpc 2021-04-21 13:11:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.9 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:1313