Resolving vnstat “Error: Database load failed even when using backup. Aborting.” on FreeBSD

Thursday, 27th May 2010

I’m using vnstat to track my inbound and outbound traffic for quite some time on my FreeBSD powered router systemat home.
Until this very day it worked completely flawless, so almost every day I issued the command:

vnstat --days

To check the internal and external flow of traffic to my FreeBSD node. The advantages of using vnstat this ways are numerous,
maybe the most notable benefit is that you can keep an eye on the increase of traffic to your webserver,
that’s absolutely handy if you try to better rank your websites and increase monthly traffic to your Apache.
The above command will show up data for server accessbility since, vnstat started to build databases and if a drastic dropdown in network traffic to your system is observed this would be an indicator for some kind of problem with either your networkor some of the network services your server provides.

Well as I said today I tried to once again examine the yesterday statistics of vnstat, but instead the statistics the following error appeared:

pcfreak# vnstat -u
Error: Database load failed even when using backup. Aborting.

A quick research in Google led me to some other complains of the error and some explanation that the error is caused of some vnstat database flaw which is encountered on 32 bit and 64 bit architectures.

In order to solve the problem I had to:
1. Remove the old vnstat databases, using command:

pcfreak# rm -rf /var/db/vnstat

2. Rebuild vnstat database for my network interface

pcfreak# vnstat -u -i em0
Error: Unable to read database "/var/db/vnstat/em0".
Info: -> A new database has been created.

And we’re done, vnstat should start working as expected once again.

Share this on:

Download PDFDownload PDF

Tags:

3 Responses to “Resolving vnstat “Error: Database load failed even when using backup. Aborting.” on FreeBSD”

  1. Stefan says:
    Firefox 3.6.6 Firefox 3.6.6 Mac OS X 10.6 Mac OS X 10.6
    Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6

    Thanks, this helped me out!

    View CommentView Comment
  2. Honey says:
    Opera 11.50 Opera 11.50 Windows 7 Windows 7
    Opera/9.80 (Windows NT 6.1; U; en) Presto/2.9.168 Version/11.50

    Thanks for solution, it helped me!

    View CommentView Comment
    • admin says:
      Epiphany 2.30.6 Epiphany 2.30.6 Debian GNU/Linux x64 Debian GNU/Linux x64
      Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/531.2+ Debian/squeeze (2.30.6-1) Epiphany/2.30.6

      glad to help! 🙂
      Hope to see u around

      View CommentView Comment

Leave a Reply

CommentLuv badge