Locked or damaged places.sqlite
From MozillaZine Knowledge Base
(Redirected from Toolbar buttons are disabled - Firefox)
Starting in Firefox 3, bookmarks and browsing history are stored in the places.sqlite file, located in the Firefox profile folder. If the Places database is locked or damaged, many Firefox functions will not work and the following symptoms may occur:
Note: For other solutions to missing bookmarks, see Lost bookmarks. If changes made to bookmarks are lost when you restart Firefox, see Bookmarks not saved. If deleting a large quantity of bookmarks is very slow or causes a hang, see Firefox hangs.
Locked Places database
If Firefox works normally when you first open it after starting up the computer but multiple symptoms arise after you close and later reopen Firefox, it's likely that a Firefox process from a previous session did not close properly and the Places database ("places.sqlite" file) is locked. To work around the issue, close Firefox completely, end any Firefox processes (or reboot the computer), and restart Firefox.
If this is a recurring problem, see Firefox hangs - Hang at exit and check for problematic extensions. Note: Starting in Firefox 3.5, if you open Firefox and the Places database is locked you will see the message, The bookmarks and history system will not be functional because one of Firefox's files is in use by another application. Some security software can cause this problem. 
Damaged Places database
If the symptoms described earlier occur even when you first start Firefox after rebooting the computer, the Places database (places.sqlite file) may be damaged.
Other solutions are listed below.
Problems limited to bookmarks
If the Places database damage seems to be limited to bookmarks, for example, if certain bookmarks cannot be deleted, moved, or edited , try creating a new bookmark backup file in Firefox via "Bookmarks -> Show all (or Organize) Bookmarks -> Import and Backup -> Backup" and then restore the new backup, as an alternative to rebuilding the Places database. This may work since the bookmark backup process bypasses certain invalid places.sqlite entries that may exist.  and has the advantage of preserving your browsing history. Using PC Tools Spyware Doctor is reported to cause this type of bookmark damage so you should contact PC Tools support for a solution or else stop using the software.   
Rebuild Places database
If the previous solutions and the "Places Maintenance" extension (see above) didn't resolve the problem, you can rebuild the Places database as follows: (You may wish to export your bookmarks to an HTML file first, as a precaution.)
Warning: Deleting or renaming the places.sqlite file will result in rebuilding the places database and loss of all browsing history, which is used for features such as the Location Bar Auto Complete drop-down (AwesomeBar) list. First try the other solutions given above.
Note: In rare cases, your JSON bookmark backup files may also be damaged. You can optionally rebuild the Places database without using any JSON backups by also removing all "bookmarks-(date).json" files from the bookmarkbackups folder but this will result in missing bookmarks unless the profile folder contains a bookmarks.html file with your current bookmarks. Check the creation date on your bookmarks.html as its use within Firefox was dropped starting with Firefox 3 and is now essentially used as a vehicle to transfer bookmarks between systems. If you have a bookmarks.html export or a saved copy of bookmarks.html, you can place it in the Firefox profile folder after removing the "places.sqlite*" and all JSON bookmark backups and Firefox will use those bookmarks to rebuild "places.sqlite".
If a places.sqlite.corrupt file exists
If your Firefox profile folder includes a "places.sqlite.corrupt" file, one reported fix is to open the Firefox profile folder and, after closing Firefox completely, delete or rename the places.sqlite file and then rename "places.sqlite.corrupt" to "places.sqlite". (If you see any other places.sqlite* files, delete those as well, so that only one places.sqlite file remains.) It is possible that certain security or "cleanup" software (e.g., CCleaner) is causing the places.sqlite file corruption. It is also possible that Firefox was not closed properly, as might happen when your computer loses power with Firefox running, which can cause a corrupt places.sqlite file. Always make sure that you close Firefox properly (e.g., no Firefox processes in the Windows Task Manager) before shutting down the computer. 
Note: If you downgraded from Firefox 55 or above to Firefox 52 ESR, the places.sqlite corruption was probably the result of the fix for Bug 1415133 - Downgrading Firefox 57 to 52 ESR loses bookmarks (quote) The patch is trivial, it will just cause Places to consider the database corrupt if its schema version is too much in the future. On such corruption Places throws away the db and creates a new one, importing bookmarks from the last backup.  . The bug fix restored bookmarks from backup but results in loss of history (Bug 1416506 - Downgrading Firefox 57 to 52 ESR loses session)
Related bug reports
Note: Many of these bugs have been fixed. The bug reports are listed for informational purposes.