Bug 1266103 - [abrt] dnf: sqlutils.py:167:executeSQLQmark:sqlite3.OperationalError: database is locked
Summary: [abrt] dnf: sqlutils.py:167:executeSQLQmark:sqlite3.OperationalError: databas...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 28
Hardware: x86_64
OS: Unspecified
low
unspecified
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:4cf5bfcc8233f59fa324e710006...
: 1313570 1402498 1413818 1483232 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-24 13:20 UTC by Christian Stadelmann
Modified: 2019-03-02 15:16 UTC (History)
21 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2019-03-02 15:16:39 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: backtrace (1.91 KB, text/plain)
2015-09-24 13:20 UTC, Christian Stadelmann
no flags Details

Description Christian Stadelmann 2015-09-24 13:20:22 UTC
Version-Release number of selected component:
dnf-1.1.0-2.fc23

Additional info:
reporter:       libreport-2.6.2
cmdline:        /usr/bin/python3 -OO /usr/bin/dnf history
executable:     /usr/bin/dnf
kernel:         4.2.1-300.fc23.x86_64
runlevel:       N 5
type:           Python3

Truncated backtrace:
sqlutils.py:167:executeSQLQmark:sqlite3.OperationalError: database is locked

Traceback (most recent call last):
  File "/usr/bin/dnf", line 35, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 193, in user_main
    errcode = main(args)
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 84, in main
    return _main(base, args)
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 139, in _main
    cli.run()
  File "/usr/lib/python3.4/site-packages/dnf/cli/cli.py", line 1083, in run
    return self.command.run(self.base.extcmds)
  File "/usr/lib/python3.4/site-packages/dnf/cli/commands/__init__.py", line 1215, in run
    ret = self.output.historyListCmd(extcmds)
  File "/usr/lib/python3.4/site-packages/dnf/cli/output.py", line 1381, in historyListCmd
    tids = self._history_list_transactions(extcmds)
  File "/usr/lib/python3.4/site-packages/dnf/cli/output.py", line 1343, in _history_list_transactions
    old = self.history.last()
  File "/usr/lib/python3.4/site-packages/dnf/yum/history.py", line 1329, in last
    ret = self.old([], 1, complete_transactions_only)
  File "/usr/lib/python3.4/site-packages/dnf/yum/history.py", line 1278, in old
    executeSQL(cur, sql, params)
  File "/usr/lib/python3.4/site-packages/dnf/yum/sqlutils.py", line 167, in executeSQLQmark
    return cursor.execute(query)
sqlite3.OperationalError: database is locked

Local variables in innermost frame:
cursor: <sqlite3.Cursor object at 0x7f57617ee0a0>
params: None
query: 'SELECT tid,\n                         trans_beg.timestamp AS beg_ts,\n                         trans_beg.rpmdb_version AS beg_rv,\n                         trans_end.timestamp AS end_ts,\n                         trans_end.rpmdb_version AS end_rv,\n                         loginuid, return_code\n                  FROM trans_beg JOIN trans_end USING(tid) ORDER BY tid DESC LIMIT 1'

Comment 1 Christian Stadelmann 2015-09-24 13:20:27 UTC
Created attachment 1076547 [details]
File: backtrace

Comment 2 Honza Silhan 2015-10-02 09:52:47 UTC
Can you reproduce it anytime? Does it work when you run other dnf commands like "install", "remove", etc.?

Comment 3 Christian Stadelmann 2015-10-02 10:53:09 UTC
No, only reproducible with the dnf history command (but no excessive testing done). And it isn't reliably reproducible. E.g. now `dnf-3 history` works fine, but `dnf-3 history dnf` failed (same backtrace as above). `dnf-3 history kernel` showed about a hundred lines before crashing.

Note that yum was never installed on this system. PackageKit wasn't used on this system. I only use dnf (or dnf-3) and yumex-dnf.

I don't know anything about how dnf works internally, but this might be a result of the broken (obsoleted) update to 

    dnf-plugins-core-0.1.12-2.fc23
    dnf-1.1.2-2.fc23
    hawkey-0.6.1-1.fc23

