-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Better error message when directory containing database file is not writeable #1676
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
Comments
A useful error message if we get an OperationalError from SQLite that indicates a permissions problem on write.
Hello, |
Hi! You can format the code using a single pair of ``` delimiters. See GitHub's Markdown help for details. I don't quite understand what you're proposing here. The linked issue shows an exception being raised from a |
Thank you very much. I will check it out again.
2017-03-30 6:15 GMT+03:00 Adrian Sampson <[email protected]>:
… Hi! You can format the code using a single pair of ``` delimiters. See
GitHub's Markdown help for details.
I don't quite understand what you're proposing here. The linked issue
shows an exception being raised from a connection.execute call; we'll
need to handle that exception. It looks like you might be looking at the
code that's used to write *music files* themselves? But the issue at hand
is about accessing the SQLite database.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1676 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AOp3kvpu3hJ402TpGIXpqmjniVXf_iE-ks5rqx5lgaJpZM4GZQIU>
.
|
I thought to add this in db.py. Is this right?
Thank you |
Thanks! This is indeed where the error occurs. There are a few more things to address:
|
Hello, Thank you in advance |
Yes, checking the permissions ahead of time with As far as I can tell, there's no way to get a numerical error code out of an SQLite exception: So the thing to do will be to use |
The Thank you |
That may be all the detail we can extract—in which case we'll just need to report that we were unable to open the database file, which might indicate a permissions problem. |
Was looking for a 'good first issue' ... this thread is old but with no apparent resolution so I went digging ... didn't take long for me to discover the following contained in
...specifically the exception statement here suggests that the issue has been resolved?! |
Hmm, good question. It would be worth investigating a little further to see how SQLite actually fails when the directory is read-only. From the original thread, for example, it seems possible that the error isn't raised until we actually try to write to the database—which would mean that this handler on the call to open the database wouldn't catch it. |
Following up from #1664: We should exit gracefully with a useful error message if we get an OperationalError from SQLite that indicates a permissions problem on write.
The text was updated successfully, but these errors were encountered: