Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-63394

shell command "exit 0" will fail jenkins job on an ubuntu 20.04 node

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: _unsorted
    • Labels:
      None
    • Similar Issues:

      Description

      the following shell command will fail jenkins job on an ubuntu 20.04 node

      #!/bin/bash -el
      exit 0

       

      error:

      Build step 'Execute shell' marked build as failure

        Attachments

          Activity

          Hide
          maksonlee Makson Lee added a comment -

          run the shell command with -exl options and got more details.

           

          $ /bin/bash -exl /tmp/jenkins14350390494263487133.sh
          + '[' '' ']'
          + '[' -d /etc/profile.d ']'
          + for i in /etc/profile.d/*.sh
          + '[' -r /etc/profile.d/01-locale-fix.sh ']'
          + . /etc/profile.d/01-locale-fix.sh
          +++ /usr/bin/locale-check C.UTF-8
          ++ eval
          + for i in /etc/profile.d/*.sh
          + '[' -r /etc/profile.d/apps-bin-path.sh ']'
          + . /etc/profile.d/apps-bin-path.sh
          ++ snap_bin_path=/snap/bin
          ++ '[' -n /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games -a -n /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games ']'
          ++ export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
          ++ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
          ++ '[' -z '' ']'
          ++ export XDG_DATA_DIRS=/usr/local/share:/usr/share
          ++ XDG_DATA_DIRS=/usr/local/share:/usr/share
          ++ snap_xdg_path=/var/lib/snapd/desktop
          ++ '[' -n /usr/local/share:/usr/share -a -n /usr/local/share:/usr/share ']'
          ++ export XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
          ++ XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
          + for i in /etc/profile.d/*.sh
          + '[' -r /etc/profile.d/bash_completion.sh ']'
          + . /etc/profile.d/bash_completion.sh
          ++ '[' 'x5.0.17(1)-release' '!=' x -a x '!=' x -a x = x ']'
          + for i in /etc/profile.d/*.sh
          + '[' -r /etc/profile.d/cedilla-portuguese.sh ']'
          + . /etc/profile.d/cedilla-portuguese.sh
          ++ '[' '' = pt -a en '!=' pt ']'
          + for i in /etc/profile.d/*.sh
          + '[' -r /etc/profile.d/gawk.sh ']'
          + . /etc/profile.d/gawk.sh
          + for i in /etc/profile.d/*.sh
          + '[' -r /etc/profile.d/Z97-byobu.sh ']'
          + . /etc/profile.d/Z97-byobu.sh
          ++ '[' -r /usr/bin/byobu-launch ']'
          ++ '[' '' = 0 ']'
          ++ '[' '' = 1 ']'
          ++ '[' -e /etc/byobu/autolaunch ']'
          ++ '[' '' = byobu ']'
          ++ '[' '' = byobu-screen ']'
          ++ '[' '' = byobu-tmux ']'
          + unset i
          + '[' -n '5.0.17(1)-release' ']'
          + '[' -f /home/jenkins/.bashrc ']'
          + . /home/jenkins/.bashrc
          ++ case $- in
          ++ return
          + '[' -d /home/jenkins/bin ']'
          + PATH=/home/jenkins/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
          + exit 0
          ++ '[' 1 = 1 ']'
          ++ '[' -x /usr/bin/clear_console ']'
          ++ /usr/bin/clear_console -q
          Build step 'Execute shell' marked build as failure
          Finished: FAILURE

          Show
          maksonlee Makson Lee added a comment - run the shell command with -exl options and got more details.   $ /bin/bash -exl /tmp/jenkins14350390494263487133.sh + ' [' '' '] ' + ' [' -d /etc/profile.d '] ' + for i in /etc/profile.d/*.sh + ' [' -r /etc/profile.d/01-locale-fix.sh '] ' + . /etc/profile.d/01-locale-fix.sh +++ /usr/bin/locale-check C.UTF-8 ++ eval + for i in /etc/profile.d/*.sh + ' [' -r /etc/profile.d/apps-bin-path.sh '] ' + . /etc/profile.d/apps-bin-path.sh ++ snap_bin_path=/snap/bin ++ ' [' -n /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games -a -n /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games '] ' ++ export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin ++ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin ++ ' [' -z '' '] ' ++ export XDG_DATA_DIRS=/usr/local/share:/usr/share ++ XDG_DATA_DIRS=/usr/local/share:/usr/share ++ snap_xdg_path=/var/lib/snapd/desktop ++ ' [' -n /usr/local/share:/usr/share -a -n /usr/local/share:/usr/share '] ' ++ export XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop ++ XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop + for i in /etc/profile.d/*.sh + ' [' -r /etc/profile.d/bash_completion.sh '] ' + . /etc/profile.d/bash_completion.sh ++ ' [' 'x5.0.17(1)-release' '!=' x -a x '!=' x -a x = x '] ' + for i in /etc/profile.d/*.sh + ' [' -r /etc/profile.d/cedilla-portuguese.sh '] ' + . /etc/profile.d/cedilla-portuguese.sh ++ ' [' '' = pt -a en '!=' pt '] ' + for i in /etc/profile.d/*.sh + ' [' -r /etc/profile.d/gawk.sh '] ' + . /etc/profile.d/gawk.sh + for i in /etc/profile.d/*.sh + ' [' -r /etc/profile.d/Z97-byobu.sh '] ' + . /etc/profile.d/Z97-byobu.sh ++ ' [' -r /usr/bin/byobu-launch '] ' ++ ' [' '' = 0 '] ' ++ ' [' '' = 1 '] ' ++ ' [' -e /etc/byobu/autolaunch '] ' ++ ' [' '' = byobu '] ' ++ ' [' '' = byobu-screen '] ' ++ ' [' '' = byobu-tmux '] ' + unset i + ' [' -n '5.0.17(1)-release' '] ' + ' [' -f /home/jenkins/.bashrc '] ' + . /home/jenkins/.bashrc ++ case $- in ++ return + ' [' -d /home/jenkins/bin '] ' + PATH=/home/jenkins/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin + exit 0 ++ ' [' 1 = 1 '] ' ++ ' [' -x /usr/bin/clear_console '] ' ++ /usr/bin/clear_console -q Build step 'Execute shell' marked build as failure Finished: FAILURE
          Hide
          maksonlee Makson Lee added a comment -

          output of running same command on an ubuntu 18.04 node.

           

          $ /bin/bash -exl /tmp/jenkins17283880185058389627.sh
          + '[' '' ']'
          + '[' -d /etc/profile.d ']'
          + for i in /etc/profile.d/*.sh
          + '[' -r /etc/profile.d/01-locale-fix.sh ']'
          + . /etc/profile.d/01-locale-fix.sh
          +++ /usr/bin/locale-check C.UTF-8
          ++ eval
          + for i in /etc/profile.d/*.sh
          + '[' -r /etc/profile.d/apps-bin-path.sh ']'
          + . /etc/profile.d/apps-bin-path.sh
          ++ snap_bin_path=/snap/bin
          ++ '[' -n /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games -a -n /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games ']'
          ++ export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
          ++ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
          ++ '[' -z '' ']'
          ++ export XDG_DATA_DIRS=/usr/local/share:/usr/share
          ++ XDG_DATA_DIRS=/usr/local/share:/usr/share
          ++ snap_xdg_path=/var/lib/snapd/desktop
          ++ '[' -n /usr/local/share:/usr/share -a -n /usr/local/share:/usr/share ']'
          ++ export XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
          ++ XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
          + for i in /etc/profile.d/*.sh
          + '[' -r /etc/profile.d/bash_completion.sh ']'
          + . /etc/profile.d/bash_completion.sh
          ++ '[' -n '4.4.20(1)-release' -a -n '' -a -z '' ']'
          + for i in /etc/profile.d/*.sh
          + '[' -r /etc/profile.d/cedilla-portuguese.sh ']'
          + . /etc/profile.d/cedilla-portuguese.sh
          ++ '[' '' = pt -a en '!=' pt ']'
          + for i in /etc/profile.d/*.sh
          + '[' -r /etc/profile.d/Z97-byobu.sh ']'
          + . /etc/profile.d/Z97-byobu.sh
          ++ '[' -r /usr/bin/byobu-launch ']'
          ++ '[' '' = 0 ']'
          ++ '[' '' = 1 ']'
          ++ '[' -e /etc/byobu/autolaunch ']'
          ++ '[' '' = byobu ']'
          ++ '[' '' = byobu-screen ']'
          ++ '[' '' = byobu-tmux ']'
          + unset i
          + '[' -n '4.4.20(1)-release' ']'
          + '[' -f /home/jenkins/.bashrc ']'
          + . /home/jenkins/.bashrc
          ++ case $- in
          ++ return
          + '[' -d /home/jenkins/bin ']'
          + PATH=/home/jenkins/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
          + exit 0
          ++ '[' 2 = 1 ']'
          Finished: SUCCESS

          Show
          maksonlee Makson Lee added a comment - output of running same command on an ubuntu 18.04 node.   $ /bin/bash -exl /tmp/jenkins17283880185058389627.sh + ' [' '' '] ' + ' [' -d /etc/profile.d '] ' + for i in /etc/profile.d/*.sh + ' [' -r /etc/profile.d/01-locale-fix.sh '] ' + . /etc/profile.d/01-locale-fix.sh +++ /usr/bin/locale-check C.UTF-8 ++ eval + for i in /etc/profile.d/*.sh + ' [' -r /etc/profile.d/apps-bin-path.sh '] ' + . /etc/profile.d/apps-bin-path.sh ++ snap_bin_path=/snap/bin ++ ' [' -n /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games -a -n /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games '] ' ++ export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin ++ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin ++ ' [' -z '' '] ' ++ export XDG_DATA_DIRS=/usr/local/share:/usr/share ++ XDG_DATA_DIRS=/usr/local/share:/usr/share ++ snap_xdg_path=/var/lib/snapd/desktop ++ ' [' -n /usr/local/share:/usr/share -a -n /usr/local/share:/usr/share '] ' ++ export XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop ++ XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop + for i in /etc/profile.d/*.sh + ' [' -r /etc/profile.d/bash_completion.sh '] ' + . /etc/profile.d/bash_completion.sh ++ ' [' -n '4.4.20(1)-release' -a -n '' -a -z '' '] ' + for i in /etc/profile.d/*.sh + ' [' -r /etc/profile.d/cedilla-portuguese.sh '] ' + . /etc/profile.d/cedilla-portuguese.sh ++ ' [' '' = pt -a en '!=' pt '] ' + for i in /etc/profile.d/*.sh + ' [' -r /etc/profile.d/Z97-byobu.sh '] ' + . /etc/profile.d/Z97-byobu.sh ++ ' [' -r /usr/bin/byobu-launch '] ' ++ ' [' '' = 0 '] ' ++ ' [' '' = 1 '] ' ++ ' [' -e /etc/byobu/autolaunch '] ' ++ ' [' '' = byobu '] ' ++ ' [' '' = byobu-screen '] ' ++ ' [' '' = byobu-tmux '] ' + unset i + ' [' -n '4.4.20(1)-release' '] ' + ' [' -f /home/jenkins/.bashrc '] ' + . /home/jenkins/.bashrc ++ case $- in ++ return + ' [' -d /home/jenkins/bin '] ' + PATH=/home/jenkins/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin + exit 0 ++ ' [' 2 = 1 '] ' Finished: SUCCESS
          Hide
          maksonlee Makson Lee added a comment -

          wrong $SHLVL cause the error?

          Show
          maksonlee Makson Lee added a comment - wrong $SHLVL cause the error?
          Hide
          maksonlee Makson Lee added a comment -
          Show
          maksonlee Makson Lee added a comment - this should be a bug of ubuntu. https://askubuntu.com/questions/1267095/shell-level-issue-on-ubuntu-20-04

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            maksonlee Makson Lee
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: