-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Please handle SQLITE_BUSY gracefully #99
Comments
This seems like a pretty reasonable request. Let me check if this is something that the underlying SQLite library provides or if I need to add some retry logic myself. 👌🏻 |
I see this problem, and attempted to enable WAL as a fix. I'm not having much luck. I don't expect you folks to debug my personal setup (I'm using sqlite as a data source in addition to grafana config and I have a writer as well as the grafana reader...) but it would be cool if the documentation at least covered how to use sqlite3 with WAL as a data source. Thanks. |
I've managed to solve my personal problem with sqlite as a data source -- I was trying to use sqlite WAL (write ahead log), but my not-grafana process that was writing to the sqlite db was closing the connection every 10 seconds or so. That caused the WAL to be resolved, and there was no benefit for the "No data" problem. Making a commit every 10 seconds but keeping the connection open for a long time doesn't show any "No data" problems. I volunteer to make a PR with this documentation. I still think it's worth having a retry. |
Sounds good. Feel free to open a PR or another issue if you need more details. |
https://github.com/mattn/go-sqlite3#connection-string describes a way to set PRAGMA busy_timeout, has anyone tried it? Configuration -> Data sources -> pick a sqlite data source -> path options _busy_timeout=1000 |
... I tried it and it seems that I still get an occasional SQLITE_BUSY. Correctly using SQLITE WAL was definitely an improvement. Adding the connection-string doesn't seem to have made these rare events happen less often. |
No joy with a "connect string" -- I set it to |
same is happening for me. i have 2 panels in one grafana dashboard , both connecting to same Sqlite datasource. probably something related to connection establishment when loading multiple panels at same time. This problem goes away when database is not in WAL mode and grafana reads db in ro mode . |
Describe the bug
When the sqlite database is being written into by another process (a logger appending values to a table), it is possible to get blank graphs in Grafana, with an error that says "SQLITE_BUSY 5"
Workaround, which seems to be working for now, is to add
PRAGMA busy_timeout
before every select, e.g.To Reproduce
Hard to reproduce since this bug occurs randomly by nature. Try to have a background process which frequently writes to the sqlite database; then try to add 5+ charts to grafana so that sqlite is polled frequently.
Screenshots
Sorry - can't reproduce the issue at the moment :-D
Versions (please complete the following information):
/plugins
webpage.Additional context
Grafana log:
The text was updated successfully, but these errors were encountered: