Bug 1658091 - [abrt] dnf: __init__(): transaction.py:729:__init__:RuntimeError: Failed to open backup database: /var/lib/dnf/history/history-2016-11-15.sqlite-journal
Summary: [abrt] dnf: __init__(): transaction.py:729:__init__:RuntimeError: Failed to o...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 29
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:f03c016926d995b52f5dc86d7cb...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-11 08:48 UTC by geigor
Modified: 2019-08-31 01:38 UTC (History)
6 users (show)

Fixed In Version: dnf-4.2.5-4.fc29
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-31 01:38:30 UTC


Attachments (Terms of Use)
File: _var_log_dnf.log (4.84 MB, text/plain)
2018-12-11 08:48 UTC, geigor
no flags Details
File: backtrace (2.86 KB, text/plain)
2018-12-11 08:48 UTC, geigor
no flags Details
File: cgroup (345 bytes, text/plain)
2018-12-11 08:48 UTC, geigor
no flags Details
File: cpuinfo (1.16 KB, text/plain)
2018-12-11 08:48 UTC, geigor
no flags Details
File: dnf-makecache.log (129.63 KB, text/plain)
2018-12-11 08:48 UTC, geigor
no flags Details
File: environ (5.72 KB, text/plain)
2018-12-11 08:48 UTC, geigor
no flags Details
File: mountinfo (3.79 KB, text/plain)
2018-12-11 08:48 UTC, geigor
no flags Details
File: namespaces (129 bytes, text/plain)
2018-12-11 08:48 UTC, geigor
no flags Details
File: open_fds (2.65 KB, text/plain)
2018-12-11 08:48 UTC, geigor
no flags Details

Description geigor 2018-12-11 08:48:17 UTC
Description of problem:
same bug 1596540: dnf doesn't work for some missing table:
#
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 64, in main
    return _main(base, args, cli_class, option_parser_class)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 99, in _main
    return cli_run(cli, base)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 115, in cli_run
    cli.run()
  File "/usr/lib/python3.7/site-packages/dnf/cli/cli.py", line 1100, in run
    return self.command.run()
  File "/usr/lib/python3.7/site-packages/dnf/cli/commands/__init__.py", line 219, in run
    self.opts.packages)
  File "/usr/lib/python3.7/site-packages/dnf/cli/cli.py", line 477, in output_packages
    '=' : clir, 'not in' : clie})
  File "/usr/lib/python3.7/site-packages/dnf/cli/output.py", line 633, in listPkgs
    print(self.infoOutput(pkg, highlight=highlight) + "\n")
  File "/usr/lib/python3.7/site-packages/dnf/cli/output.py", line 504, in infoOutput
    history_repo = self.history.repo(pkg)
  File "/usr/lib/python3.7/site-packages/dnf/db/history.py", line 368, in repo
    return self.swdb.getRPMRepo(str(pkg))
  File "/usr/lib/python3.7/site-packages/dnf/db/history.py", line 291, in swdb
    self._swdb = libdnf.transaction.Swdb(self.dbpath)
  File "/usr/lib64/python3.7/site-packages/libdnf/transaction.py", line 729, in __init__
    this = _transaction.new_Swdb(*args)
RuntimeError: Failed to open backup database: /var/lib/dnf/history/history-2016-11-15.sqlite-journal

During handling of the above exception, another exception occurred:

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.7/site-packages/dnf/cli/main.py", line 179, in user_main
    errcode = main(args)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 64, in main
    return _main(base, args, cli_class, option_parser_class)
  File "/usr/lib/python3.7/site-packages/dnf/base.py", line 121, in __exit__
    self.close()
  File "/usr/lib/python3.7/site-packages/dnf/base.py", line 472, in close
    self._finalize_base()
  File "/usr/lib/python3.7/site-packages/dnf/base.py", line 455, in _finalize_base
    self.history.close()
  File "/usr/lib/python3.7/site-packages/dnf/db/history.py", line 305, in close
    self.swdb.closeTransaction()
  File "/usr/lib/python3.7/site-packages/dnf/db/history.py", line 291, in swdb
    self._swdb = libdnf.transaction.Swdb(self.dbpath)
  File "/usr/lib64/python3.7/site-packages/libdnf/transaction.py", line 729, in __init__
    this = _transaction.new_Swdb(*args)
RuntimeError: Failed to open backup database: /var/lib/dnf/history/history-2016-11-15.sqlite-journal

Version-Release number of selected component:
dnf-4.0.9-1.fc29

Additional info:
reporter:       libreport-2.9.6
cmdline:        /usr/bin/python3 /usr/bin/dnf info dnf
crash_function: __init__
exception_type: RuntimeError
executable:     /usr/bin/dnf
interpreter:    python3-3.7.1-4.fc29.x86_64
kernel:         4.19.6-300.fc29.x86_64
runlevel:       N 5
type:           Python3
uid:            1000

