command-not-found Crashing

Bug #135327 reported by Steve Illgen
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
command-not-found (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: command-not-found

O.S: Ubuntu Gutsy Gibbon Tribe 2
Package: command-not-found 0.2.7
Date of occurrence: 28 Aug 07

Description:

command-not-found generates the following message when an unknown command (in this case, ll) is entered on the command line after I updated Gutsy Gibbon with the latest patches on 27 Aug 07 (using apt-get upgrade):

root@hostname:/usr/share# ll

KABOOOM!!!

Whoops, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/ubuntu/+source/command-not-found
Please include the following information with the report:
[Errno 2] No such file or directory: '/usr/share/command-not-found/programs.d'
Traceback (most recent call last):
  File "/usr/lib/command-not-found", line 24, in <module>
    CommandNotFound(options.data_dir).advise(args[0])
  File "/usr/lib/python2.5/site-packages/CommandNotFound/CommandNotFound.py", line 72, in __init__
    for filename in os.listdir(os.path.sep.join([data_dir, self.programs_dir])):
OSError: [Errno 2] No such file or directory: '/usr/share/command-not-found/programs.d'
Python version: 2.5.1 final 0
bash: ll: command not found

I removed and reinstalled the package, but get the same results.

Thanks,

Steve Illgen

Revision history for this message
Daniel Hahler (blueyed) wrote :

It seems like you are missing command-not-found-data, but command-not-found depends on it..

Do you have the most recent version of the packages installed?

$ dpkg -l | grep command-not-found
ii command-not-found 0.2.7 Suggest installation of packages in interact
ii command-not-found-data 0.2.7 Set of data files for command-not-found.

Revision history for this message
Steve Illgen (sillgen) wrote :

Both packages are installed. I went as far as to remove both, then reinstall them. I still get this error:

/usr/bin/python: can't open file '/usr/lib/command-not-found': [Errno 2] No such file or directory

I can pull this directory from another system; but am curious as to why this is happening after I installed my patches.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Hmm I guess I know what's causing this.

A per another bug we've moved c-n-f from /usr/bin to /usr/lib since it's not a end-user application really. This is probably a bug in the packaging script that fails to put c-n-f in that directory.

Revision history for this message
Michael Vogt (mvo) wrote :

@Steve Illgen: Thanks for your bugreport.
Could you please attach the output of:
$ dpkg -l command-not-found command-not-found-data bash
$ dpkg -L command-not-found
$ dpkg -L command-not-found-data
$ ls -l /usr/bin/python /usr/lib/command-not-found

What shell do you use (zsh maybe)?

Thanks,
 Michael

Changed in command-not-found:
status: New → Incomplete
Revision history for this message
Steve Illgen (sillgen) wrote :

Here you go:

- dpkg -l command-not-found command-not-found-data bash:

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-======================-==============-============================================
ii bash 3.2-0ubuntu9 The GNU Bourne Again SHell
rc command-not-found 0.2.7 Suggest installation of packages in interact
ii command-not-found-data 0.2.7 Set of data files for command-not-found.

- dpkg -L command-not-found

/etc
/etc/zsh_command_not_found

- dpkg -L command-not-found-data

/.
/usr
/usr/share
/usr/share/command-not-found
/usr/share/command-not-found/data
/usr/share/command-not-found/programs.d
/usr/share/command-not-found/programs.d/all-main.db
/usr/share/command-not-found/programs.d/all-multiverse.db
/usr/share/command-not-found/programs.d/all-restricted.db
/usr/share/command-not-found/programs.d/all-universe.db
/usr/share/command-not-found/programs.d/i386-main.db
/usr/share/command-not-found/programs.d/i386-multiverse.db
/usr/share/command-not-found/programs.d/i386-restricted.db
/usr/share/command-not-found/programs.d/i386-universe.db
/usr/share/doc
/usr/share/doc/command-not-found-data
/usr/share/doc/command-not-found-data/copyright
/usr/share/doc/command-not-found-data/changelog.gz

- ls -l /usr/bin/python /usr/lib/command-not-found

ls: /usr/lib/command-not-found: No such file or directory
lrwxrwxrwx 1 root root 9 2007-07-02 12:45 /usr/bin/python -> python2.5

I am also using /bin/bash for my command shell.

Steve Illgen

Revision history for this message
Daniel Hahler (blueyed) wrote :

From the output of "dpkg -l command-not-found" it seems like command-not-found is not installed after all? (status "rc").

What does happen now, if you try to execute an unknown command?

What's the output of
set | grep -C 2 command-not-found
?

Revision history for this message
Steve Illgen (sillgen) wrote : Re: [Bug 135327] Re: command-not-found Crashing

It works(!) now after I installed the latest patch fixes for Gutsy this
morning. The only problem is, I still get the "rc" status for
command-not-found with dpkg -l.

Here is the output:

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-f/Unpacked/Failed-cfg/Half-inst/t-aWait/T-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err:
uppercase=bad)
||/ Name Version Description
+++-==============-==============-============================================
rc command-not-fo 0.2.7 Suggest installation of packages in
interact
ii command-not-fo 0.2.7 Set of data files for command-not-found.

