I am the same anonymous that placed this issue. Googling for "unable to open database file sqlite" yielded the solution: the directory that contains the repository (as well as the repository itself) has to be owned by www-data.
chown www-data FOSSIL             solved the problem.