Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
This would be really, really great to get fixed, including for *ALL* foremain-maintain subcommands.
The same issue (albeit on a much larger scale) shows up when running a Satellite backup in a Cron job via foremain-maintain, the output of which by default is sent via e-mail to the root user on the system. The e-mail sent by Cron is completely unreadable (see below for examples) and is so long that the e-mail actually gets truncated (most of the output is completely lost), making it useless. I've since made the decision to redirect the backup command to /dev/null so it's output doesn't get captured by cron and sent over e-mail, but it'd be really nice if the output could be sent over e-mail again in a readable state (without the spinner causing issues).
It would also probably be good to not use any formatting that only works correctly in a terminal (like colors), unless a terminal is being used for stdout, so you don't get strange characters and formatting in the files/e-mails/etc.
There were never any issues with this prior to the backup commands being absorbed into foremain-maintain (with the added spinner actions and formatting).
Example:
...
--------------------------------------------------------------------------------
Generate metadata:
| Checking connection to the Mongo DB
/ Collecting metadata
/ Collecting system release info
/ Collecting system release info
- Collecting list of plugins
- Collecting list of plugins
\ Collecting list of plugins
| Collecting list of plugins
...
...
#### (repeats 50+ times) ####
...
...
| Collecting list of plugins
/ Collecting list of plugins
- Collectin!
g list of!
proxy features
- Collecting list of proxy features
\ Collecting list of proxy features
| Collecting installed RPMs
| Collecting installed RPMs
/ Collecting installed RPMs
...
...
\ Collecting installed RPMs
| Collecting installed RPMs
/ Collecting installed RPMs
- Saving metadata to metadata.yml [!
32m[1m[O!
K][0m
--------------------------------------------------------------------------------
Backup config files:
- Saving metadata to metadata.yml
\ Collecting config files to backup
\ Collecting config files to backup
| Collecting config files to backup
...
...
#### (repeats 100's of times) ####
...
...
| Collecting config files to backup
/ Collecting config files to backup
- Collecting config files to backup
\ Collecting config files to backup
| Collecting config files to backup
/ Collecting config files to backup
- Collecting config files to backup
\ Collecting config files to backup
#### -> e-mail ends (truncated)
Verified
Verified with:
- Satellite 6.8.0 snap 10
- rubygem-foreman_maintain-0.6.8-1.el7sat.noarch
Test steps:
- "foreman-maintain service status > /tmp/test.log" executed from cron.
Observation:
- Readable output, and spinner is not visible.
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 (Satellite 6.8 Satellite Maintenance 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/RHBA-2020:4365
Description of problem: foreman-maintain creates loong redundant output when it is redirected to a file # foreman-maintain service stop > fm.log # cat fm.log | tr '\r' '\n' Running Stop Services ================================================================================ Check if command is run as root user: [OK] -------------------------------------------------------------------------------- Stop applicable services: Stopping the following service(s): rh-mongodb34-mongod, postgresql, qdrouterd, qpidd, squid, pulp_celerybeat, pulp_resource_manager, pulp_streamer, pulp_workers, smart_proxy_dynflow_core, tomcat, dynflowd, httpd, puppetserver, foreman-proxy | / / - stopping foreman-proxy - stopping foreman-proxy \ stopping puppetserver \ stopping puppetserver | stopping httpd | stopping httpd / stopping httpd - stopping httpd \ stopping httpd | stopping httpd / stopping httpd ... \ stopping postgresql | stopping postgresql / stopping postgresql - stopping postgresql \ stopping postgresql | stopping postgresql / stopping postgresql - stopping rh-mongodb34-mongod - All services stopped [OK] -------------------------------------------------------------------------------- It could be simply: Running Stop Services ================================================================================ Check if command is run as root user: [OK] -------------------------------------------------------------------------------- Stop applicable services: Stopping the following service(s): rh-mongodb34-mongod, postgresql, qdrouterd, qpidd, squid, pulp_celerybeat, pulp_resource_manager, pulp_streamer, pulp_workers, smart_proxy_dynflow_core, tomcat, dynflowd, httpd, puppetserver, foreman-proxy - stopping foreman-proxy - stopping puppetserver - stopping httpd - stopping dynflowd - stopping tomcat - stopping smart_proxy_dynflow_core - stopping pulp_workers - stopping pulp_streamer - stopping pulp_resource_manager - stopping pulp_celerybeat - stopping squid - stopping qpidd - stopping qdrouterd - stopping postgresql - stopping rh-mongodb34-mongod - All services stopped [OK] -------------------------------------------------------------------------------- Version-Release number of selected component (if applicable): rubygem-foreman_maintain-0.2.11-1.el7sat.noarch