Skip to content
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

Client connects and able to write, but health check returns fail #143

Closed
KubaC123 opened this issue Aug 17, 2020 · 7 comments
Closed

Client connects and able to write, but health check returns fail #143

KubaC123 opened this issue Aug 17, 2020 · 7 comments
Labels
wontfix This will not be worked on
Milestone

Comments

@KubaC123
Copy link

KubaC123 commented Aug 17, 2020

Steps to reproduce:
List the minimal actions needed to reproduce the behavior.

  1. add dependency (implementation "com.influxdb:influxdb-client-scala:1.8.0"), gradle in my case
  2. add influx2.properties file to classpath with connection settings
  3. invoke InfluxDBClientFactory.create().health in a main method

Expected behavior:
InfluxDBClientFactory.create().health().getStatus() should return pass

Actual behavior:
InfluxDBClientFactory.create().health().getStatus() returns fail, while in my logs I can see that response from instance health endpoint returned 200, and I am able to successfully write data using client instance

It might be some issue with reading json response, while underlying exception during execution of Call<HealthCheck> says:
com.influxdb.exceptions.InfluxException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $

Specifications:

  • Client Version: 1.8.0
  • InfluxDB Version: 2.0
  • Platform: AWS
@bednar
Copy link
Contributor

bednar commented Aug 18, 2020

Hi @KubaC123,

thanks for our using client.

Could you share a debug output for InfluxDBClientFactory.create().health()?

The debug output is enabled by:

InfluxDBClient client = InfluxDBClientFactory.create();
client.setLogLevel(LogLevel.BODY);
HealthCheck.StatusEnum status = client.health().getStatus();

Regards

@KubaC123
Copy link
Author

Hi @bednar
here's what i get

Aug 18, 2020 9:48:52 AM okhttp3.internal.platform.Platform log
INFO: --> GET https://eu-central-1-1.aws.cloud2.influxdata.com/health
Aug 18, 2020 9:48:52 AM okhttp3.internal.platform.Platform log
INFO: User-Agent: influxdb-client-java/1.8.0
Aug 18, 2020 9:48:52 AM okhttp3.internal.platform.Platform log
INFO: --> END GET
Aug 18, 2020 9:48:53 AM okhttp3.internal.platform.Platform log
INFO: <-- 200 https://eu-central-1-1.aws.cloud2.influxdata.com/health (775ms)
Aug 18, 2020 9:48:53 AM okhttp3.internal.platform.Platform log
INFO: date: Tue, 18 Aug 2020 07:48:53 GMT
Aug 18, 2020 9:48:53 AM okhttp3.internal.platform.Platform log
INFO: content-type: text/html
Aug 18, 2020 9:48:53 AM okhttp3.internal.platform.Platform log
INFO: content-length: 1017
Aug 18, 2020 9:48:53 AM okhttp3.internal.platform.Platform log
INFO: vary: Accept-Encoding
Aug 18, 2020 9:48:53 AM okhttp3.internal.platform.Platform log
INFO: strict-transport-security: max-age=15724800; includeSubDomains
Aug 18, 2020 9:48:53 AM okhttp3.internal.platform.Platform log
INFO: last-modified: Mon, 17 Aug 2020 23:09:22 GMT
Aug 18, 2020 9:48:53 AM okhttp3.internal.platform.Platform log
INFO: vary: Accept-Encoding
Aug 18, 2020 9:48:53 AM okhttp3.internal.platform.Platform log
INFO: etag: "5f3b0e22-3f9"
Aug 18, 2020 9:48:53 AM okhttp3.internal.platform.Platform log
INFO: accept-ranges: bytes
Aug 18, 2020 9:48:53 AM okhttp3.internal.platform.Platform log
INFO:
Aug 18, 2020 9:48:53 AM okhttp3.internal.platform.Platform log
INFO:

<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>InfluxDB 2.0</title><base href="/"><script>(function (w, d, s, l, i) {
          w[l] = w[l] || [];
          w[l].push({
            'gtm.start': new Date().getTime(),
            event: 'gtm.js'
          });
          var f = d.getElementsByTagName(s)[0],
          j = d.createElement(s),
          dl = l != 'dataLayer' ? '&l=' + l : '';
          j.async = true;
          j.src =
          'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
          f.parentNode.insertBefore(j, f);
        })(window, document, 'script', 'dataLayer', 'GTM-NXMTGSW');</script><link rel="shortcut icon" href="/favicon.ico"></head><body><div id="react-root" data-basepath=""></div><noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NXMTGSW" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript><script src="/static/73c966a93a.js"></script></body></html>

Aug 18, 2020 9:48:53 AM okhttp3.internal.platform.Platform log
INFO: <-- END HTTP (1017-byte body)

Regards

@bednar
Copy link
Contributor

bednar commented Aug 18, 2020

The client uses /health path that seems not works in InfluxDB 2 Cloud instances only in OSS instances. For more info see - influxdata/influxdb#19357

@russorat
Copy link

let's plan to move the clients to the /api/v2/health endpoint.

@bednar
Copy link
Contributor

bednar commented Sep 17, 2020

@russorat PR for InfluxDB OSS is prepared - influxdata/influxdb#19578

@Bharathebt
Copy link

I'm getting 'path not found' error in InfluxDB 2 Cloud for /api/v2/health. It was working earlier. Anything changed recently? Raised an issue here influxdata/influxdb#19990.

@bednar
Copy link
Contributor

bednar commented Oct 26, 2021

The InfluxDBClientFactory.create().health() is deprecated, please use ping(). For more info see - #272

@bednar bednar closed this as completed Oct 26, 2021
@bednar bednar added this to the 3.5.0 milestone Oct 26, 2021
@bednar bednar added the wontfix This will not be worked on label Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants