From MozillaZine Knowledge Base
This article applies to Firefox 3
Some Firefox 3 users may be unable to export bookmarks to an HTML file because the bookmarks file is not saved, no matter which folder location is chosen.   As a first step, exit Firefox completely (or reboot the computer) and then reopen Firefox. If you are now able to export your bookmarks, a previous Firefox process may not have closed properly. If this is a recurring problem, see this article.
If you are unable to export your bookmarks to an HTML file, even after restarting the computer, try the following:
Back up and restore bookmarks
You may be able to fix the problem by creating a bookmark backup file, which will be in JSON format, and then restoring the backup. 
- Open the Library Window and select the Backup feature ("Bookmarks -> Organize Bookmarks -> Import and Backup -> Backup").
- Save the bookmark backup file, which will be in JSON format, to an easy to find location, such as the desktop.
- Go back to the Library window and select the "Restore" feature ("Bookmarks -> Organize Bookmarks -> Import and Backup -> Restore").
- From the Restore menu, select the "Choose File.." option and browse to the JSON bookmarks file you backed up previously.
- Try exporting your bookmarks again.
- Disable all extensions via the Firefox Add-ons manager ("Tools -> Add-ons -> Extensions") or use the Firefox Safe Mode startup option to disable all add-ons.  If you are able to export your bookmarks with all extensions disabled, re-enable them one at a time to find the one that is causing the problem. For a systematic approach to troubleshooting extensions, see the Firefox standard diagnostic.
- Bookmarks and browsing history are stored in the Places database file "places.sqlite". If this file is damaged or missing certain bookmark entries, the export function will fail.  If you have a recent profile backup you can replace the original "places.sqlite" with the backup copy. If you have no backup or if it doesn't resolve the issue, you can force Firefox to create a new copy of places.sqlite and rebuild the Places database. Close Firefox completely, open the Firefox profile folder and remove (or rename) all files named "places.sqlite", including "places.sqlite.corrupt" files and "places.sqlite-journal", if found. When you next start Firefox, "places.sqlite" will be rebuilt and your bookmarks will be automatically restored from the most recent JSON backup (however, this will remove your browsing history of recently visited pages).  Note: You can force Firefox to rebuild the Places database using a bookmarks.html file, instead of the latest JSON backup, by following the instructions, including optional steps, outlined here.
If the above solutions do not help or if you would rather simply work around the problem for now, you can install the Foxmarks Bookmark Synchronizer extension. It will allow you to store your bookmarks on the Foxmarks site and download them to your computer as an HTML file, as explained here. (You can later rename the dated Foxmarks HTML file to "bookmarks.html", if needed.) 
Related bug reports