Uploaded image for project: 'OpenShift Request For Enhancement'
  1. OpenShift Request For Enhancement
  2. RFE-3314

exit code state is 0 even though command failed in debug node

    • False
    • None
    • False
    • Not Selected
    • Hide
      • When we are trying to debug into the node and run command as mentioned below, even though command failed , return code is 0.
      • But when we try the same debug in a pod, return code is 1 when command fails
      1. oc debug -n default node/master2.xxx-xxx-dev-cluster.reference.local – cd /bleble
        Starting pod/master2mcp-pbb-dev-clusterreferencelocal-debug ...
        To use host binaries, run `chroot /host`
        /usr/bin/cd: line 2: cd: /bleble: No such file or directory

      Removing debug pod ...

      (bastion):(admin) 02:49:14 CEST BASTION-1.6.0

      1. echo $?
        0

      Example1:

      1. oc -n rook-ceph exec deployment.apps/rook-ceph-tools – cd /bleble
        /usr/bin/cd: line 2: cd: /bleble: No such file or directory
        command terminated with exit code 1
      1. echo $?
        1

      Example2:

      1. oc -n rook-ceph exec deployment.apps/rook-ceph-tools – nonexistingexecutable
        time="2022-10-11T18:17:46Z" level=error msg="exec failed: unable to start container process: exec: \"nonexistingexecutable\": executable file not found in $PATH"
        command terminated with exit code 255
      1. echo $?
        255
         

       

      Show
      When we are trying to debug into the node and run command as mentioned below, even though command failed , return code is 0. But when we try the same debug in a pod, return code is 1 when command fails oc debug -n default node/master2.xxx-xxx-dev-cluster.reference.local – cd /bleble Starting pod/master2mcp-pbb-dev-clusterreferencelocal-debug ... To use host binaries, run `chroot /host` /usr/bin/cd: line 2: cd: /bleble: No such file or directory Removing debug pod ... (bastion):(admin) 02:49:14 CEST BASTION-1.6.0 echo $? 0 Example1: oc -n rook-ceph exec deployment.apps/rook-ceph-tools – cd /bleble /usr/bin/cd: line 2: cd: /bleble: No such file or directory command terminated with exit code 1 echo $? 1 Example2: oc -n rook-ceph exec deployment.apps/rook-ceph-tools – nonexistingexecutable time="2022-10-11T18:17:46Z" level=error msg="exec failed: unable to start container process: exec: \"nonexistingexecutable\": executable file not found in $PATH" command terminated with exit code 255 echo $? 255    

      1. Proposed title of this feature request
      "oc debug" returns 0 when command fails.

      2. What is the nature and description of the request? exit status should be 1
      3. Why does the customer need this? (List the business requirements here)  --> it creates confusion if the command was successful or not
      4. List any affected packages or components. – oc debug is effected

       

              gausingh@redhat.com Gaurav Singh
              rhn-support-vismishr Vishvranjan Mishra
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: