Bug 2273749 - DNF5 system-upgrade f39 to f40 results in half upgraded system which doesn't work
Summary: DNF5 system-upgrade f39 to f40 results in half upgraded system which doesn't ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf5
Version: rawhide
Hardware: All
OS: Linux
high
urgent
Target Milestone: ---
Assignee: amatej
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-04-06 03:15 UTC by Gerald Cox
Modified: 2025-03-20 10:56 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-11-29 19:28:57 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
dnf5 log4 (1023.90 KB, text/plain)
2024-04-06 17:40 UTC, Gerald Cox
no flags Details
dnf5.log.3 (1023.95 KB, text/plain)
2024-04-06 17:41 UTC, Gerald Cox
no flags Details
dnf5.log.2 (1023.84 KB, text/plain)
2024-04-06 17:41 UTC, Gerald Cox
no flags Details
dnf5.log.1 (1023.94 KB, text/plain)
2024-04-06 17:42 UTC, Gerald Cox
no flags Details
dnf5.log (999.70 KB, text/plain)
2024-04-06 17:43 UTC, Gerald Cox
no flags Details
output from dnf5 system-upgrade (304.69 KB, image/png)
2024-04-07 13:59 UTC, Gerald Cox
no flags Details
dependency error (8.73 KB, image/png)
2024-04-07 14:02 UTC, Gerald Cox
no flags Details
tail of dnf5 upgrade command (42.12 KB, image/png)
2024-04-07 14:04 UTC, Gerald Cox
no flags Details
dnf4 system_upgrade aborts correctly upon error detection (283.85 KB, image/png)
2024-04-07 17:08 UTC, Gerald Cox
no flags Details
Tested with 5.1.17-20240410004756.25.gd77b59e0 (295.58 KB, image/png)
2024-04-10 02:45 UTC, Gerald Cox
no flags Details

Description Gerald Cox 2024-04-06 03:15:16 UTC
I created a discussion item here:
https://discussion.fedoraproject.org/t/sddm-gdm-fail-after-upgrading-via-dnf-from-f39-to-f40/111949

I used dnf5 for the system upgrade, the transaction check passed.  The system then asked if I wanted to continue, I replied "Y", then returned about 90 minutes later.  I found a rebooted system with a black screen (using SDDM/Plasma6). 

I then switched to GDM thinking it was a SDDM issue, and this time I got the screen that says something like contact your system admin, a serious problem has been encountered.

I then though to dnf5 upgrade to see if I had missed any updates and found that kdecoration was still on the F39 version because bismuth needed the F39 version, so it didn't upgrade to F40.  The F40 version of bismuth failed in koji.  Since kdecoration was still on F39 that set up a cascade of upgrade failures with both KDE and GNOME programs.  

To resolve, I simply removed bismuth, which allow kdecoration and about 1000 other programs to upgrade.

This doesn't seem right to me.  I would think that at a minimum the initial transaction check should have failed.  Instead it basically allow a half upgraded system to be installed.  

Reproducible: Always

Steps to Reproduce:
1.See above details.
2.
3.
Actual Results:  
Half upgraded system allowed to boot.

Expected Results:  
Transaction check should have failed and the upgrade aborted.

I ran this with DNF5, I'm not sure if this problem also exists in DNF4.  I've never before encountered anything like it.

Comment 1 Adam Williamson 2024-04-06 16:20:28 UTC
Can you say exactly how you ran the update? Like, literally what command did you run? Can you attach /var/log/dnf5.log ? Thanks!

Comment 2 Gerald Cox 2024-04-06 17:40:01 UTC
Created attachment 2025583 [details]
dnf5 log4

The timestamp indicates this was the get F39 current to be upgraded

Comment 3 Gerald Cox 2024-04-06 17:41:10 UTC
Created attachment 2025584 [details]
dnf5.log.3

This should be the upgrade.

Comment 4 Gerald Cox 2024-04-06 17:41:50 UTC
Created attachment 2025585 [details]
dnf5.log.2

Comment 5 Gerald Cox 2024-04-06 17:42:23 UTC
Created attachment 2025586 [details]
dnf5.log.1

Comment 6 Gerald Cox 2024-04-06 17:43:16 UTC
Created attachment 2025587 [details]
dnf5.log

Comment 7 Gerald Cox 2024-04-06 17:45:46 UTC
The command I used was:
dnf5 system-upgrade download --releasever=40

Let me know any additional information I can provide.
Thanks!

Comment 8 Gerald Cox 2024-04-06 17:58:01 UTC
Forgot to add the second command to start the transaction:
dnf5 offline reboot

then to fix I entered:
dnf5 remove bismuth
dnf5 upgrade
reboot

Comment 9 Gerald Cox 2024-04-07 13:57:24 UTC
I was able to recreate in a virtual machine.  There is definitely an issue and it's reproducible.

Comment 10 Gerald Cox 2024-04-07 13:59:57 UTC
Created attachment 2025667 [details]
output from dnf5 system-upgrade

Shows transaction check apparently completed with no errors, which isn't true.  We know there is a dependency error.

Comment 11 Gerald Cox 2024-04-07 14:02:04 UTC
Created attachment 2025668 [details]
dependency error

After upgrade is complete, system black screen due to incomplete upgrade.  dnf5 shows dependency error.

Comment 12 Gerald Cox 2024-04-07 14:04:48 UTC
Created attachment 2025669 [details]
tail of dnf5 upgrade command

Tail of packages to be upgraded after I manually removed bismuth.f39

Comment 13 Gerald Cox 2024-04-07 17:08:47 UTC
Created attachment 2025685 [details]
dnf4 system_upgrade aborts correctly upon error detection

I've tested with DNF4 and as you can see, the dependency issue is correctly detected and the system upgrade is aborted.

If this isn't a simple fix, I would suggest you remove access to dnf5 system upgrade until this can be resolved, or at a minimum broadcast out a warning.

Comment 14 amatej 2024-04-09 08:14:11 UTC
Thank you for the report and investigation!

It really should be resolved ASAP.

I have created a PR with a proposed fix: https://github.com/rpm-software-management/dnf5/pull/1391 and a PR with a test: https://github.com/rpm-software-management/ci-dnf-stack/pull/1482

It turned out this is a more general issue with distro-sync functionality. The dependency error is printed to stderr but right at the start of the output and since system-upgrade output is big it is immediately buried. However the transaction shouldn't proceed anyway (like with dnf4).

Comment 15 Gerald Cox 2024-04-09 14:16:40 UTC
@amatej Thanks for the quick resolution.  I'll test again the change becomes available in test repo.  
Much appreciated!

Comment 16 Gerald Cox 2024-04-10 02:45:33 UTC
Created attachment 2026039 [details]
Tested with 5.1.17-20240410004756.25.gd77b59e0

Tested on a VM with the COPR version 5.1.17-20240410004756.25.gd77b59e0
Looks good!  Thanks so much for the quick response.  Much appreciated!


Note You need to log in before you can comment on or make changes to this bug.