-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: startup permission check #421
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it. I wonder if we can similarly check the database file(s) permissions somehow (if they exist of course)?
Looked at more options yesterday. Trouble with looking at the os specific permissions, it's more difficult to resolve if we are the owner, are in group or others or have acl Trouble looking at the sqlite open options, the read_write allows write being missing according to docs. I think for practical ways this leaves the option of doing any write. I've previously suggested we should track sessions and up until which block have they gotten in a sort of audit table which could also be used for repairs (if we'd know that version X processed until block Y ...). I wouldn't want to continue an audit table on this. One thing I was left thinking that this check might of course hurt someone... Any objection to me adding skip with |
Hmm, how? I think testing that new files can be created in the data directory is actually good: sqlite creates new files in that directory, so not having the permission to do so would be just bad. |
I think lets wait until that actually happens? I.. can't think of any good scenario where we can only read from the existing read-only database. I guess maybe in the future they somehow want to server a read-only snapshot with sync and everything else disabled? But they can then ask for that (weird) feature. |
Oki, I just have a bad track record with adding features which seemingly do no harm but were hurting docker users :) |
f719abe
to
3fdd5a0
Compare
Lets run it in docker before then just to make sure :) |
sounds trivial but the permissions are 99% of support requests related to running docker. sqlite will give out xDelete on VFS object related error if everything goes well up until for example the journal file needs to be removed or created (due to some interesting configuration).
3fdd5a0
to
5e546c5
Compare
When running with data directory which is not writeable (but still might contain writable database files), this gives:
This check might of course cause issues for some users but helping these out are always confusing, especially if the error comes from sqlite because a journal file couldn't be removed or created or whatever.