Describe the bug
When the runner is outdated and supposed to be upgraded, it doesn't report the exit code != 0
To Reproduce
Steps to reproduce the behavior:
Go to the runner directory
Run the configuration to register it without auto update ./config.sh --url $RUNNER_URL --token "$(get_runner_token)" --ephemeral --disableupdate --unattended --runnergroup Default --labels "$LABELS" --work _work --name "$INSTANCE_ID"
Then try to launch it ./run.sh && echo This piece of art just silently fails || echo GH does at least anything right
Expected behaviorObviously, the application failing to start must report an error. But instead, we see the next:
β Connected to GitHub
Current runner version: '2.313.0'
2024-04-30 10:58:45Z: Listening for Jobs
An error occured: Runner version v2.313.0 is deprecated and cannot receive messages.
Runner listener exit with terminated error, stop the service, no retry needed.
Exiting runner...
This piece of art just silently fails
Runner Version and Platform
2.313.0
OS of the machine running the runner? Linux
Reasons
This line should be exit $returnCode, but instead it masks errors.
Although, not only run.sh masks the exit code, but as well the run-helper.sh does it here:
$ bash -x /home/ubuntu/actions-runner/run-helper.sh
++ id -u
+ user_id=1000
+ '[' 1000 -eq 0 -a -z '' ']'
+ shopt -s nocasematch
+ SOURCE=/home/ubuntu/actions-runner/run-helper.sh
+ '[' -h /home/ubuntu/actions-runner/run-helper.sh ']'
+++ dirname /home/ubuntu/actions-runner/run-helper.sh
++ cd -P /home/ubuntu/actions-runner
++ pwd
+ DIR=/home/ubuntu/actions-runner
+ '[' '!' -z '' ']'
+ updateFile=update.finished
+ /home/ubuntu/actions-runner/bin/Runner.Listener run
β Connected to GitHub
Current runner version: '2.313.0'
2024-04-30 11:29:21Z: Listening for Jobs
An error occured: Runner version v2.313.0 is deprecated and cannot receive messages.
+ returnCode=1 # <------ exit code 1
+ [[ 1 == 0 ]]
+ [[ 1 == 1 ]]
+ echo 'Runner listener exit with terminated error, stop the service, no retry needed.'
Runner listener exit with terminated error, stop the service, no retry needed.
+ exit 0 # <------ but who cares Β―\_(γ)_/Β―
Describe the bug When the runner is outdated and supposed to be upgraded, it doesn't report the exit code != 0
To Reproduce Steps to reproduce the behavior:
./config.sh --url $RUNNER_URL --token "$(get_runner_token)" --ephemeral --disableupdate --unattended --runnergroup Default --labels "$LABELS" --work _work --name "$INSTANCE_ID"
./run.sh && echo This piece of art just silently fails || echo GH does at least anything right
Expected behavior Obviously, the application failing to start must report an error. But instead, we see the next:
Runner Version and Platform
2.313.0
OS of the machine running the runner? Linux
Reasons
This line should be
exit $returnCode
, but instead it masks errors.Although, not only
run.sh
masks the exit code, but as well therun-helper.sh
does it here: