Skip to content

health check not working #211

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

Closed
Ive-Z opened this issue Mar 18, 2021 · 1 comment · Fixed by #352
Closed

health check not working #211

Ive-Z opened this issue Mar 18, 2021 · 1 comment · Fixed by #352
Milestone

Comments

@Ive-Z
Copy link

Ive-Z commented Mar 18, 2021

Steps to reproduce:

  1. create a client
  2. call health() on client

Expected behavior:
A normal health check response

Actual behavior:
I always got the following resopnse:
{'checks': None, 'commit': None, 'message': 'Invalid value for name, must not be None', 'name': 'influxdb', 'status': 'fail', 'version': None}

I suspect that the response is not deserialised correctly.
The following inner exception happens:
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/influxdb_client/service/health_service.py", line 55, in get_health (data) = self.get_health_with_http_info(**kwargs) # noqa: E501 File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/influxdb_client/service/health_service.py", line 131, in get_health_with_http_info urlopen_kw=urlopen_kw) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/influxdb_client/api_client.py", line 345, in call_api _preload_content, _request_timeout, urlopen_kw) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/influxdb_client/api_client.py", line 182, in __call_api return_data = self.deserialize(response_data, response_type) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/influxdb_client/api_client.py", line 254, in deserialize return self.__deserialize(data, response_type) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/influxdb_client/api_client.py", line 293, in __deserialize return self.__deserialize_model(data, klass) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/influxdb_client/api_client.py", line 644, in __deserialize_model instance = klass(**kwargs) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/influxdb_client/domain/health_check.py", line 62, in __init__ self.name = name File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/influxdb_client/domain/health_check.py", line 90, in name raise ValueError("Invalid value forname, must not be None") # noqa: E501 ValueError: Invalid value for name, must not be None``

Specifications:

  • Client Version: InfluxDB Cloud 2.0
  • InfluxDB Version: 1.5.0
  • Platform: Mac & Linux
@bednar
Copy link
Contributor

bednar commented Mar 18, 2021

Hi @Ive-Z,

Thanks for using our client.

It is caused by influxdata/influxdb#19357.

As a workaround you could use something like:

from influxdb_client import InfluxDBClient

influx_cloud_url = 'https://us-west-2-1.aws.cloud2.influxdata.com'
influx_cloud_token = 'my-token'
bucket = 'my-bucket'
org = 'my-org'


def healthy() -> bool:
    try:
        client.query_api().query("buckets()", org)
        return True
    except Exception as e:
        print(e)
        return False


client = InfluxDBClient(url=influx_cloud_url, token=influx_cloud_token)
print(f"Healthy: {healthy()}")
client.close()

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants