Thunderbird won’t work with the master password

I found that Thunderbird failed to connect to send or receive email and constantly asked for the master password. To fix this, I removed the key3.db and sighons.sqlite files in the profile (within ~/.thunderbird), restarted Thunderbird, then went into the Edit->Preferences->Security window where I turned off “Use a master password”. Close the form, reopen the same form and turn on “Use a master password” again, and enter the password.

I found out later that the problem reoccurred but starting thunderbird in safe-mode (thunderbird –safe-mode) and disabling offending add-ons fixes the problem

Now everything works.