LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-17-2015, 08:34 PM   #1
ness2616
LQ Newbie
 
Registered: May 2014
Posts: 13

Rep: Reputation: Disabled
"Package is in a very bad inconsistent state"


I logged into my server today and received multiple error messages right away. I couldn't figure out what they were until I happened to check my fail2ban for unrelated reasons. Here are the types of messages I see:

Code:
root@myserver /etc/fail2ban # sudo apt-get install --reinstall fail2ban
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 104 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main fail2ban all 0.8.6-3wheezy3 [104 kB]
Fetched 104 kB in 0s (218 kB/s)
Selecting previously unselected package fail2ban.
(Reading database ... 119957 files and directories currently installed.)
Preparing to replace fail2ban 0.8.6-3wheezy3 (using .../fail2ban_0.8.6-3wheezy3_all.deb) ...
[....] Stopping authentication failure monitor: fail2banTraceback (most recent call last):
  File "/usr/lib/python2.7/site.py", line 68, in <module>
    import os
  File "/usr/lib/python2.7/os.py", line 49, in <module>
    import posixpath as path
  File "/usr/lib/python2.7/posixpath.py", line 17, in <module>
    import warnings
  File "/usr/lib/python2.7/warnings.py", line 8, in <module>
    import types
  File "/usr/lib/python2.7/types.py", line 36, in <module>
    BufferType = buffer
NameError: name 'buffer' is not defined
. ok
Traceback (most recent call last):
  File "/usr/lib/python2.7/site.py", line 68, in <module>
    import os
  File "/usr/lib/python2.7/os.py", line 49, in <module>
    import posixpath as path
  File "/usr/lib/python2.7/posixpath.py", line 17, in <module>
    import warnings
  File "/usr/lib/python2.7/warnings.py", line 8, in <module>
    import types
  File "/usr/lib/python2.7/types.py", line 36, in <module>
    BufferType = buffer
NameError: name 'buffer' is not defined
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
[....] Stopping authentication failure monitor: fail2banTraceback (most recent call last):
  File "/usr/lib/python2.7/site.py", line 68, in <module>
    import os
  File "/usr/lib/python2.7/os.py", line 49, in <module>
    import posixpath as path
  File "/usr/lib/python2.7/posixpath.py", line 17, in <module>
    import warnings
  File "/usr/lib/python2.7/warnings.py", line 8, in <module>
    import types
  File "/usr/lib/python2.7/types.py", line 36, in <module>
    BufferType = buffer
NameError: name 'buffer' is not defined
. ok
Traceback (most recent call last):
  File "/usr/lib/python2.7/site.py", line 68, in <module>
    import os
  File "/usr/lib/python2.7/os.py", line 49, in <module>
    import posixpath as path
  File "/usr/lib/python2.7/posixpath.py", line 17, in <module>
    import warnings
  File "/usr/lib/python2.7/warnings.py", line 8, in <module>
    import types
  File "/usr/lib/python2.7/types.py", line 36, in <module>
    BufferType = buffer
NameError: name 'buffer' is not defined
dpkg: error processing /var/cache/apt/archives/fail2ban_0.8.6-3wheezy3_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 1
Traceback (most recent call last):
  File "/usr/lib/python2.7/site.py", line 68, in <module>
    import os
  File "/usr/lib/python2.7/os.py", line 49, in <module>
    import posixpath as path
  File "/usr/lib/python2.7/posixpath.py", line 17, in <module>
    import warnings
  File "/usr/lib/python2.7/warnings.py", line 8, in <module>
    import types
  File "/usr/lib/python2.7/types.py", line 36, in <module>
    BufferType = buffer
NameError: name 'buffer' is not defined
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/fail2ban_0.8.6-3wheezy3_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I have tried apt-get install --reinstall fail2ban, apt-get remove --purge fail2ban, and none of those worked. Fail2ban is not functioning and I cannot get it to reinstall or be removed at all. Everything was working totally fine until today when all of a sudden fail2ban stopped working.

Another typical sort of error from this:
Code:
dpkg: error processing fail2ban (--configure):
 Package is in a very bad inconsistent state - you should
 reinstall it before attempting configuration.
Errors were encountered while processing:
 fail2ban
E: Sub-process /usr/bin/dpkg returned an error code (1)
Has anyone encountered this error before? Does anyone know why this is happening? I have no idea how to fix it. Thank you...

Raspberry Pi on Raspbian

Last edited by ness2616; 03-17-2015 at 10:39 PM.
 
Old 03-17-2015, 08:58 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

it looks like the apt/fail2ban problems are just symptoms of a python problem. What happens if you run the following?
Code:
echo "import types" | python
Evo2.
 
Old 03-17-2015, 10:07 PM   #3
ness2616
LQ Newbie
 
Registered: May 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
Hmm... nothing happens if I enter that into the terminal.

By the way, upon restarting the server, I was able to uninstall and reinstall fail2ban. However, the fail2ban service will not start, so I don't know where the problem really is. If I enter "service fail2ban status," it always gives "fail2ban is not running... failed!"
 
Old 03-17-2015, 10:38 PM   #4
ness2616
LQ Newbie
 
Registered: May 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
Seems that something about Fail2ban must have changed, because when I disabled my jail.local file and restarted fail2ban, it restarted just fine. Perhaps there were two issues here: a python error that was resolved by rebooting and reinstalling fail2ban; and a fail2ban error, resolved by disabling several jails in jail.local that prevented fail2ban from functioning. I disabled a few jails and now it works. Shrug. Going to mark this as SOLVED but if anyone has input I'd still love to hear it. I don't really consider this a fix so much as a "huh, it works now... cool."
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] messed up dpkg - google-chrome-stable Package is in a very bad inconsistent state ilesterg Linux - Software 8 02-09-2022 03:46 AM
Yum broken, apparently in inconsistent state - "AttributeError: 'YumBaseCli'..." sternocera Linux - Server 1 03-13-2012 02:30 AM
Bad mount of .mdf - "wrong fs type, bad option, bad superblock, on /dev/loop0" Maybe-not Linux - General 2 02-29-2008 01:30 PM
"bad state" problem for hp nx 7400 series deggial Slackware 1 02-01-2007 12:07 AM
another "bad page state" error kmoffat Debian 1 10-15-2006 11:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration