InfluxDB no longer parsing Grafana queries #91
gigatexel posted onGitHub
<!-- READ THIS FIRST: - If you need additional help with this template, please refer to https://www.home-assistant.io/help/reporting_issues/ - Make sure you are running the latest version of Home Assistant before reporting an issue: https://github.com/home-assistant/core/releases - Do not report issues for integrations if you are using custom components or integrations. - Provide as many details as possible. Paste logs, configuration samples and code into the backticks. DO NOT DELETE ANY TEXT from this template! Otherwise, your issue may be closed without comment. -->
The problem
<!-- Describe the issue you are experiencing here to communicate to the maintainers. Tell us what you were trying to do and what happened. -->
Last night InfluxDB stopped parsing the queries sent by Grafana, without anything changed to HA/Grafana/InfluxDB. Has worked perfectly for several months.
What is still working?
- InfluxDB is still filling with HA data
- Using Chronograf from within HA, connection to InfluxDB is ok, I can query the DB and view results
- InfluxDB & Grafana start without errors, no errors in Add-In logs and Core logs in HA
What no longer working?
- All Grafana queries to InfluxDB throw errors that suggest the HTTP GET requests are not parsed
Environment
<!-- Provide details about the versions you are using, which helps us to reproduce and find the issue quicker. Version information is found in the Home Assistant frontend: Configuration -> Info. -->
- Home Assistant Core release with the issue: 0.115.6
- Last working Home Assistant Core release (if known): 0.115.6
- Operating environment (OS/Container/Supervised/Core): Supervised
- Integration causing this issue: InfluxDB
- Link to integration documentation on our website:
Problem-relevant configuration.yaml
<!-- An example configuration that caused the problem for you. Fill this out even if it seems unimportant to you. Please be sure to remove personal information like passwords, private URLs and other credentials. -->
Traceback/Error logs
<!-- If you come across any trace or error logs, please provide them. -->
When creating a new dashboard, Grafana immediately throws the following error:
InfluxDB Error: error parsing query: found %, expected identifier, string, number, bool at line 1, char 13
Char 13 is the % right after mean( in the query field Corresponding request in the Grafana Add-In logs:
[07/Oct/2020:10:49:51 +0200] 400 185.160.220.41, 172.30.32.1(172.30.32.2) GET /api/datasources/proxy/1/query?db=ha&q=SELECT+mean(%2522value%2522)+FROM+%2522measurement%2522+WHERE+time+%253E%253D+now()+-+6h+GROUP+BY+time(20s)+fill(null)&epoch=ms HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36)
When adding a new InfluxDB connection to Grafana, after removing the existing connection (following the configuration steps in the documentation)
InfluxDB Error: error parsing query: found %, expected identifier at line 1, char 28
Char 28 is the % right after +on+ in the query field Corresponding request in the Grafana Add-In logs:
[07/Oct/2020:10:54:19 +0200] 400 185.160.220.41, 172.30.32.1(172.30.32.2) GET /api/datasources/proxy/1/query?db=ha&q=SHOW+RETENTION+POLICIES+on+%2522ha%2522&epoch=ms HTTP/1.1 (Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36)
Additional information
It seems to me that InfluxDB is no longer correctly parsing the URL ASCII encoding. Reinstall of Grafana in HA yielded no results. Reinstall of InfluxDB was not yet tried, fear of losing all the data.