What is the bug?
Opensearch performance analyzer app throws exception on startup and is not working.
How can one reproduce the bug?
Steps to reproduce the behavior:
- Run opensearch from docker image: opensearchproject/opensearch:2.12.0 expose port 9600
- GET localhost:9600/_plugins/_performanceanalyzer/metrics
- Hangs indefinitely (aka, no response is ever returned)
What is the expected behavior?
Expected is that the webserver API on port 9600 returns a response.
What is your host/environment?
- OS: opensearchproject/opensearch:2.12.0
- Version 2.12.0
- Plugins
Do you have any additional context?
See logs/PerformanceAnalyzer.log and notice:
Exception in thread "main" java.lang.IllegalArgumentException: cannot add context to list
at jdk.httpserver/sun.net.httpserver.ContextList.add(ContextList.java:37)
at jdk.httpserver/sun.net.httpserver.ServerImpl.createContext(ServerImpl.java:276)
at jdk.httpserver/sun.net.httpserver.HttpServerImpl.createContext(HttpServerImpl.java:74)
at jdk.httpserver/sun.net.httpserver.HttpServerImpl.createContext(HttpServerImpl.java:39)
at org.opensearch.performanceanalyzer.PerformanceAnalyzerApp.createClientServers(PerformanceAnalyzerApp.java:354)
at org.opensearch.performanceanalyzer.PerformanceAnalyzerApp.createClientServers(PerformanceAnalyzerApp.java:319)
at org.opensearch.performanceanalyzer.PerformanceAnalyzerApp.main(PerformanceAnalyzerApp.java:112)
Checking the source code it is clear that the same handler is added twice, so the createContext functions throws an exception on the second attempt.
Code from PerformanceAnalyzerApp.java:
httpServer.createContext(Util.METRICS_QUERY_URL, queryMetricsRequestHandler);
httpServer.createContext(
Util.LEGACY_OPENDISTRO_METRICS_QUERY_URL, queryMetricsRequestHandler);
The Util.METRICS_QUERY_URL and Util.LEGACY_OPENDISTRO_METRICS_QUERY_URL are equal.
What is the bug?
Opensearch performance analyzer app throws exception on startup and is not working.
How can one reproduce the bug?
Steps to reproduce the behavior:
What is the expected behavior?
Expected is that the webserver API on port 9600 returns a response.
What is your host/environment?
Do you have any additional context?
See logs/PerformanceAnalyzer.log and notice:
Checking the source code it is clear that the same handler is added twice, so the createContext functions throws an exception on the second attempt.
Code from PerformanceAnalyzerApp.java:
The Util.METRICS_QUERY_URL and Util.LEGACY_OPENDISTRO_METRICS_QUERY_URL are equal.