Uploaded image for project: 'Red Hat Advanced Cluster Management'
  1. Red Hat Advanced Cluster Management
  2. ACM-28135

Clean up false errors in installer automation

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Normal Normal
    • None
    • None
    • Installer
    • None
    • Moderate
    • None

      When running the automation locally, if a grep command does not return results, it return an error code of 1 and shows a long error, despite this being correct in the automation.

      TASK [Get cluster-backup Placement] ********************************************************************************************************************************************************
      task path: /home/msmigiel/Documents/git/automation-acm/tasks/get_component_resources.yml:274
      Wednesday 07 January 2026  07:41:30 -0500 (0:00:00.056)       0:01:00.836 *****
      [ERROR]: Task failed: Module failed: non-zero return code
      Origin: /home/msmigiel/Documents/git/automation-acm/tasks/get_component_resources.yml:274:3
      
      272   delay: 15
      273
      274 - name: Get {{ component_name }} Placement
            ^ column 3
      
      fatal: [msmigiel-thinkpadp1gen5.westford.csb]: FAILED! => {"changed": true, "cmd": "oc get placement -n open-cluster-management-backup -ojson | jq -r '.items[].metadata | .name' | grep -E 'cluster-backup|cluster-backup|backup'", "delta": "0:00:00.329616", "end": "2026-01-07 07:41:31.774271", "msg": "non-zero return code", "rc": 1, "start": "2026-01-07 07:41:31.444655", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
      ...ignoring
      

      In Jenkins, it shows as this, less of an error stack but still an error.

      TASK [Get cluster-backup Placement] ********************************************
      task path: /home/jenkins/workspace/qe-acm-automation-poc/install_acm_e2e_tests/acm/tasks/get_component_resources.yml:274
      Wednesday 07 January 2026  13:26:10 +0000 (0:00:00.021)       0:31:42.674 ***** 
      fatal: [localhost]: FAILED! => {"changed": true, "cmd": "oc get placement -n open-cluster-management-backup -ojson | jq -r '.items[].metadata | .name' | grep -E 'cluster-backup|cluster-backup|backup'", "delta": "0:00:00.377912", "end": "2026-01-07 13:26:10.776291", "msg": "non-zero return code", "rc": 1, "start": "2026-01-07 13:26:10.398379", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
      ...ignoring
      

      By changing the command to return true, it will hide these false errors:

      oc get clusterrole -n {{ backup_namespace }} | grep "{{ component }}" || true
      
      TASK [Get cluster-backup clusterrole] ******************************************************************************************************************************************************
      task path: /home/msmigiel/Documents/git/automation-acm/cluster-backup.yml:59
      Wednesday 07 January 2026  07:41:34 -0500 (0:00:00.037)       0:01:04.911 *****
      changed: [msmigiel-thinkpadp1gen5.westford.csb] => {"attempts": 1, "changed": true, "cmd": "oc get clusterrole -n open-cluster-management-backup | grep \"cluster-backup\" || true\n", "delta": "0:00:00.616940", "end": "2026-01-07 07:41:36.020871", "msg": "", "rc": 0, "start": "2026-01-07 07:41:35.403931", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
      
      TASK [Get cluster-backup clusterrole] ******************************************
      task path: /home/jenkins/workspace/qe-acm-automation-poc/install_acm_e2e_tests/acm/cluster-backup.yml:59
      Wednesday 07 January 2026  13:26:13 +0000 (0:00:00.025)       0:31:45.534 ***** 
      changed: [localhost] => {"attempts": 1, "changed": true, "cmd": "oc get clusterrole -n open-cluster-management-backup | grep \"cluster-backup\" || true\n", "delta": "0:00:00.565232", "end": "2026-01-07 13:26:13.831005", "msg": "", "rc": 0, "start": "2026-01-07 13:26:13.265773", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
      

              rh-ee-msmigiel Matthew Smigielski
              rh-ee-msmigiel Matthew Smigielski
              Matthew Smigielski Matthew Smigielski
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: