manatools / dnfdragora

dnfdragora is a dnf frontend based on libyui abstraction
GNU General Public License v3.0
137 stars 41 forks source link

dnfdragora-updater crashes with uncaught KeyError exception #149

Closed adatum closed 4 years ago

adatum commented 4 years ago

When dnfdragorais run, it freezes before finishing updating the caches. System logs and abrt-server (Problem Reporting) indicate:

python3: detected unhandled Python exception in '/usr/bin/dnfdragora-updater'
abrt-notification: Process 13229 (dnfdragora-updater) of user 1000 encountered an uncaught KeyError exception
ui.py:1650:_set_MD_cache_refreshed:KeyError: 'settings'

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/pystray/_base.py", line 236, in inner
    callback(self)
  File "/usr/lib/python3.8/site-packages/pystray/_base.py", line 320, in __call__
    return self._action(icon, self)
  File "/usr/lib/python3.8/site-packages/pystray/_base.py", line 414, in wrapper1
    return action(icon)
  File "/usr/lib/python3.8/site-packages/dnfdragora/updater.py", line 235, in __run_update
    return self.__run_dialog({'update_only': True})
  File "/usr/lib/python3.8/site-packages/dnfdragora/updater.py", line 211, in __run_dialog
    self.__main_gui.handleevent()
  File "/usr/lib/python3.8/site-packages/dnfdragora/ui.py", line 1401, in handleevent
    rebuild_package_list = self._manageDnfDaemonEvent()
  File "/usr/lib/python3.8/site-packages/dnfdragora/ui.py", line 1757, in _manageDnfDaemonEvent
    self._set_MD_cache_refreshed()
  File "/usr/lib/python3.8/site-packages/dnfdragora/ui.py", line 1650, in _set_MD_cache_refreshed
    self.config.userPreferences['settings']['metadata']['last_update'] = now_str
KeyError: 'settings'

Package: dnfdragora-updater-2.0.0-2.fc32 Interpreter: python3-3.8.2-2.fc32.x86_64 Kernel: 5.6.8-300.fc32.x86_64 OS release: Fedora release 32 (Thirty Two)

anaselli commented 4 years ago

Fixed in 2.0.2

fallenjuggler commented 4 years ago

Apologies if this is obvious or off point, but found this problem thread on encountering the same issue. This occurred for me when there was a user level override of dnfdragora settings in place. The work around was deleting ~/.config/dnfdragora.yaml to stop the hang. To avoid rebooting/relog, I had to kill both dnfdragora-updater and sudo kill dnfdaemon-system then re-launch dnfdragora-updater.

From a terminal: $ rm ~/.config/dnfdragora.yaml $ killall dnfdragora-updater $ sudo killall dnfdaemon-system $ dnfdragora-updater &

adatum commented 4 years ago

@fallenjuggler Thanks, your solution worked for me.

Plutonium5793 commented 4 years ago

worked for me also