Bug 1161036 - pk-offline-update reports success despite failed update
pk-offline-update reports success despite failed update
Status: RESOLVED NORESPONSE
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: GNOME
Current
Other Other
: P5 - None : Normal (vote)
: ---
Assigned To: Jonathan Kang
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-01-16 08:20 UTC by Martin Wilck
Modified: 2020-11-09 15:14 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---
songchuan.kang: needinfo? (martin.wilck)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Wilck 2020-01-16 08:20:14 UTC
End user experience:

 - Klick "restart and update" in GNOME Software
 - Confirm restart
 - System boots
 - After a few minutes, system boots again
 - Logging in and restarting GNOME softwrare, the same list of updates is displayed again, with the same "Restart and Update" button
 - This can be repeated

journalctl -b -1 shows this:

> Jan 16 08:37:49 apollon pk-offline-update[1406]: status wait
> Jan 16 08:37:49 apollon pk-offline-update[1406]: status setup
> Jan 16 08:37:52 apollon pk-offline-update[1406]: status finished
> Jan 16 08:37:52 apollon PackageKit[1449]: update-packages transaction /1_ebebddca from uid 0 finished with failed after 2901ms
> Jan 16 08:37:52 apollon pk-offline-update[1406]: writing failed results
> Jan 16 08:37:52 apollon pk-offline-update[1406]: failed to update system: There is no update candidate for post-build-checks-84.88+git>
> Jan 16 08:37:52 apollon systemd[1]: systemd-rfkill.service: Succeeded.
> Jan 16 08:38:02 apollon pk-offline-update[1406]: rebooting
> Jan 16 08:38:02 apollon pk-offline-update[1406]: sent mode to plymouth 'shutdown'
> Jan 16 08:38:02 apollon pk-offline-update[1406]: sent msg to plymouth 'Rebooting after installing updates…'
> Jan 16 08:38:02 apollon systemd[1]: packagekit-offline-update.service: Succeeded.
> Jan 16 08:38:02 apollon systemd[1]: Stopped Update the operating system whilst offline.

So, pk-offline-update returns Success status even though it failed to do the update. 

The actual update problem was due to a version "correction" in post-build-checks that would cause the package to be downgraded:

> ----------------------------------------------------------------------------
> r95 | dimstar_suse | 2020-01-10 16:47:24 | 7568a213422b18c1c6714e41fb98c0b2 | 84.87+git20200110.2d02f07 | rq762807
> 
> - Update to version 84.87+git20200110.2d02f07:
>   * Tweaks to make rpm-ndb build
>   * Detect name of coreutils package and don't remove it
> - restore correct version

installed version: 84.88+git20190716.5a0e034-1.1
candidate version: 84.87+git20200110.2d02f07-1.1

I have set "solver.dupAllowDowngrade = true" in zypp.conf.

If I run "zypper dup -D -y --details, I get this:

> ...
> The following package is going to be downgraded:
> post-build-checks
>  84.88+git20190716.5a0e034-1.1 -> 84.87+git20200110.2d02f07-1.1
>  noarch
>  openSUSE-Tumbleweed-Oss
>  openSUSE
> ...
> 544 packages to upgrade, 1 to downgrade, 10 new, 3 to remove, 1 to change arch.
> Overall download size: 0 B. Already cached: 913.1 MiB. After the operation, additional 281.8 MiB will be used.
> 
>    Note: System reboot required.
> Continue? [y/n/v/...? shows all options] (y): y
> 
> Checking for file conflicts: [...........done]

So, zypper handles this situation just fine, and finds no other conflicts.

Arguably the PackageKit zypp plugin should be able to deal with this rather trivial conflict automatically. But that's not my main point: The real problem is that the error didn't propagate to GNOME software, which thus offers the same update again and again, providing no clue to the end user that something went wrong, let alone what it was.
Comment 1 Martin Wilck 2020-01-16 09:25:16 UTC
Jonathan, adding you to cc, as you've been working on similar stuff lately.
Hack week perhaps?
Comment 2 Martin Wilck 2020-01-16 16:36:28 UTC
I should add that pk-offline-update apparently does create its status file 
"/var/lib/PackageKit/offline-update-competed".

> apollon:/etc/systemd/system # pkcon offline-status
> Status: Failed
> ErrorCode:failed-initialization
> ErrorDetails:librpmbuild8-4.14.2.1-9.2.x86_64 requires librpm.so.8()(64bit), > but this requirement cannot be provided

(note that this failure is from a different attempt than that described in comment 0. The solution "zypper dup" offers for this case is to remove librpmbuild8-4.14.2.1-9.2.x86_64.

However, the user isn't notified of this failure any way. There seems to be no service checking the contents of the "offline-update-competed" file.
Comment 3 Jonathan Kang 2020-03-06 07:00:57 UTC
Did you get any notification from GNOME Software saying that update failed? There
should be one from GNOME Software.
Comment 4 Jonathan Kang 2020-07-01 01:23:28 UTC
There were a few fixes related with this, both in gnome-software and PackageKit.
Please test if this is still valid.

Thanks.
Comment 5 Dominique Leuenberger 2020-11-09 15:14:41 UTC
(In reply to Jonathan Kang from comment #4)
> There were a few fixes related with this, both in gnome-software and
> PackageKit.
> Please test if this is still valid.

Closing for missing new tests after the mentioned changes by Jonathan.

If you can still reproduce the issue, please feel free to re-open it.