On 8/29/07, dAniel hAhler <email address hidden> wrote:
>
> >From the output of "dpkg -l command-not-found" it seems like command-
> not-found is not installed after all? (status "rc").
>
> What does happen now, if you try to execute an unknown command?
>
> What's the output of
> set | grep -C 2 command-not-found
> ?
>
> --
> command-not-found Crashing
> https://bugs.launchpad.net/bugs/135327
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Steve Illgen (sillgen) wrote :

1. I get the following after entering an unknown command:

root@sillgen-ub:~# saa
-su: saa: command not found
root@sillgen-ub:~#

(which is expected).

2. Nothing returns after entering 'set | grep -C 2 command-not-found'

root@sillgen-ub:~# set | grep -C 2 command-not-found
root@sillgen-ub:~#

Revision history for this message
Jaakan Shorter (jaakanshorter) wrote :

jaakan@AMD64:~$ ehtop

jaakan@AMD64:~$ ehtop'import site' failed; use -v for traceback

KABOOOM!!!

Whoops, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/ubuntu/+source/command-not-found
Please include the following information with the report:
No module named CommandNotFound
Traceback (most recent call last):
  File "/usr/lib/command-not-found", line 10, in <module>
    from CommandNotFound import CommandNotFound
ImportError: No module named CommandNotFound
Python version: 2.5.1 final 0

jaakan@AMD64:~$

I did a C+Ctrl as soon as I saw I miss typed htop

I ran it again as ehtop

and got

jaakan@AMD64:~$ ehtop
-bash: ehtop: command not found
jaakan@AMD64:~$

Not sure if I would call this a bug or not

Revision history for this message
Bastiaan Wakkie (bwakkie) wrote : Re: command-not-found Crashing. System unusable!

Hi,

After starting up my laptop today I ended up with more of less the same error msg as above and was thrown into a root shell.
I can' t even start simple commands like "locate" and "apt-get" etc.

How do I update/upgrade my system now? I have internet connection I believe but I can't run the command "apt-get".

Thanks,
Bastiaan

---
libgcc_s.so.1:cannot open shared object file: No such file or directory

Traceback:
file "/usr/lib/command-not-found" line 10
   from CommandNotFound import CommandNotFound, in <module>
File "/usr/lib/python2.5/site-packages.CommandNotFound/__int__.py", line 1in <module>
   from CommandNotFound import CommandNotFound
File "/usr/lib/python2.5/site-packages/CommmandNotFound/CommandNotFound.py", line 7, in <module>
  import apt_pkg
Import Error: libgcc_s.so.1: cannot open shared object file: No such file or directory.
Python version 2.5.1 final 0
bash: Python: command ot found

---

Gutsy tribe 5
Dell Latitude D620, intel 945 based

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

This doesn't look like the error originally reported, it looks like you don't have libgcc_s.so.1.

Did you upgrade your system recently (if so please describe the process)?
Did you have a power failure recently?

Revision history for this message
Bastiaan Wakkie (bwakkie) wrote :

I updated the system on Saturday.

No power failures. ( run a webserver on the same power net so I know it for sure)

I just noticed that I can't access the /home dir.. so a disk failure after all??
Some parts of the system do work though. I can browse through /usr/bin and /usr/lib/ but can't find python2.5 dir in it.

So Whats the best? Use a fresh CD and reinstall and see if I can save my system setup? Or is there a restore like functionality?

Revision history for this message
Bastiaan Wakkie (bwakkie) wrote :

Upgrade: Just upgraded the packages that where listed. I didn't really have a look in the list.

Revision history for this message
Greg Grossmeier (greg.grossmeier) wrote :

It appears the original issue reported in this bug is fixed, as such I am closing this bug. If this is still an issue for you in the latest version of Ubuntu (which is Hardy right now) please reopen this bug.

Thanks!

Changed in command-not-found:
status: Incomplete → Invalid
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.