qubes-dom0-update "exit 1" on no upgrades

25 views
Skip to first unread message

qubenix

unread,
Nov 27, 2016, 7:17:02 PM11/27/16
to qubes...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

When there is nothing to upgrade for dom0 the qubes-dom0-update script
exits with a "1". Is this intended behavior?

A snippet from my term running qubes-dom0-update with "bash -x":

+ qvm-run --nogui --pass-io sys-update 'script --quiet --return
--command '\''/usr/lib/qubes/qubes-download-dom0-updates.sh --doit
--nogui
--exclude=qubes-template-debian-8,qubes-template-whonix-gw,qubes-template-whonix-ws,qubes-template-fedora-23,
-v -y --enablerepo=qubes-dom0-current-testing'\'' /dev/null'
Checking for dom0 updates...
Config time: 0.111
repo time: 0.000
repo time: 0.000
Setting up Package Sacks
pkgsack time: 0.087
No Match for argument Config
No Match for argument repo
No Match for argument Yum
No Match for argument Setting
No Match for argument pkgsack
No Match for argument rpmdb
No Match for argument Building
No Match for argument up:Obs
No Match for argument up:simple
No Match for argument up:obs
No Match for argument up:condense
No Match for argument updates
rpmdb time: 0.016
Nothing to download
+ RETCODE=1
+ '[' '' == 1 ']'
+ '[' 1 -ne 0 ']'
+ exit 1

- --
qubenix
GPG: B536812904D455B491DCDCDD04BE1E61A3C2E500
-----BEGIN PGP SIGNATURE-----

iQJ8BAEBCgBmBQJYO3YMXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ4RkZCRTJCQjc0OEJCOTBFOTUxMUE5NDFE
RDdFQzBCQjMzNUE1RjU4AAoJEN1+wLszWl9YREEP/jIxU5eyomuQ0rtyqQjmBc2I
3MliYQhqe9oNqOx5YjihdXPQTgPBmMERtDInJfWSFLsovID2EEX6YQ1r+gRoEOEG
tW8uAk5JMI2woSVScU3VAKWX564qgz1zQVZe9auGs4gnZBoL69tsh2Fa3/WAWD9w
7o8njL0FIaeaT1QIKSPwbaJYLBkuBqOVcDLCiOdk/FduzFZvJy+FPY8fv9a1F0Wv
Hh6xyefEtjxNO0ovMOKKKXbZdjjcG71Wk0mny8IbKP/VMF/hdZOGAtB6pW0lfj/J
E3jH9KNPLA5xKqQ3QoxJcEWaH4QJWCFL/Hfu/pD6Bg/0g0tZeESst02SjhFnwCPp
rAbcsXozzbgxa2gG8t1R27k1K8zM4AlMNoP9E3FBp6+sc703eVZ9PBVTjGJy81OC
EozmhP5ETiIDVQ0i7ilWcqH4VHinP/NSfJS6A+fnU40Va3jbipf3rffJysGe5aXV
kko7MykQ/jN7ExTnmNR7Tr8ewmbRrWhIAifiByL2FEibVgIWE9ghYDAdkFr9yG8T
5cp5TFWxeWr1qg8bPiHGfiRIPX5fH7/GGtvA2HAt3fyIgPcuvQBiU278e0zYToSC
oW7M8LHjj9hmVSujwgG9qI2+jPwh3AjNpgtCoxjXH0evSt6F0Nx18lWQR0e3N0Dg
I2AI6y2shhpu6GhSF/cm
=sUgX
-----END PGP SIGNATURE-----

Unman

unread,
Nov 27, 2016, 8:15:21 PM11/27/16
to qubenix, qubes...@googlegroups.com
If I remember right dnf returns 100 if there are updates, 0 if none, and
1 if an error occurs.
I'm pretty sure that qubes-dom0-update returns the dnf exit code, but
also reports "Nothing to download" if no packages have been downloaded.
You should check to see what's happening on the update qube, and whether
there was any error there.
(I really should look at the code - I may be way off.)

unman

