command-not-found crashed: unable to open database file

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

Bug Description

抱歉,command-not-found 崩溃了!请在以下地址报告错误:
https://bugs.launchpad.net/command-not-found/+filebug
请在报告中包含以下信息:

command-not-found 版本:0.3
Python 版本:3.8.10 final 0
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal
额外信息:

unable to open database file
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 90, in main
    cnf = CommandNotFound.CommandNotFound(options.data_dir)
  File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 79, in __init__
    self.db = SqliteDatabase(dbpath)
  File "/usr/lib/python3/dist-packages/CommandNotFound/db/db.py", line 12, in __init__
    self.con = sqlite3.connect(filename)
sqlite3.OperationalError: unable to open database file

Revision history for this message
TianKun (newphp) wrote :

I have fixed this problem with the following command.

sudo chmod o+r /var/lib/command-not-found/commands.db

The problem is caused by "UMASK 027" and "USERGROUPS_ENAB no" in /etc/login.defs, after apt dist-upgrade, the permission of /var/lib/command-not-found/commands.db was changed from 0644 to 0640

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.