Elasticsearch plugin issue reporting with a proxy

Hello Guys,

I have a little problem with the reporting of my plugin.
I have an issue with the Elasticsearch plugin. Here what is in the daemon logs.

Daemon.logs
    [2017-03-29 10:24:25,163] ERROR com.newrelic.metrics.publish.binding.Request - An error occurred communicating with the New Relic service
    java.net.UnknownHostException: platform-api.newrelic.com
            at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184) ~[na:1.8.0_121]
            at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0_121]
            at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_121]
            at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:668) ~[na:1.8.0_121]
            at sun.net.NetworkClient.doConnect(NetworkClient.java:175) ~[na:1.8.0_121]
            at sun.net.www.http.HttpClient.openServer(HttpClient.java:432) ~[na:1.8.0_121]
            at sun.net.www.http.HttpClient.openServer(HttpClient.java:527) ~[na:1.8.0_121]
            at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264) ~[na:1.8.0_121]
            at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367) ~[na:1.8.0_121]
            at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:200) ~[na:1.8.0_121]
            at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1157) ~[na:1.8.0_121]
            at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1032) ~[na:1.8.0_121]
            at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177) ~[na:1.8.0_121]
            at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1316) ~[na:1.8.0_121]
            at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1291) ~[na:1.8.0_121]
            at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250) ~[na:1.8.0_121]
            at com.newrelic.metrics.publish.binding.Request.deliver(Request.java:106) ~[plugin.jar:2.3.0-201701092118]
            at com.newrelic.metrics.publish.Runner$PollAgentsRunnable.run(Runner.java:213) [plugin.jar:2.3.0-201701092118]
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_121]

I use a proxy and I have configure it in the NPI configuration and Plugin configuration
/newrelic-npi/config/newrelic.json

 {   
  "license_key": "My licence key",
  "log_level": "info",
  "java_args": "-Xmx128m",
  "user": "elk",
  "distro": "debian",
  "proxy_host": "http://mylogin:mypassword@myproxyadress",
  "proxy_port": 80
}

/newrelic-npi/plugins/me.snov.newrelic-elasticsearch/newrelic-elasticsearch-plugin-2.3.0/config/newrelic.json

{
  "license_key": "mylicencekey",
  "log_level": "info",
  "proxy_host": "http://mylogin:mypassword@myproxyadress",
  "proxy_port": "80"
}

I curl this link on my server.
curl https://platform-api.newrelic.com/platform/v1/metrics
I have this result
{"error": "Invalid request format"}

I have disable the firewall and it’s still the same. Do you have any idea about this issue ? If you need more information don’t hesitate !

Thanks :blush: !
Michael

Hi @nwet,

At this point I would suggest contacting the author of this plugin if you have not already done so:

Because this is not a New Relic authored plugin, there is little we can do to determine why it’s not working for you as expected. Other community members may have experience with the plugin and might be able to help, but 3rd party plugins are supported by their authors. They are the best resource for troubleshooting issues.

Thanks ! It was a proxy issue.

Regards,
Michael

1 Like

I’m facing the same problem. How did you solve it?