Bug 1409362

Summary: [abrt] dnf: history.py:815:_commit:sqlite3.OperationalError: database is locked
Product: [Fedora] Fedora Reporter: Vít Ondruch <vondruch>
Component: dnfAssignee: rpm-software-management
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 26CC: packaging-team-maint, rpm-software-management, vmukhame, vondruch
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/a656336febdd57cbeaf8441b14bf8dfbca810c8d
Whiteboard: abrt_hash:4fb19b5c0e741d5ad8212d898fa4829985cc6feb;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-29 11:25:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: _var_log_dnf.log
none
File: backtrace
none
File: dnf-makecache.log
none
File: environ none

Description Vít Ondruch 2017-01-01 11:01:47 UTC
Version-Release number of selected component:
dnf-2.0.0-2.fc26

Additional info:
reporter:       libreport-2.9.0
cmdline:        /usr/libexec/system-python /bin/dnf remove winetricks
executable:     /bin/dnf
kernel:         4.9.0-1.fc26.x86_64
runlevel:       N 5
type:           Python3
uid:            0

Truncated backtrace:
history.py:815:_commit:sqlite3.OperationalError: database is locked

Traceback (most recent call last):
  File "/bin/dnf", line 58, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 175, in user_main
    errcode = main(args)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 61, in main
    return _main(base, args)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 99, in _main
    return cli_run(cli, base)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 123, in cli_run
    ret = resolving(cli, base)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 150, in resolving
    base.do_transaction(display=displays)
  File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 221, in do_transaction
    super(BaseCli, self).do_transaction(display)
  File "/usr/lib/python3.6/site-packages/dnf/base.py", line 662, in do_transaction
    self._run_transaction(cb=cb)
  File "/usr/lib/python3.6/site-packages/dnf/base.py", line 723, in _run_transaction
    [], [], cmdline)
  File "/usr/lib/python3.6/site-packages/dnf/yum/history.py", line 1009, in beg
    self._commit()
  File "/usr/lib/python3.6/site-packages/dnf/yum/history.py", line 815, in _commit
    return self._conn.commit()
sqlite3.OperationalError: database is locked

Local variables in innermost frame:
self: <dnf.yum.history.YumHistory object at 0x7fb4f6aed4a8>

Comment 1 Vít Ondruch 2017-01-01 11:01:53 UTC
Created attachment 1236369 [details]
File: _var_log_dnf.log

Comment 2 Vít Ondruch 2017-01-01 11:01:55 UTC
Created attachment 1236370 [details]
File: backtrace

Comment 3 Vít Ondruch 2017-01-01 11:02:11 UTC
Created attachment 1236371 [details]
File: dnf-makecache.log

Comment 4 Vít Ondruch 2017-01-01 11:02:12 UTC
Created attachment 1236372 [details]
File: environ

Comment 5 Igor Gnatenko 2017-01-02 08:18:34 UTC
How did you manage to break it? ;)

Comment 6 Vít Ondruch 2017-01-02 08:54:15 UTC
Actually, what I did is something like "dnf history info last | less" in one terminal and tried "dnf remove winetricks" in the other terminal. And there are 2 things:

1) If the database is locked, DNF should not backtrace but report this as error.

2) It is surprising the database was locked anyway. I would expect that the database is opened, read, closed and then the output is prepared. Actually I thought that the DNF should be already quit when the "less" displays the output.

Comment 7 Honza Silhan 2017-01-02 12:22:39 UTC
we can fix this. Maybe it could be improved in upcomming swdb (bug 1167239)

Comment 8 Fedora End Of Life 2017-02-28 10:51:51 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 9 Fedora End Of Life 2018-05-03 08:12:28 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. 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 Fedora  'version'
of '26'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 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, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 10 Fedora End Of Life 2018-05-29 11:25:58 UTC
Fedora 26 changed to end-of-life (EOL) status on 2018-05-29. Fedora 26
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 please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.