qubenix

unread,
Nov 27, 2016, 8:32:48 PM11/27/16
to qubes...@googlegroups.com

Unman:
Looks like it returns the exit code from qvm-run
(https://github.com/QubesOS/qubes-core-admin-linux/blob/master/dom0-updates/qubes-dom0-update
- lines 168..174):

qvm-run $QVMRUN_OPTS --pass-io $UPDATEVM "script --quiet --return
--command '/usr/lib/qubes/qubes-download-dom0-updates.sh --doit --nogui
$ALL_OPTS' /dev/null"
RETCODE=$?
if [ "$CHECK_ONLY" == "1" ]; then
exit $RETCODE
elif [ "$RETCODE" -ne 0 ]; then
exit $RETCODE
fi

qvm-run
(https://github.com/QubesOS/qubes-core-admin/blob/master/qvm-tools/qvm-run)
is python so I need to study it hard to understand it.

--
qubenix
GPG: B536812904D455B491DCDCDD04BE1E61A3C2E500

Unman

unread,
Nov 27, 2016, 8:55:26 PM11/27/16
to qubenix, qubes...@googlegroups.com
qvm-run in dom0 does propagate exit codes.

Unman

unread,
Nov 27, 2016, 9:20:05 PM11/27/16
to qubenix, qubes...@googlegroups.com
And indeed, if everything runs smoothly, then the retcode is 0.
It's a moot point whether "Nothing to download" needs review, but I
think your result indicates some error on the update qube. Worth
checking .

Marek Marczykowski-Górecki

unread,
Nov 27, 2016, 9:53:07 PM11/27/16
to qubenix, qubes...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Mon, Nov 28, 2016 at 01:32:00AM +0000, qubenix wrote:
>
This is interesting. I guess it's result of "-v" you've given and some
yum/dnf genius printing diagnostic messages to stdout instead of stderr, so it
interfere with the actual output (which is later feed back to yum/dnf to
actually download available updates)...

> >> Nothing to download
> >> + RETCODE=1

And here we've got RETCODE=1.
- --
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJYO5wNAAoJENuP0xzK19csLlYIAI5svK2J331TywE8QLF48ux6
2FhB1Qsvq+9kCqk8Lnir/+mJkW5J/LADABjVaEHk9mnLHLhx3wmCuwQNQ3Txzokc
5+rP8Bx8D+5JZG7hWJA9nY41F6cD12APXLjVU1I4Y/T0eL0I7YHw3PW4uVkowC1Z
VHiZdpoOOhq+7ywOVtRCBXUI5oc6jHsApluMsHOlrYwZv4g/PugMZzqqyZGK4k2q
nR2w58PexEFKfq+ZAjTzoE6V4hnnL+oaY3AACph6rW2H7kDYrHZjxH88zrvn6sMT
0tMlokatBUwJWvoVPuCrO2FxZyxoo6RBqWlcsIcGM8FsfoyYpRFhYSyyLvbaMyY=
=ddYL
-----END PGP SIGNATURE-----

qubenix

unread,
Nov 28, 2016, 12:38:26 PM11/28/16
to qubes...@googlegroups.com
Marek Marczykowski-Górecki:
Even stranger, if I run something like this:

sudo qubes-dom0-update -v -y --enablerepo=qubes-dom0-current-testing
while [[ "$?" != "0" ]]; do
sudo qubes-dom0-update -v -y --enablerepo=qubes-dom0-current-testing
done

It will, almost every time, run the first update with exit 1 and the
second time with exit 0. I will try some tests (when I have some time,
today is busy) without "-v".


--
qubenix
GPG: B536812904D455B491DCDCDD04BE1E61A3C2E500

qubenix

unread,
Nov 28, 2016, 5:49:54 PM11/28/16
to qubes...@googlegroups.com
qubenix:
Without "-v" seems to work as expected, "exit 0" every time on 3 tries.

--
qubenix
GPG: B536812904D455B491DCDCDD04BE1E61A3C2E500
Reply all
Reply to author
Forward
0 new messages