-
-
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
Cached Query Results - SQLite database not updating in Grafana #83
Comments
Maybe you could describe your setup (and how your SQLite database is created) a bit more. Are you not using docker anywhere? Is the database file copied / linked from another place? Is the database file mounted / synced through some network drive or service? I can't reproduce the issue on my machine normally, but under one condition I also saw "caching". When I run Grafana in a docker container and mount the database file from my filesystem I saw this behavior. When I updated my database on my machine and keep the connection open it was already showing new values in another terminal on my machine. In Grafana (and a terminal SQLite client inside the docker container) I still saw the old values. |
The database was created using a CLI tool - it runs on a bare metal VPS without docker. Worth noting that I recently migrated from one host to another. To do so I downloaded the .db file with scp, before then uploading it to the new host also using scp. The cryptographic hashes match too. Any help appreciated -- I've tried a few things (reboot, etc), to no avail. |
And Grafana is running on the same machine as the only existing database file as well? In my docker example I could open a terminal SQLite client on the machine where Grafana was running and this terminal client showed the same "caching" behavior as Grafana (indicating it was not a Grafana/plugin issue). |
Exactly - that's what's so confusing about this. If I download the same DB locally, or run sqlite3 on the host and paste the same query, I get the correct results. No amount of Grafana reboots appear to be fixing the issue either ... |
Are there some changes that go through? Is the behavior different for
Do the Grafana logs show anything out of the ordinary? To be honest I am just grasping right now as I have no hypothesis for a possible cause. |
I haven't checked the Grafana logs, I will do that now and report back. |
Checked the logs within |
Can you provide something to me to reproduce the issue? As I do not see such behavior on my machine it is tricky to continue. Can you provide a dockerized version or the problem or some steps to execute on my machine that would lead to the issue? You can also try with different versions of the plugin or Grafana. I don't expect this to solve the issue but at least that is something to rule out. |
I would also be interested to know if this problems occurs for others users as well. This might help to isolate the issue to something plugin or setup related. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I see the same problem. Only a restart of grafana shows the latest values. in the path options I also tries: mode=ro&cache=shared |
Have you checked if you encounter the issue mentioned here: #83 (comment)
If you encounter the situation above this is an issue with docker. You can check by opening a terminal inside your docker container and opening the database with the sqlite CLI. If you still encounter this caching behavior then this is not plugin related. |
I'm facing the same problem. Grafana is not even querying for data (I don't see any requests to get data). Looking locally in docker container using sqlite3 I can see latest data. I did some snapshots before. I tried to delete them, but there is no difference. Restart doesn't help. The same behaviour is everywhere SQLite query should be done (including edit panel, query explorer, ...) except data source explorer. |
The problem is the following: |
@idefixcert I have this problem on Linux. |
How do you determine that Grafana is not even querying the data? Where do you look for the requests? |
in browser network panel |
Then this looks indeed different. Could you, please, open a new issue with some information about your setup and the Grafana logs as well? |
OK, I'm Grafana beginner, I'll ensure everything is ok on my side (I can query DB from explorer, seems all good) and open new issue. |
ℹ️ @fr-ser I was able to fix my problem by duplicating my dashboard. The new one is not having the same problem. I did a lot of snapshots in the old one (taking a long time). Maybe something locked the old board somehow. |
Describe the bug
Queries executed via Grafana with a SQLite data source appear cached / incorrect.
To Reproduce
Steps to reproduce the behavior:
sqlite3
which gives correct result.Screenshots
Local:
Remote:
Versions (please complete the following information):
Additional context
grafana.ini
updated to allow reading of database from within the home folder. Additionally, permissions set viachmod -R a+rwX ./sqlite.db
. 100% sure running the same DB locally and remotely as SHA1 hash identical.Really appreciate your help, thanks!
The text was updated successfully, but these errors were encountered: