init: probe if sqlite works

Help the user get annex.dbdir configured when their filesystem is not
one that sqlite works on.

The change in Database.Handle makes an error from sqlite not be ignored
besides being displayed, which it was before. I can't see any reason
git-annex would want to ignore these errors.

I chose to use the fsck database rather than the keys database because
opening the keys database populates it, and see commit
b3c4579c79.

The placement of the call to checkSqliteWorks inside checkInitializeAllowed
avoids annex.uuid getting set before it's called.

Sponsored-by: Dartmouth College's Datalad project
This commit is contained in:
Joey Hess 2022-08-17 13:07:14 -04:00
parent fc2d10d2cd
commit b801812660
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 44 additions and 3 deletions

View file

@ -86,3 +86,5 @@ add file1 ok
When initializing the repo with v5 git-annex (git annex init --version=5 test), then the legacy direct mode is used and file addition works well.
[[!tag projects/datalad]]
> [[done]] --[[Joey]]

View file

@ -0,0 +1,21 @@
[[!comment format=mdwn
username="joey"
subject="""comment 13"""
date="2022-08-17T17:05:25Z"
content="""
I've implemented probing by `git-annex init`, and it will display
this message to help the user get it configured:
init
Detected a filesystem where Sqlite does not work.
(sqlite worker thread crashed: user error (SQLite3 returned ErrorBusy while attempting to perform close(synthetic)(after successful open)))
To work around this problem, you can set annex.dbdir to a directory on another filesystem.
For example: git config annex.dbdir $HOME/cache/git-annex
git-annex: Not initialized.
Going to close the bug since I think this is the best that it can be handled.
"""]]