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
If anything in the FlatpakTransaction when running flatpak install returns an error, that error won’t be reported when running with --noninteractive. flatpak install will return a 0 exit status.
For example, if I set min-free-space=50000MB (a valid value, but more free space than I have on my system), then run:
$ flatpak install --user --noninteractive org.octave.Octave
Installing runtime/org.kde.Sdk/x86_64/5.12
$ echo $?
0
$ flatpak run org.octave.Octave
error: app/org.octave.Octave/x86_64/master not installed
If you run without --noninteractive, the error is correctly reported:
$ flatpak install --user flathub org.octave.Octave
…
error: Failed to install org.octave.Octave: min-free-space-size 50000MB would be exceeded
The problem is that FlatpakQuietTransaction doesn’t implement the operation_error vfunc, so flatpak_transaction_run() ends up returning FLATPAK_ERROR_ABORTED — but flatpak-builtin-install.c explicitly squashes FLATPAK_ERROR_ABORTED errors, since it expects FlatpakCliTransaction to have already printed any relevant error.
The fix is to either not squash FLATPAK_ERROR_ABORTED when using FlatpakQuietTransaction, or implement operation_error in FlatpakQuietTransaction. I’m afraid I don’t have time to do either of those at the moment.
This is likely a problem with other builtin commands which use FlatpakQuietTransaction, but I’ve only tested with flatpak install.
This is with flatpak 0b20f3d4 (a recentish git master).
The text was updated successfully, but these errors were encountered:
We need to handle operation_error and report errors, and for
fatal errors remember this and report a failure in run(), because
otherwise it returns ABORTED, which is treated as a failure (because
generally that meant the user chose "no" on some question).
Fixesflatpak#2839, flatpak#2757
If anything in the
FlatpakTransaction
when runningflatpak install
returns an error, that error won’t be reported when running with--noninteractive
.flatpak install
will return a0
exit status.For example, if I set
min-free-space=50000MB
(a valid value, but more free space than I have on my system), then run:If you run without
--noninteractive
, the error is correctly reported:The problem is that
FlatpakQuietTransaction
doesn’t implement theoperation_error
vfunc, soflatpak_transaction_run()
ends up returningFLATPAK_ERROR_ABORTED
— butflatpak-builtin-install.c
explicitly squashesFLATPAK_ERROR_ABORTED
errors, since it expectsFlatpakCliTransaction
to have already printed any relevant error.The fix is to either not squash
FLATPAK_ERROR_ABORTED
when usingFlatpakQuietTransaction
, or implementoperation_error
inFlatpakQuietTransaction
. I’m afraid I don’t have time to do either of those at the moment.This is likely a problem with other builtin commands which use
FlatpakQuietTransaction
, but I’ve only tested withflatpak install
.This is with flatpak
0b20f3d4
(a recentish git master).The text was updated successfully, but these errors were encountered: