I experienced the same thing to my localhost DNN without any reason. It displayed that error and I could not login. I solve it by doing the followings. See it would help someone.
1) Make a copy of my whole DNN folder.
2) Unzip the original DNN installation ZIP to that DNN folder which has the problem . Let the original installation files overwirte any exisiting file.
3) Copy the web.config file from the very-first duplicated DNN folder back to this problem DNN folder in order to overwite the just re-installed web.config.
4) Browse my localhost DNN portal in web browser, DNN will install/update again.
5) At this point my login is back without any error message. BUT the style css and skins and containers were gone. Don't worry! Copy those stuffs from the very-first duplicated DNN folder back to this freshly re-installed DNN folder accordingly.
6) OK now the looks and feels are back.
7) Another BIG unknown problem!!! I login as host (the most powerful host!) but the DNN didn't allow me to use Edit mode. That meaned I cannot see the module settings and page settings.
8) Then I logout , then login as portal admin (the second-most powerful user!), luckily the I can use those settings with this portal admin.
9) To save my host login to be able to use those settings and edit mode, login as port admin, go to [Role Security], add HOST to the administrator group.
10) To test the HOST account, logout your portal admin and then login your HOST account. Bravo! It works.
11) Now logout your HOST and login as portal admin again. Go to the [Role Security] page, delete HOST from the Administrator group. This will not take away the HOST's greatest authority. It's admin authority will stay even it's removed from the Administartor group in the [Role Security] page. To test it, login as HOST and the eidt mode and all settings options are there. I don't know why but somehow it refresh/fool the DNN database.
Good luck.