getredash/redash · error · Exception

InfluxDB is not healthy. Check logs for more information.

Error message

InfluxDB is not healthy. Check logs for more information.

What it means

test_connection for InfluxDB v2 creates a client and calls client.health(); when the health check's status is 'fail' it logs the health message and raises this exception directing you to the logs. The real reason (auth failure, wrong URL/port, bad token) appears only in the logged health message.

Solutions

  1. Check the Redash worker logs for the 'Connection test failed, due to:' line — it contains the actual health message
  2. Verify url (e.g. http://host:8086), token, and org against influx CLI: influx ping / influx health
  3. If server uses self-signed TLS, enable the data source's SSL/certificate option or provide the CA cert
  4. For InfluxDB 1.x use the InfluxDB (v1) query runner instead of influx_db_v2

Example fix

// before
url = "http://influx.example.com:8088"
// after
url = "http://influx.example.com:8086"
Defensive patterns

Strategy: try-catch

Validate before calling

import requests

def influx_health_ok(url) -> bool:
    try:
        r = requests.get(f"{url}/health", timeout=5)
        return r.ok and r.json().get("status") in ("pass", "ok")
    except Exception:
        return False

Try / catch

try:
    runner.test_connection()
except Exception as e:
    if "InfluxDB is not healthy" in str(e):
        read_worker_log_health_message()  # contains the real reason

Prevention

When it happens

Trigger: Testing the data source when the InfluxDB v2 URL, port, token, or org is wrong, the bucket/server is unreachable, or the health endpoint returns fail (e.g. InfluxDB 1.x without v2 compat at that URL).

Common situations: Using an InfluxDB 1.8 URL with the v2 runner, expired/invalid API token, TLS mismatch (self-signed cert without enabling the cert option), wrong port (8086 vs 8088).

Related errors


AI-assisted analysis of getredash/redash@ca79fe988d (2026-08-28). Data as JSON: /api/errors/6a09442a116db520. Report an issue: GitHub.

Appendix: source

Thrown at redash/query_runner/influx_db_v2.py:138

    def test_connection(self) -> None:
        """
        Tests the healthiness of the influxdb instance. If it is not healthy,
        it logs an error message and raises an exception with an appropriate
        message.
        :raises Exception: If the remote influxdb instance is not healthy.
        """
        try:
            influx_kwargs = self._get_influx_kwargs()
            with InfluxDBClient(
                url=self.configuration["url"],
                token=self.configuration["token"],
                org=self.configuration["org"],
                **influx_kwargs,
            ) as client:
                healthy = client.health()
                if healthy.status == "fail":
                    logger.error("Connection test failed, due to: " f"{healthy.message!r}.")
                    raise Exception("InfluxDB is not healthy. Check logs for more " "information.")
        except Exception:
            raise
        finally:
            self._cleanup_cert_files(influx_kwargs)

    def _get_type(self, type_: str) -> str:
        """
        Determines the internal type of a passed data type which the database
        uses.
        :param type_: The type from the database to map to internal datatype.
        :return: The name of the internal datatype.
        """
        return TYPES_MAP.get(type_, "string")

    def _get_data_from_tables(self, tables: Any) -> Dict:
        """
        Determines the data of the given tables in an appropriate schema for
        redash ui to render it. It retrieves all available columns and records

View on GitHub (pinned to ca79fe988d)