Bug 1329980

Summary: foreman-debug collects just few mongo task statuses
Product: Red Hat Satellite Reporter: Pavel Moravec <pmoravec>
Component: Foreman DebugAssignee: Lukas Zapletal <lzap>
Status: CLOSED ERRATA QA Contact: Corey Welton <cwelton>
Severity: low Docs Contact:
Priority: medium    
Version: 6.1.7CC: ehelms, inecas, zhunting
Target Milestone: 6.4.0Keywords: EasyFix, Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
URL: http://projects.theforeman.org/issues/15967
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-16 19:00:42 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 Pavel Moravec 2016-04-25 08:39:03 UTC
Description of problem:
foreman-debug collects mongo collection task_status (worth used for investigating pulp task issues). BUT the command in

/usr/share/foreman/script/foreman-debug.d/katello-debug.sh

collects only 20 rows of that table/collection, due to the default (non-clever) limitation of mongo. Please collect _all_ the rows, by replacing:

add_cmd "mongo pulp_database --eval \"db.task_status.find().pretty().shellPrint()\"" "mongo-task_status"


by:

add_cmd "mongo pulp_database --eval \"DBQuery.shellBatchSize = 100000;; db.task_status.find().pretty().shellPrint()\"" "mongo-task_status"

(i.e. add "DBQuery.shellBatchSize = 100000;" there)


Version-Release number of selected component (if applicable):
katello-debug-2.2.0.19-1.el7sat.noarch


How reproducible:
100%


Steps to Reproduce:
1. foreman-debug
2. unpack collected f-d
3. check mongo-task_status


Actual results:
mongo-task_status has just 20 entries and the file ends with:

Type "it" for more



Expected results:
mongo-task_status to have all entries


Additional info:
Since the table/collection might be quite big and collecting it might not be necessary, isn't it better to collect e.g. all tasks from past one week or so? Or additionally older not finished tasks?

Comment 3 Bryan Kearney 2016-07-08 20:46:35 UTC
Per 6.3 planning, moving out non acked bugs to the backlog

Comment 5 Zach Huntington-Meath 2016-08-03 18:06:46 UTC
Created redmine issue http://projects.theforeman.org/issues/15967 from this bug

Comment 6 Bryan Kearney 2016-08-04 08:14:29 UTC
Upstream bug component is Content Management

Comment 7 Bryan Kearney 2016-08-24 20:15:11 UTC
Upstream bug component is Infrastructure

Comment 8 Satellite Program 2017-10-17 08:16:44 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/15967 has been resolved.

Comment 9 Chris Brown 2018-07-11 18:53:47 UTC
Satellite 6.4 foreman-debug mongo-task_status output:

COMMAND> mongo pulp_database --eval "DBQuery.shellBatchSize = 200;; db.task_status.find().sort({finish_time: -1}).pretty().shellPrint()"

/usr/sbin/foreman-debug: line 79: mongo: command not found

Comment 10 Lukas Zapletal 2018-07-12 15:09:24 UTC
Chris, this is expected. When you install the command, it will work.

We cannot make mongo CLI a dependency of foreman-debug. If you really think the output must be always there, then file new BZ aganst Packaging to add this as Katello package RPM dependency.

Please confirm first that it works fine when the command is present. I think it is mongo-client RPM package, not sure.

Comment 13 Chris Brown 2018-08-24 19:45:43 UTC
Ok cool, confirmed and verified in Satellite 6.4

Comment 15 Bryan Kearney 2018-10-16 19:00:42 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, 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-2018:2927