Fedora Account System
Red Hat Associate
Red Hat Customer
Description of problem: Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. I/O busy causes system is sluggishness 2. dnf install -y package 3. ctrl+ c Actual results: Sometimes: Traceback (most recent call last): File "/usr/bin/dnf", line 58, in <module> main.user_main(sys.argv[1:], exit_code=True) File "/usr/lib/python3.9/site-packages/dnf/cli/main.py", line 201, in user_main errcode = main(args) File "/usr/lib/python3.9/site-packages/dnf/cli/main.py", line 66, in main with dnf.cli.cli.BaseCli(conf_class()) as base: File "/usr/lib/python3.9/site-packages/dnf/conf/config.py", line 228, in __init__ config = libdnf.conf.ConfigMain() File "/usr/lib64/python3.9/site-packages/libdnf/conf.py", line 1122, in __init__ _conf.ConfigMain_swiginit(self, _conf.new_ConfigMain()) RuntimeError: SWIG director method error. Error detected when calling 'Logger.write' Exception ignored in: <function MainConf.__del__ at 0x7f2b9f882430> Traceback (most recent call last): File "/usr/lib/python3.9/site-packages/dnf/conf/config.py", line 261, in __del__ for file_name in self.tempfiles: File "/usr/lib/python3.9/site-packages/dnf/conf/config.py", line 66, in __getattr__ raise AttributeError("'{}' object has no attribute '{}'".format(self.__class__, name)) AttributeError: '<class 'dnf.conf.config.MainConf'>' object has no attribute 'tempfiles' Expected results: no AttributeError Additional info: I think that the reason of AttributeError is dnf.conf.config.MainConf is not initialized yet cause by 'ctrl + c' when the system is busy. Possible Solutions:Add attribute judgment before self use 'tempfiles' in dnf/conf/config.py PR:https://github.com/rpm-software-management/dnf/pull/1899
PR is merged:https://github.com/rpm-software-management/dnf/pull/1899
AttributeError has been resolved. Unfortunately, RuntimeError still exists.
Do you think 'RuntimeError' is a problem. @mblaha
The problem here is here: File "/usr/lib/python3.9/site-packages/dnf/cli/main.py", line 66, in main with dnf.cli.cli.BaseCli(conf_class()) as base: When instantiating the conf (conf_class()) the Runtime exception was raised. But this type of exception is not caught in the try / except block here, so it propagates all the way up and eventually the user sees the traceback. Python has this quirky behavior that `__del__()` is being called on the object even though the call of `__init__()` of the same object had failed (thus object is not correctly constructed). This might very easily result in the AttributeError you were originally dealing with.
Thank you for your reply. I agree with you. Not only dnf, but also other python packages have traceback(e.g., iotop, firewalld) Different Python packages have different tracebacks.
This message is a reminder that Fedora Linux 37 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora Linux 37 on 2023-12-05. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of '37'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, change the 'version' to a later Fedora Linux version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see it. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora Linux 37 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora Linux, you are encouraged to change the 'version' to a later version prior to this bug being closed.
Fedora Linux 37 entered end-of-life (EOL) status on 2023-12-05. Fedora Linux 37 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora Linux please feel free to reopen this bug against that version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see the version field. If you are unable to reopen this bug, please file a new report against an active release. Thank you for reporting this bug and we are sorry it could not be fixed.