check db errors on start and upgrade