/usr/lib/cnf-update-db:sqlite3.OperationalError:/usr/lib/cnf-update-db@26:create
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
command-not-found (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Focal |
Fix Released
|
Medium
|
Unassigned |
Bug Description
[Impact]
The Ubuntu Error Tracker has been receiving reports about a problem regarding command-not-found. c-n-f- crashes when there are two parallel processes trying to update the tmpdb via its 'cnf-update-db' script. Only the first process can lock the sqlite3 database, the 2nd one will crash.
There is no impact on users, but we want to avoid the noise about those crashes in the Ubuntu Error Tracker.
This update ignores the update-db operation, if the database is already locked and logs a warning message.
[Test Case]
* Manually lock the database
* Run 'cnf-update-db'
* Verify it is not crashing
sudo cp /var/lib/
sudo sqlite3 /var/lib/
SQLite version 3.31.1 2020-01-27 19:55:54
Enter ".help" for usage hints.
sqlite> PRAGMA locking_mode = EXCLUSIVE;
exclusive
sqlite> BEGIN EXCLUSIVE;
sqlite>
sudo rm /var/lib/
sudo sudo /usr/lib/
echo $?
[Regression Potential]
This changes touches the 'cnf-update-db' script which creates or updates the sqlite database containing the mappings between executables and its corresponding packages. It it regresses the database might not be correctly updated anymore and thus users might not get proper package recommendations when they try to execute a non-installed application.
[Original Bug Description]
The Ubuntu Error Tracker has been receiving reports about a problem regarding command-not-found. This problem was most recently seen with package version 20.04.2, the problem page at https:/
If you do not have access to the Ubuntu Error Tracker and are a software developer, you can request it at http://
tags: | added: rls-ff-incoming |
tags: | added: groovy |
Changed in command-not-found (Ubuntu): | |
importance: | Undecided → Medium |
tags: | removed: rls-ff-incoming |
Changed in command-not-found (Ubuntu Focal): | |
status: | New → Triaged |
Changed in command-not-found (Ubuntu): | |
status: | New → Triaged |
Changed in command-not-found (Ubuntu Focal): | |
importance: | Undecided → Medium |
tags: | added: id-5ed914750353bc78c899460b |
Changed in command-not-found (Ubuntu): | |
status: | Triaged → Fix Committed |
Changed in command-not-found (Ubuntu Focal): | |
status: | Triaged → In Progress |
description: | updated |
imho we should be resilient.
Catch errors, ignore them, report success / skip, and ensure that ux is fine.
As a reproducer, one should be able to lock the db externally, run apt-update and see how it looks like.