On Sun, Oct 11, 2015 at 12:56 PM, Andrew Miles <andy at blandsrow.com> wrote:
> Log showed it unable to open the directory and then unable to write the > journal file. The directory is root writable and the process is run as > root so I didn't expect a problem here. I've now modified the directory > access to be writable by all to see if that changes things. This implies that the process was previously able to open journal files in that directory. Having access rights to the database files change for no reason is concerning, but so is having them not change but it just doesn't work! You might want to log access() and/or stat() results for the directory when you see this error. Also, you might want to check the rights up the directory tree, and whether you have interesting errors being reported at the OS level. Based on your statement that it happens after a few days, and the problem doesn't go away if you retry, but it _does_ go away if you restart the process, you might also run lsof against the process. Maybe the process has a file-descriptor leak or something of that sort. Only other things I can think of is to try PRAGMA journal_mode=TRUNCATE. This truncates the journal file rather than deleting it. Since the journal file sticks around between transactions, this may work around the issue. -scott