android thinks accounts.db is corrupted and deletes it
I got it fixed, even when i do not understand what happend

I checked the created sqlite file with PRAGMA integrity_check;, and after reindex and vacuum i actually got a message its corrupted (not before).

I tried to recreate it like in this blogpost and set the file permissions, which caused a bootloop.

Then i rebootet to recovery and replaced the accounts.db with a empty one from a second account on the phone and then read the dump_all.sql created before into the database.

Now it works, even when i do not know what's the difference between reading the data into a fresh database (which caused a bootloop) and reading it into a android created empty database.
It may be related to missing selinux contexts or something similiar.

So the working steps for anyone with a similiar problem:


dump the data from the possibly broken db (even when freshly created by TitaniumBackup)
copy an empty db
import the data into the db
reboot