You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
On Ubuntu, if you try to run installdependencies.sh and if no packages, of the ones listed in the script, exist the script still returns success.
To Reproduce
Steps to reproduce the behavior:
Edit installdependencies.sh and make sure that no packages actually match real packages
Run it and see that the script returns success:
root@7774063ae328:~# ./installdependencies.sh
--------OS Information--------
PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
------------------------------
The current OS is Debian based
--------Debian Version--------
bookworm/sid
------------------------------
/usr/bin/apt-get
Hit:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Hit:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libkrb5-3 is already the newest version (1.19.2-2ubuntu0.4).
zlib1g is already the newest version (1:1.2.11.dfsg-2ubuntu9.2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package asdfasdfliblttng-ust1
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package asdfasdfliblttng-ust0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package libssl1.1$
E: Couldn't find any package by glob 'libssl1.1$'E: Couldn't find any package by regex 'libssl1.1$'
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package libssl1.0.2$
E: Couldn't find any package by glob 'libssl1.0.2$'E: Couldn't find any package by regex 'libssl1.0.2$'
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package libssl1.0.0$
E: Couldn't find any package by glob 'libssl1.0.0$'E: Couldn't find any package by regex 'libssl1.0.0$'
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package asdfasdflibicu72
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package asdfasdflibicu71
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package asdfasdflibicu70
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package asdfasdflibicu69
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package asdfasdflibicu68
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package asdfasdflibicu67
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package asdfasdflibicu66
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package asdfasdflibicu65
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package asdfasdflibicu63
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package asdfasdflibicu60
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package asdfasdflibicu57
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package asdfasdflibicu55
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package asdfasdflibicu52
-----------------------------
Finish Install Dependencies
-----------------------------
root@7774063ae328:~# echo $?
0
Expected behavior
If one or more required packages aren't installed it should return an error/set an exit code != 0 and print out some error text.
OS of the machine running the runner? Ubuntu 22.04.5 LTS
What's not working?
Installing dependencies with the installdependencies.sh doesn't show correct output when there are failures on Ubuntu.
The issue is a combination of:
Assigning the exit code to a variable after running apt, without acting on an any error directly, (which resets the exit code to 0 since the assignment was successful) here:
Then trying to read out the error code and print the error afterwards, which of course doesn't work since assigning the exit code to the variable worked and that exit code is 0, e.g. here:
If applicable, include the relevant part of the job / step log output here. All sensitive information should already be masked out, but please double-check before pasting here.
Runner and Worker's Diagnostic Logs
If applicable, add relevant diagnostic log information. Logs are located in the runner's _diag folder. The runner logs are prefixed with Runner_ and the worker logs are prefixed with Worker_. Each job run correlates to a worker log. All sensitive information should already be masked out, but please double-check before pasting here.
The text was updated successfully, but these errors were encountered:
Describe the bug
On Ubuntu, if you try to run
installdependencies.sh
and if no packages, of the ones listed in the script, exist the script still returns success.To Reproduce
Steps to reproduce the behavior:
installdependencies.sh
and make sure that no packages actually match real packagesExpected behavior
If one or more required packages aren't installed it should return an error/set an exit code != 0 and print out some error text.
Runner Version and Platform
v2.320.0
OS of the machine running the runner? Ubuntu 22.04.5 LTS
What's not working?
Installing dependencies with the
installdependencies.sh
doesn't show correct output when there are failures on Ubuntu.The issue is a combination of:
Assigning the exit code to a variable after running
apt
, without acting on an any error directly, (which resets the exit code to 0 since the assignment was successful) here:runner/src/Misc/layoutbin/installdependencies.sh
Line 79 in 9b3b554
Then trying to read out the error code and print the error afterwards, which of course doesn't work since assigning the exit code to the variable worked and that exit code is 0, e.g. here:
runner/src/Misc/layoutbin/installdependencies.sh
Line 98 in 9b3b554
Suggestion is to move all the error handling that is repeated into the
apt_get_with_fallbacks
function itself:Job Log Output
If applicable, include the relevant part of the job / step log output here. All sensitive information should already be masked out, but please double-check before pasting here.
Runner and Worker's Diagnostic Logs
If applicable, add relevant diagnostic log information. Logs are located in the runner's
_diag
folder. The runner logs are prefixed withRunner_
and the worker logs are prefixed withWorker_
. Each job run correlates to a worker log. All sensitive information should already be masked out, but please double-check before pasting here.The text was updated successfully, but these errors were encountered: