Bug 1576348 - All insights-client output is sent to STDERR
Summary: All insights-client output is sent to STDERR
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Cloud Software Services (cloud.redhat.com)
Classification: Red Hat
Component: Client
Version: unspecified
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: jcrafts
QA Contact: Pavol Kotvan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-05-09 09:05 UTC by Simon Reber
Modified: 2020-03-31 09:07 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-12 17:29:30 UTC
Target Upstream Version:
pakotvan: needinfo-


Attachments (Terms of Use)

Description Simon Reber 2018-05-09 09:05:28 UTC
Description of problem:

All output from `insights-client` insights client is sent to STDERR.

# insights-client >/dev/null | cat
Starting to collect Insights data for unused.gsslab.brq2.redhat.com
Uploading Insights data.
Successfully uploaded report from cbea096a-b5b9-435d-99f5-6ef3e063de49 to account 540155.

[root@unused /]# insights-client  > /tmp/insights.log 2>/tmp/log_error.out
[root@unused /]# cat /tmp/insights.log
[root@unused /]# cat /tmp/log_error.out
Starting to collect Insights data for unused.gsslab.brq2.redhat.com
Uploading Insights data.
Successfully uploaded report from cbea096a-b5b9-435d-99f5-6ef3e063de49 to account 540155.

[root@unused /]# insights-client --verbose > /tmp/insights.log 2>/tmp/log_error.out
[root@unused /]# grep INFO /tmp/log_error.out
2018-05-09 11:00:41,617     INFO insights.client.client Starting to collect Insights data for unused.gsslab.brq2.redhat.com
2018-05-09 11:00:50,359     INFO insights.client.client Uploading Insights data.
2018-05-09 11:00:53,324     INFO insights.client.client Successfully uploaded report from cbea096a-b5b9-435d-99f5-6ef3e063de49 to account 540155.

This does not really make sense as we expect INFO to be sent to STDOUT instead of STDERR. It makes it especially difficult when working with `cron`.

Note sure if https://github.com/RedHatInsights/insights-client/commit/063cb73515354cb41cd2c8cafcf4257c6d03f251#diff-bca9776d6eb0850f53eff40bd85b45eaR43 is related but in there we set `sys.stderr`

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

 - insights-client-3.0.3-9.el7_5.noarch

How reproducible:

 - always


Steps to Reproduce:
1. insights-client >/dev/null | cat

Actual results:

INFO messages printed

Expected results:

INFO messages to be printed to STDOUT

Additional info:

Comment 1 Markus Schibli 2019-03-18 11:11:17 UTC
Hi,
are there any news on this bz? The bz is now open for more than 10 month, nothing happened since then, still in Status "New", why? Please update the bz and let us know what the current status is. 
Thanks for your support.
Regards
Markus

Comment 2 jcrafts 2019-03-18 14:33:05 UTC
There are currently no plans to change this behavior. Please reopen if the impact is severe and the team can reassess it then.

Comment 7 Dave Johnson 2020-01-20 15:02:51 UTC
Pavol, has this been released yet?  If not, can you please give an idea as to when?  TY


Note You need to log in before you can comment on or make changes to this bug.