View Issue Details

IDProjectCategoryView StatusLast Update
0007075Kali LinuxKali Package Bugpublic2021-12-14 22:38
Reportercatmandx Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionopen 
Product Version2021.1 
Summary0007075: command-not-found cannot open it's sqlite db file
Description

When 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 Reproduce
  1. 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 Information

Output:
┌──(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

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>

g0tmi1k

g0tmi1k

2021-12-14 22:38

administrator   ~0015530

This report has been filed against an old version of Kali. We will be closing this ticket due to inactivity.
Please could you see if you are able to replicate this issue with the latest version of Kali Linux (https://www.kali.org/get-kali/)?
If you are still facing the same problem, feel free to re-open the ticket. If you choose to do this, could you provide more information to the issue you are facing, and also give information about your setup?
For more information, please read: https://www.kali.org/docs/community/submitting-issues-kali-bug-tracker/

Issue History

Date Modified Username Field Change
2021-03-02 16:07 catmandx New Issue
2021-03-02 16:41 steev Note Added: 0014262
2021-12-14 22:38 g0tmi1k Note Added: 0015530
2021-12-14 22:38 g0tmi1k Status new => closed