Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-63199

Disk usage checker error messages should go to stderr instead of stdout

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • 4.19
    • must-gather
    • None
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Description of problem:

              The volume usage checker script in must-gather outputs critical error messages 
          to stdout instead of stderr. When disk space exceeds the configured limit, the 
          error message "Disk usage exceeds the volume percentage..." is written to stdout 
          (line 98 in pkg/cli/admin/mustgather/mustgather.go), which is inconsistent with 
          Unix conventions and the error handling pattern used elsewhere in the must-gather 
          codebase.

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

          

      How reproducible:

          Always - the volumeUsageCheckerScript uses plain 'echo' commands which always 
          write to stdout.

      Steps to Reproduce:

         1. Run `oc adm must-gather` with output redirection: `oc adm must-gather > output.log`
          2. Trigger disk usage to exceed the --volume-percentage limit (default 70%)
          3. Observe that the critical error "Disk usage exceeds the volume percentage..." 
             is written to output.log instead of appearing on the terminal

      Actual results:

              The disk usage error message goes to stdout and gets captured by output 
          redirection, potentially making the error invisible to the user if they're 
          redirecting stdout to a file.

      Expected results:

              The disk usage error message should be written to stderr (using '>&2' 
          redirection) so it:
          - Remains visible on the terminal even when stdout is redirected
          - Follows Unix conventions where errors go to stderr
          - Matches the pattern used elsewhere in must-gather (e.g., lines 1252-1267 
            use fmt.Fprintf(o.ErrOut, ...) for errors)

      Additional info:

          

              tgeer@redhat.com Trilok Geer
              rh-ee-sprizend Shoshana Prizend
              None
              None
              Keenon Lee Keenon Lee
              None
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: