command-not-found is crashing on a more or less brandnew install

Bug #1929797 reported by Can Baysal
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
command-not-found
New
Undecided
Unassigned

Bug Description

I was testing some software on a raspberry pi 3. For test purposes I installed ubuntu-20.04.2-preinstalled-server-arm64+raspi.img performed full update, installed gcc and friends Then for debugging of network connection I needed netstat which was not installed. Instead of usual package suggestion I got below message. I do not know what corrupted the database, or when that happen. This was my first non existent command on this particular install, so I do not know if it was corrupt to begin with or corrupted in the last 12 hours or so the device was running.

command-not-found version: 0.3
Python version: 3.8.5 final 0
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal
Exception information:

database disk image is malformed
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/CommandNotFound/util.py", line 23, in crash_guard
    callback()
  File "/usr/lib/command-not-found", line 95, in main
    if not cnf.advise(args[0], options.ignore_installed) and not options.no_failure_msg:
  File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 363, in advise
    packages = self.get_packages(command)
  File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 97, in get_packages
    return self.db.lookup(command)
  File "/usr/lib/python3/dist-packages/CommandNotFound/db/db.py", line 19, in lookup
    for row in self.con.execute(
sqlite3.DatabaseError: database disk image is malformed

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.