spring-attic / hystrix-dashboard

Apache License 2.0
99 stars 104 forks source link

Unable to connect to Command Metrix Stream #6

Closed yangzii0920 closed 6 years ago

yangzii0920 commented 7 years ago

Hi,

I have an issue on the dashboard statistic page. I could see the graphics once, but not with the new projects I built.

So here are the application (all of them are Spring Boot application): A (port 9000) calls B (port 9001) calls C (port 9002), Hystrix Dashboard application H simply with a @EnableHystrixDashboard annotation. A, B, and C are Rest web service with A and B having @EnableCircuitBreaker annotation.

Functionally A, B, and C work perfectly so it might not be issue with POM. But when I type no matter the /hystrix.stream of A or B or C on H's home page, it shows Unable to connect to Command Metrix Stream on the next page as shown below. image

On browser console there are error messages: EventSource's response has a MIME type ("text/plain") that is not "text/event-stream". Aborting the connection.

IDE console looks like this:


2017-05-23 15:23:01.938  INFO 2652 --- [nio-8080-exec-4] ashboardConfiguration$ProxyStreamServlet : Proxy opening connection to: http://localhost:9001/hystrix.stream
2017-05-23 15:23:02.213  WARN 2652 --- [nio-8080-exec-3] ashboardConfiguration$ProxyStreamServlet : Failed opening connection to http://localhost:9001/hystrix.stream : 404 : HTTP/1.1 404 
2017-05-23 15:23:02.213  WARN 2652 --- [nio-8080-exec-4] ashboardConfiguration$ProxyStreamServlet : Failed opening connection to http://localhost:9001/hystrix.stream : 404 : HTTP/1.1 404```

Where could be wrong?

Thanks.
spencergibb commented 7 years ago

Something (a proxy or virus scanner) is changing the mimetime to text/plain which is causing the problem.

spencergibb commented 7 years ago

Please learn how to properly format code and logs.

yangzii0920 commented 7 years ago

Thanks Spencer.

americanstone commented 6 years ago

having samilar issue.
browser console log

EventSource's response has a MIME type ("text/plain") that is not "text/event-stream". Aborting the connection.

server log

Proxy opening connection to: http://localhost:8080/hystrix.stream
2018-04-13 10:33:33.471  INFO 45337 --- [nio-8080-exec-3] ashboardConfiguration$ProxyStreamServlet : 
Proxy opening connection to: http://localhost:8080/hystrix.stream
2018-04-13 10:33:33.574  WARN 45337 --- [nio-8080-exec-8] ashboardConfiguration$ProxyStreamServlet : Failed opening connection to http://localhost:8080/hystrix.stream : 406 : HTTP/1.1 406 
2018-04-13 10:33:33.574  WARN 45337 --- [nio-8080-exec-3] ashboardConfiguration$ProxyStreamServlet : Failed opening connection to http://localhost:8080/hystrix.stream : 406 : HTTP/1.1 406 

jar version

+- org.springframework.cloud:spring-cloud-netflix-hystrix-dashboard:jar:2.0.0.M8:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-freemarker:jar:2.0.1.RELEASE:compile
[INFO] |  |  \- org.freemarker:freemarker:jar:2.3.28:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-commons:jar:2.0.0.M9:compile
[INFO] |  |  \- org.springframework.security:spring-security-crypto:jar:5.0.4.RELEASE:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-netflix-core:jar:2.0.0.M8:compile
[INFO] |  |  \- org.springframework.boot:spring-boot-starter-aop:jar:2.0.1.RELEASE:compile
[INFO] |  +- org.apache.httpcomponents:httpclient:jar:4.5.5:compile
[INFO] |  |  \- org.apache.httpcomponents:httpcore:jar:4.4.9:compile
[INFO] |  +- com.netflix.hystrix:hystrix-metrics-event-stream:jar:1.5.12:compile
[INFO] |  |  \- com.netflix.hystrix:hystrix-serialization:jar:1.5.12:runtime
[INFO] |  |     \- com.fasterxml.jackson.module:jackson-module-afterburner:jar:2.9.3:runtime
[INFO] |  +- org.webjars:jquery:jar:2.1.1:compile
[INFO] |  \- org.webjars:d3js:jar:3.4.11:compile

spring boot version : 2.0.1.RELEASE spring-cloud-dependencies version: Finchley.M9

cqxxxxxxxx commented 6 years ago

i got the same issue when i use hystrix with openfeign, and the logs printed same with what americanstone and yangzii0920 posted. and my spring cloud version is Finchley.RELEASE


i solved this issue just now, and here is the solution. maven

 <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-hystrix-dashboard</artifactId>
 </dependency>
 <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

application.yml

management:
  endpoints:
    web:
      exposure:
        include: hystrix.stream
      base-path: /

Application.java

@EnableHystrixDashboard
ghost commented 6 years ago

@cqxxxxxxxx @spencergibb @americanstone @mstine - Could you please guide me on https://stackoverflow.com/questions/52137023/unable-to-connect-to-command-metric-stream-in-spring-cloud-hystrix-turbine ?

spencergibb commented 6 years ago

@JavaHelper please stop commenting on multiple issues in multiple projects. We also monitor stack overflow. It's a holiday weekend in the US

ghost commented 6 years ago

@spencergibb - Ok got it. It was just an effort to fix the issue raised if soonest possible ..

hendisantika commented 3 years ago

I am having error when opening hystrix dashboard:

2021-05-27 06:40:05.683 INFO 13407 --- [nio-8083-exec-3] ashboardConfiguration$ProxyStreamServlet :

Proxy opening connection to: http://localhost:8083/actuator/hystrix.stream

2021-05-27 06:40:05.683 INFO 13407 --- [nio-8083-exec-6] ashboardConfiguration$ProxyStreamServlet :

Proxy opening connection to: http://localhost:8083/actuator/hystrix.stream

2021-05-27 06:40:05.699 WARN 13407 --- [nio-8083-exec-6] ashboardConfiguration$ProxyStreamServlet : Failed opening connection to http://localhost:8083/actuator/hystrix.stream : 404 : HTTP/1.1 404 2021-05-27 06:40:05.699 WARN 13407 --- [nio-8083-exec-3] ashboardConfiguration$ProxyStreamServlet : Failed opening connection to http://localhost:8083/actuator/hystrix.stream : 404 : HTTP/1.1 404

image

Here's the repo sample: https://gitlab.com/microservice-samples/micro-services-spring-cloud-config/hystrix-circuit-breaker

Any idea?

Thanks