View Issue Details

IDProjectCategoryView StatusLast Update
0007075Kali Linux[All Projects] Kali Package Bugpublic2021-03-02 16:41
Reportercatmandx Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version2021.1 
Target VersionFixed in Version 
Summary0007075: command-not-found cannot open it's sqlite db file
DescriptionWhen using non-root accounts, the package command-not-found cannot open its db file (presumably to write something to it)

The db file has permission of 644 with owner root/root:
┌──(kali㉿kali)-[/usr/share/wordlists]
└─$ ls /usr/share/command-not-found/CommandNotFound/db/db.py -al
-rw-r--r-- 1 root root 868 Jun 1 2020 /usr/share/command-not-found/CommandNotFound/db/db.py
Steps To Reproduce1. Use a non-root account
2. type in gitleakss or some command that doesn't exist in your machine but does in the kali repo
Additional InformationOutput:
┌──(kali㉿kali)-[/usr/share/wordlists]
└─$ gitleakss 127 ⨯
Sorry, command-not-found has crashed! Please file a bug report at:
http://www.debian.org/Bugs/Reporting
Please include the following information with the report:

command-not-found version: 0.3
Python version: 3.9.1 final 0
Distributor ID: Kali
Description: Kali GNU/Linux Rolling
Release: 2021.1
Codename: kali-rolling
Exception information:

unable to open database file
Traceback (most recent call last):
  File "/usr/share/command-not-found/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/share/command-not-found/CommandNotFound/CommandNotFound.py", line 79, in __init__
    self.db = SqliteDatabase(dbpath)
  File "/usr/share/command-not-found/CommandNotFound/db/db.py", line 12, in __init__
    self.con = sqlite3.connect(filename)
sqlite3.OperationalError: unable to open database file

┌──(kali㉿kali)-[/usr/share/wordlists]
└─$ ls /usr/share/command-not-found/CommandNotFound/db/db.py -al
-rw-r--r-- 1 root root 868 Jun 1 2020 /usr/share/command-not-found/CommandNotFound/db/db.py
                                                                                                                                                                                              
[sudo] password for kali:
┌──(root�kali)-[/usr/share/wordlists]
└─# gitleaks
Command 'gitleaks' not found, but can be installed with:
apt install gitleaks

Activities

steev

2021-03-02 16:41

manager   ~0014262

That file is simply the python file to access the actual database file(s) which are in /var/lib/command-not-found.

Does c-n-f crash every time? Does running an apt update fix the issue?

steev@kld:~/git/linux$ gitleakss
Command 'gitleakss' not found, did you mean:
  command 'gitleaks' from deb gitleaks
Try: sudo apt install <deb name>

Issue History

Date Modified Username Field Change
2021-03-02 16:07 catmandx New Issue
2021-03-02 16:41 steev Note Added: 0014262