(see https://bodhi.fedoraproject.org/updates/FEDORA-2015-16428 ). I had that installed for a short time until I noticed that it is broken. And that was the day before I noticed dnf is throwing these backtraces.

If you need me to test something specific, please provide a specific test case etc.

Comment 4 Honza Silhan 2015-10-21 12:48:33 UTC

*** This bug has been marked as a duplicate of bug 1198998 ***

Comment 5 Christian Stadelmann 2015-12-02 12:41:25 UTC
Reopening since this issue is still present on F23 and bug #11998998 was closed.

Comment 6 Jan Kurik 2016-02-24 13:47:24 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase

Comment 7 Michal Domonkos 2016-03-07 13:55:43 UTC
*** Bug 1313570 has been marked as a duplicate of this bug. ***

Comment 8 Christian Stadelmann 2016-05-12 07:32:24 UTC
Similar problem has been detected:

I tried to do a dnf downgrade while yumex-dnf was running.

reporter:       libreport-2.7.0
cmdline:        /usr/bin/python3 /usr/bin/dnf downgrade --allowerasing glibc
event_log:      2016-05-12-09:28:20> (»report_uReport« erfolgreich abgeschlossen)
executable:     /usr/bin/dnf
kernel:         4.5.3-300.fc24.x86_64
package:        dnf-1.1.8-1.fc24
pkg_fingerprint: 73BD E983 81B4 6521
pkg_vendor:     Fedora Project
reason:         sqlutils.py:167:executeSQLQmark:sqlite3.OperationalError: database is locked
reproducible:   Not sure how to reproduce the problem
runlevel:       N 5
type:           Python3

Comment 9 Christian Stadelmann 2016-05-12 07:33:27 UTC
Steps to reproduce:
1. start yumex-dnf and open history
2. try to run any dnf transaction

Comment 10 Fedora Admin XMLRPC Client 2016-07-08 09:32:05 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 11 Igor Gnatenko 2016-12-12 12:16:47 UTC
*** Bug 1402498 has been marked as a duplicate of this bug. ***

Comment 12 Christian Stadelmann 2016-12-31 00:09:38 UTC
Similar problem has been detected:

Steps to reproduce:
1. run dnf, preferably with the "rpmconf" plugin.
2. pause dnf, in my case during rpmconf plugin code by pressing Ctrl+Z
3. while dnf is paused, run `dnf history info last`

reporter:       libreport-2.8.0
cmdline:        /usr/libexec/system-python /usr/bin/dnf history info last
event_log:      2016-12-31-01:08:06> (»report_uReport« erfolgreich abgeschlossen)
executable:     /usr/bin/dnf
kernel:         4.8.14-300.fc25.x86_64
package:        dnf-1.1.10-4.fc25
pkg_fingerprint: 4089 D8F2 FDB1 9C98
pkg_vendor:     Fedora Project
reason:         sqlutils.py:167:executeSQLQmark:sqlite3.OperationalError: database is locked
runlevel:       N 5
type:           Python3

Comment 13 Simone Fittabile 2017-01-17 03:00:47 UTC
*** Bug 1413818 has been marked as a duplicate of this bug. ***

Comment 14 Fedora End Of Life 2017-07-25 19:18:53 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. 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 '24'.

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 24 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 15 Christian Stadelmann 2017-08-19 12:41:31 UTC
This issue not only happens when the database is broken, but also happens sometimes when two instances of dnf are running at the same time.

Comment 16 Christian Stadelmann 2017-08-19 12:41:52 UTC
*** Bug 1483232 has been marked as a duplicate of this bug. ***

Comment 17 Wallace Hermano 2017-12-13 23:48:16 UTC
Similar problem has been detected:

just run #dnf clean all and #dnf -v -y update
 output

Dependencies resolved.
===================================================================================================================================================================================================================
 Package                                                  Arch                                     Version                                          Repository                                                Size
===================================================================================================================================================================================================================
Upgrading:
 google-chrome-unstable                                   x86_64                                   64.0.3282.24-1                                   google-chrome-unstable                                    50 M

Transaction Summary
===================================================================================================================================================================================================================
Upgrade  1 Package

Total download size: 50 M
Downloading Packages:
google-chrome-unstable-64.0.3282.24-1.x86_64.rpm                                                                                                                                   3.7 MB/s |  50 MB     00:13    
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                              3.7 MB/s |  50 MB     00:13     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
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.6/site-packages/dnf/cli/main.py", line 179, in user_main
    errcode = main(args)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 64, in main
    return _main(base, args, cli_class, option_parser_class)
  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 154, in resolving
    base.do_transaction(display=displays)
  File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 238, in do_transaction
    super(BaseCli, self).do_transaction(display)
  File "/usr/lib/python3.6/site-packages/dnf/base.py", line 781, in do_transaction
    self._run_transaction(cb=cb)
  File "/usr/lib/python3.6/site-packages/dnf/base.py", line 829, in _run_transaction
    lastdbv = self.history.last()
  File "/usr/lib/python3.6/site-packages/dnf/yum/history.py", line 1313, in last
    ret = self.old([], 1, complete_transactions_only)
  File "/usr/lib/python3.6/site-packages/dnf/yum/history.py", line 1262, in old
    executeSQL(cur, sql, params)
  File "/usr/lib/python3.6/site-packages/dnf/yum/sqlutils.py", line 167, in executeSQLQmark
    return cursor.execute(query)
sqlite3.OperationalError: database is locked
root@jupiter wallace]#

