Bug 395921 - discover 'update all' shows no error Msgs when apt preinstall step fails
Summary: discover 'update all' shows no error Msgs when apt preinstall step fails
Status: RESOLVED UPSTREAM
Alias: None
Product: Discover
Classification: Applications
Component: PackageKit (other bugs)
Version First Reported In: 5.13.5
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Aleix Pol
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-27 09:38 UTC by Achim Bohnet
Modified: 2018-10-01 13:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Achim Bohnet 2018-06-27 09:38:24 UTC
I wanted to upgrade today the 99 pkgs of the plasma 5.13.2 release.

I clicked 'Update all', discover asked for PW and returned last window without
doing anything.  Another Click on 'Update all' had the same behaviour.

I've returned to the command line and apt clearly listed the helpful error msg

# apt upgrade
Reading package lists... Done
...
99 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/76,0 MB of archives.
After this operation, 34,8 kB of additional disk space will be used.
Do you want to continue? [Y/n] y

** etckeeper detected uncommitted changes in /etc prior to apt run
** Aborting apt run. Manually commit and restart.

E: Problem executing scripts DPkg::Pre-Invoke 'if [ -x /usr/bin/etckeeper ]; then etckeeper pre-install; fi'
E: Sub-process returned an error code


Current behaviour: discover 'update all' seem to not do anything and offers 'update all' again and again.  Ignoring silently error(s?) from apt.

Expected: discover shows the user the error happen when apt complains loudly
Comment 1 Nate Graham 2018-06-27 17:17:56 UTC
> Expected: discover shows the user the error happen when apt complains loudly

...Preferably in a must-acknowledge-before-moving-on modal pop-up instead of an inline notification, which will disappear before people have read it and figured out what to do.
Comment 2 Aleix Pol 2018-07-02 13:08:14 UTC
Would it be possible to give me a way to reproduce this is issue?
It will be easier to come up with a fix this way.
Comment 3 Achim Bohnet 2018-07-02 15:06:50 UTC
On a debian based system:

# cat >/etc/apt/apt.conf.d/00-fail-on-preload <<EOT
#DPkg::Pre-Invoke       { "if [ -x /usr/bin/etckeeper ]; then etckeeper pre-install; fi"; };
#DPkg::Post-Invoke      { "if [ -x /usr/bin/etckeeper ]; then etckeeper post-install; fi"; };
DPkg::Pre-Invoke       { "false"; };
DPkg::Post-Invoke      { "false"; };
EOT

check that apt fails. E.g. with pkg plasma-desktop

# apt install --reinstall plasma-desktop
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 4 not upgraded.
Need to get 1.792 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://archive.neon.kde.org/user xenial/main amd64 plasma-desktop amd64 4:5.13.2-0neon+16.04+xenial+build97 [1.792 kB]
Fetched 1.792 kB in 0s (51,8 MB/s)       
E: Problem executing scripts DPkg::Pre-Invoke 'false'
E: Sub-process returned an error code
# echo $?
100

When apt return as in this case exit code of 100.  Try to use discover to upgrade/install .debs.  Nothing works and one sees no error msg.

Hope this helps,
Achim
Comment 4 Achim Bohnet 2018-07-02 15:14:37 UTC
On a debian based system:

# cat >/etc/apt/apt.conf.d/00-fail-on-preload <<EOT
#DPkg::Pre-Invoke       { "if [ -x /usr/bin/etckeeper ]; then etckeeper pre-install; fi"; };
#DPkg::Post-Invoke      { "if [ -x /usr/bin/etckeeper ]; then etckeeper post-install; fi"; };
DPkg::Pre-Invoke       { "false"; };
DPkg::Post-Invoke      { "false"; };
EOT

check that apt fails. E.g. with pkg plasma-desktop

# apt install --reinstall plasma-desktop
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 4 not upgraded.
Need to get 1.792 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://archive.neon.kde.org/user xenial/main amd64 plasma-desktop amd64 4:5.13.2-0neon+16.04+xenial+build97 [1.792 kB]
Fetched 1.792 kB in 0s (51,8 MB/s)       
E: Problem executing scripts DPkg::Pre-Invoke 'false'
E: Sub-process returned an error code
# echo $?
100

When apt return as in this case exit code of 100.  Try to use discover to upgrade/install .debs.  Nothing works and one sees no error msg.

Hope this helps,
Achim
Comment 5 Achim Bohnet 2018-09-30 16:06:06 UTC
with 5.13.5: to reproduce:

# cat >/etc/apt/apt.conf.d/00-fail-on-preload <<EOT
DPkg::Pre-Invoke       { "false"; };
DPkg::Post-Invoke      { "false"; };
EOT


# apt upgrade -> fails

and discover 'Update all' shows no error message.  Looks like nothing happens.
Hope this helps,
Achim
Comment 6 Aleix Pol 2018-10-01 13:40:15 UTC
Very good and accurate bug report, thank you very much Achim!

I confirmed it and reported it upstream:
https://github.com/hughsie/PackageKit/issues/281