Fixing a broken Firefox Awesomebar (places.sqlite repair)

I noticed this morning that the Firefox ‘awesomebar’ – the feature where it suggests pages you’re probably looking for as you type in the location bar – just wasn’t working any more. It didn’t pop up any suggestions at all, no matter what I typed. I remember when this was first introduced I moaned about it quite publicly, but they made it lots better, and now losing it feels more or less like having my arms cut off – I don’t have bookmarks any more, I just remember tiny snippets of URLs or page names and Awesomebar does the rest (to add this blog entry I just type ‘happ’ and the admin interface of my blog pops up as the first link).

A quick trip to the error console (” Error: Places AutoComplete: [xpconnect wrapped mozIStorageError] Source File: file:///usr/lib64/xulrunner-1.9.2/components/nsPlacesAutoComplete.js Line: 496″) and a moan at Red Hat’s Mozilla maintainer led me to suspect that the places.sqlite file in my Firefox profile – which stores the browsing history – was somehow problematic, though it clearly wasn’t entirely broken as I could browse History / Show All History just fine, and sqlite3 didn’t seem to have problems with it.

I confirmed that moving this file and letting Firefox generate a new one made the feature itself work again, but of course it didn’t have my actual browsing history, so that was no good.

Finally, with a bit of GoogleHelp, I got it sorted. Back up the ‘broken’ places.sqlite to places.sqlite.bak, run Firefox to get a fresh places.sqlite generated, quit Firefox again, and do:

echo “.dump” | sqlite3 places.sqlite.bak | sqlite3 places.sqlite

re-run Firefox, and the feature’s working and my actual browsing history is in it. Phew!

5 Responses

  1. Duber
    Duber August 11, 2010 at 5:56 pm | | Reply

    In my case command was:

    echo .dump | sqlite old.db | sqlite new.db

    “.dump” with quotes would report some sqlite error.

  2. Fixing Awesome Bar in Firefox under OS X « A zijn

    [...] Awesome Bar in Firefox under OS X Filed under: Uncategorized — azijn @ 23:47 Thanks to this guy, I was able to repair my “awesomebar”, after killing it, probably by a crash combined [...]

  3. ericjung
    ericjung January 3, 2011 at 7:59 pm | | Reply

    I had the same exact error with the exact same line number (line 496 in nsPlacesAutoComplete.js), but on Windows 7. Interestingly enough, all I had to do was close firefox, rename places.sqlite to anything, then start firefox. A new places.sqlite is generated with all of the old history–I don’t know from where, presumably another database file. The awesomebar works again. I subsequently just deleted the renamed file.

  4. DrimuS
    DrimuS April 1, 2011 at 10:27 pm | | Reply

    Hey man, I’m trying to do this on windows 7. How should I do the whole “echo .dump” step? Thanks in advance.

  5. Landis
    Landis April 2, 2013 at 3:44 pm | | Reply

    thank you. this ‘dump’ thing was helpful.
    didn’t resolve my primary issue, but it did ‘fix’ my places db.
    my issue ended up being sync sucks.

    Landis.

You can comment without reCAPTCHA by using an OpenID as the URL, or logging in with an OpenID or an old site account.

Leave a Reply