reporter:       libreport-2.9.1
cmdline:        /usr/libexec/system-python /usr/bin/dnf -v -y update
crash_function: executeSQLQmark
exception_type: sqlite3.OperationalError
executable:     /usr/bin/dnf
kernel:         4.13.16-202.fc26.x86_64
package:        dnf-2.7.5-2.fc26
reason:         sqlutils.py:167:executeSQLQmark:sqlite3.OperationalError: database is locked
runlevel:       N 5
type:           Python3
uid:            0

Comment 18 Fedora End Of Life 2018-05-03 08:47:24 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 19 udo 2018-05-25 10:03:47 UTC
I experienced this problem with Fedora 28.

Comment 20 Hedayat Vatankhah 2018-08-27 07:57:47 UTC
I'm experiencing it with RPMFusions akmods kernel posttrans script:

2018/08/26 03:26:48 akmods: Installing newly built rpms
2018/08/26 03:26:48 akmods: DNF detected
Dependencies resolved.
================================================================================
 Package                             Arch   Version          Repository    Size
================================================================================
Installing:
 kmod-nvidia-340xx-4.17.17-200.fc28.x86_64
                                     x86_64 1:340.107-2.fc28 @commandline 3.8 M

Transaction Summary
================================================================================
Install  1 Package

Total size: 3.8 M
Installed size: 14 M
Downloading Packages:
Running transaction check
Waiting for process with pid 20686 to finish.
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
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 179, in user_main
    errcode = main(args)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 64, in main
    return _main(base, args, cli_class, option_parser_class)
  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 154, in resolving
    base.do_transaction(display=displays)
  File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 239, in do_transaction
    super(BaseCli, self).do_transaction(display)
  File "/usr/lib/python3.6/site-packages/dnf/base.py", line 905, in do_transaction
    self._run_transaction(cb=cb)
  File "/usr/lib/python3.6/site-packages/dnf/base.py", line 956, in _run_transaction
    lastdbv = self.history.last()
  File "/usr/lib/python3.6/site-packages/dnf/yum/history.py", line 1313, in last
    ret = self.old([], 1, complete_transactions_only)
  File "/usr/lib/python3.6/site-packages/dnf/yum/history.py", line 1262, in old
    executeSQL(cur, sql, params)
  File "/usr/lib/python3.6/site-packages/dnf/yum/sqlutils.py", line 167, in executeSQLQmark
    return cursor.execute(query)
sqlite3.OperationalError: database is locked

Comment 21 Daniel Mach 2019-03-02 15:16:39 UTC
DNF history code was rewritten in Fedora 29 and yum/sqlutils.py was removed.
Please upgrade your system to Fedora 29.


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