Truncated backtrace:
transaction.py:729:__init__:RuntimeError: Failed to open backup database: /var/lib/dnf/history/history-2016-11-15.sqlite-journal

Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 64, in main
    return _main(base, args, cli_class, option_parser_class)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 99, in _main
    return cli_run(cli, base)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 115, in cli_run
    cli.run()
  File "/usr/lib/python3.7/site-packages/dnf/cli/cli.py", line 1100, in run
    return self.command.run()
  File "/usr/lib/python3.7/site-packages/dnf/cli/commands/__init__.py", line 219, in run
    self.opts.packages)
  File "/usr/lib/python3.7/site-packages/dnf/cli/cli.py", line 477, in output_packages
    '=' : clir, 'not in' : clie})
  File "/usr/lib/python3.7/site-packages/dnf/cli/output.py", line 633, in listPkgs
    print(self.infoOutput(pkg, highlight=highlight) + "\n")
  File "/usr/lib/python3.7/site-packages/dnf/cli/output.py", line 504, in infoOutput
    history_repo = self.history.repo(pkg)
  File "/usr/lib/python3.7/site-packages/dnf/db/history.py", line 368, in repo
    return self.swdb.getRPMRepo(str(pkg))
  File "/usr/lib/python3.7/site-packages/dnf/db/history.py", line 291, in swdb
    self._swdb = libdnf.transaction.Swdb(self.dbpath)
  File "/usr/lib64/python3.7/site-packages/libdnf/transaction.py", line 729, in __init__
    this = _transaction.new_Swdb(*args)
RuntimeError: Failed to open backup database: /var/lib/dnf/history/history-2016-11-15.sqlite-journal

During handling of the above exception, another exception occurred:

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.7/site-packages/dnf/cli/main.py", line 179, in user_main
    errcode = main(args)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 64, in main
    return _main(base, args, cli_class, option_parser_class)
  File "/usr/lib/python3.7/site-packages/dnf/base.py", line 121, in __exit__
    self.close()
  File "/usr/lib/python3.7/site-packages/dnf/base.py", line 472, in close
    self._finalize_base()
  File "/usr/lib/python3.7/site-packages/dnf/base.py", line 455, in _finalize_base
    self.history.close()
  File "/usr/lib/python3.7/site-packages/dnf/db/history.py", line 305, in close
    self.swdb.closeTransaction()
  File "/usr/lib/python3.7/site-packages/dnf/db/history.py", line 291, in swdb
    self._swdb = libdnf.transaction.Swdb(self.dbpath)
  File "/usr/lib64/python3.7/site-packages/libdnf/transaction.py", line 729, in __init__
    this = _transaction.new_Swdb(*args)
RuntimeError: Failed to open backup database: /var/lib/dnf/history/history-2016-11-15.sqlite-journal

Local variables in innermost frame:
self: <libdnf.transaction.Swdb;  >
args: ('/var/lib/dnf/history.sqlite',)

Comment 1 geigor 2018-12-11 08:48:36 UTC
Created attachment 1513280 [details]
File: _var_log_dnf.log

Comment 2 geigor 2018-12-11 08:48:38 UTC
Created attachment 1513281 [details]
File: backtrace

Comment 3 geigor 2018-12-11 08:48:39 UTC
Created attachment 1513282 [details]
File: cgroup

Comment 4 geigor 2018-12-11 08:48:40 UTC
Created attachment 1513283 [details]
File: cpuinfo

Comment 5 geigor 2018-12-11 08:48:42 UTC
Created attachment 1513284 [details]
File: dnf-makecache.log

Comment 6 geigor 2018-12-11 08:48:44 UTC
Created attachment 1513285 [details]
File: environ

Comment 7 geigor 2018-12-11 08:48:45 UTC
Created attachment 1513286 [details]
File: mountinfo

Comment 8 geigor 2018-12-11 08:48:46 UTC
Created attachment 1513287 [details]
File: namespaces

Comment 9 geigor 2018-12-11 08:48:47 UTC
Created attachment 1513288 [details]
File: open_fds

Comment 10 Daniel Mach 2019-06-02 04:44:31 UTC
I believe following PR fixes the problem:
https://github.com/rpm-software-management/libdnf/pull/695

The root cause was that the file names were matched incorrectly and journal file was passed instead of database.

Comment 11 Fedora Update System 2019-08-14 07:23:44 UTC
FEDORA-2019-d4b6ede072 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-d4b6ede072

Comment 12 Fedora Update System 2019-08-16 20:12:09 UTC
dnf-4.2.5-4.fc29, dnf-plugins-extras-4.0.4-2.fc29, libdnf-0.31.0-6.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-d4b6ede072

Comment 13 Fedora Update System 2019-08-31 01:38:30 UTC
dnf-4.2.5-4.fc29, dnf-plugins-extras-4.0.4-2.fc29, libdnf-0.31.0-6.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.