Bug 1701807 - dnf ignores exception error raised by plugin etckeeper-dnf
Summary: dnf ignores exception error raised by plugin etckeeper-dnf
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 29
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-04-22 03:05 UTC by Alick Zhao
Modified: 2019-04-29 02:15 UTC (History)
9 users (show)

Fixed In Version: dnf-4.2.5-1.fc29
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-04-29 02:15:04 UTC
Type: Bug


Attachments (Terms of Use)

Description Alick Zhao 2019-04-22 03:05:50 UTC
Description of problem:

This bug is about the interplay between dnf and etckeeper (more specifically the etckeeper-dnf package). etckeeper has an option that, when enabled, aborts a 'dnf upgrade/install' operation when etckeeper detects there are uncommitted changes under /etc. This used to work fine, but now on Fedora 29, after etckeeper raises an error, dnf continues upgrading/installing packages, instead of aborting and letting the user 'etckeeper commit' first.

Version-Release number of selected component (if applicable):

dnf-4.2.2-2.fc29
etckeeper-dnf-1.18.8-1.fc29
etckeeper-1.18.8-1.fc29

How reproducible:
Always

Steps to Reproduce:
1. In `/etc/etckeeper/etckeeper.conf`, uncomment `AVOID_COMMIT_BEFORE_INSTALL=1`
2. sudo dnf upgrade

Actual results:

$ sudo dnf upgrade                                                                                                                                                                     
Last metadata expiration check: 0:24:00 ago on Sun 21 Apr 2019 09:09:27 PM CDT.                                                                                                        
                                                                                                                                                                                       
** etckeeper detected uncommitted changes in /etc prior to dnf run                                                                                                                     
** Aborting dnf run. Manually commit and restart.                                                                                                                                      
                                                                                                                                                                                       
Traceback (most recent call last):                                                                                                                                                     
  File "/usr/lib/python3.7/site-packages/dnf/plugin.py", line 104, in _caller                                                                                                          
    getattr(plugin, method)()                                                                                                                                                          
  File "/usr/lib/python3.7/site-packages/dnf-plugins/etckeeper.py", line 28, in resolved                                                                                               
    raise dnf.exceptions.Error('etckeeper returned %d' % (ret >> 8))                                                                                                                   
dnf.exceptions.Error: etckeeper returned 1                                                                                                                                             
                                                                                                                                                                                       
Dependencies resolved.                                                                                                                                                                 
=======================================================================================================================================================================================
 Package                                             Architecture               Version                                            Repository                                     Size 
=======================================================================================================================================================================================
Installing:                                                                                                                                                                            
 kernel                                              x86_64                     5.0.7-200.fc29                                     updates                                        30 k 
 kernel-core                                         x86_64                     5.0.7-200.fc29                                     updates                                        26 M 
...


Expected results:

dnf aborts upon etckeeper returned 1

Additional info:
None.

Comment 1 Jaroslav Mracek 2019-04-23 10:19:39 UTC
I created a patch that runs plugins safely, but in case that plugin raises dnf.exceptions, it allows termination (https://github.com/rpm-software-management/dnf/pull/1383).

Comment 2 Fedora Update System 2019-04-25 16:43:26 UTC
dnf-4.2.5-1.fc29 libdnf-0.31.0-2.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-2612a121ba

Comment 3 Fedora Update System 2019-04-26 22:10:06 UTC
dnf-4.2.5-1.fc29, libdnf-0.31.0-2.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-2612a121ba

Comment 4 Fedora Update System 2019-04-29 02:15:04 UTC
dnf-4.2.5-1.fc29, libdnf-0.31.0-2.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.


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