openzipkin / zipkin

Zipkin is a distributed tracing system
https://zipkin.io/
Apache License 2.0
17.02k stars 3.09k forks source link

Unable to register to an authenticated eureka server #3697

Closed SankM1 closed 10 months ago

SankM1 commented 10 months ago

Describe the Bug

Unable to register to an authenticated eureka server.

Steps to Reproduce

$ curl -sSL https://zipkin.io/quickstart.sh | bash -s $ EUREKA_SERVICE_URL=http://username:password@localhost:8761/eureka/ java -jar zipkin.jar

Logs: 2024-01-18T10:53:53.319+05:30 WARN [/] 17620 --- [ main] c.l.a.s.RejectedRouteHandler : Virtual host '*' has a duplicate route: /health 2024-01-18T10:53:53.420+05:30 INFO [/] 17620 --- [oss-http-*:9411] c.l.a.s.Server : Serving HTTP at /[0:0:0:0:0:0:0:0]:9411 - http://127.0.0.1:9411/ 2024-01-18T10:53:53.741+05:30 WARN [/] 17620 --- [-worker-nio-2-2] c.l.a.s.e.EurekaUpdatingListener : Failed to register in-5cg1312171 to Eureka: http://username:password@localhost:8761/eureka/. (status: 401 Unauthorized, content: )

codefromthecrypt commented 10 months ago

I assume it is ok to use a different USERNAME and PASSWORD property instead of coding inside the URL, right?

codefromthecrypt commented 10 months ago

seems this is because when you make your own eureka server with spring, it defaults to literally user=username password=password https://cloud.spring.io/spring-cloud-netflix/multi/multi__service_discovery_eureka_clients.html#_authenticating_with_the_eureka_server

codefromthecrypt commented 10 months ago

https://github.com/openzipkin/zipkin/pull/3700 should do it

codefromthecrypt commented 10 months ago

https://github.com/openzipkin/zipkin/releases/tag/3.0.5 includes this

codefromthecrypt commented 9 months ago

Not sure what you were using to lookup Zipkin, but if spring-cloud-sleuth, you need to use at least 3.0.6 and https://github.com/openzipkin/brave-example/tree/master/webmvc5-sleuth shows this works.

SankM1 commented 9 months ago

Hi @codefromthecrypt , Able to register zipkin-server on eureka, but the url is getting greyed out on eureka and also not able register on spring boot admin. (as services registered on eureka should also get registered on spring boot admin), could you pls check, thanks. Capture

codefromthecrypt commented 9 months ago

@SankM1 can you try with latest zipkin 3.0.6 and also let us know which version of eureka you are using?

finally, can you paste the result of http://your_host:8761/eureka/v2/apps/ZIPKIN vs something not zipkin, as it might explain why?

codefromthecrypt commented 9 months ago

I found out what it is.. we are not populating the statusPageUrl, which is used in the Eureka UI, defaulting in spring boot to the /info url.

@minwoox I think we need to add statusPageUrlPath like we did with health check..

minwoox commented 9 months ago

Oops, what's the cause? Armeria auto-fills the health check URL but it doesn't do anything with the statusPageUrl. Should we do something?

minwoox commented 9 months ago

Just checked the Eureka and it auto-fills homePageUrl, statusPageUrl, and healthCheckUrl when the corresponding path is configured. https://github.com/Netflix/eureka/blob/master/eureka-client/src/main/java/com/netflix/appinfo/InstanceInfo.java#L581-L620 If we do the same thing, is the problem solved?

codefromthecrypt commented 9 months ago

yep I think it is better to solve them all than one-by-one. However, the UX issue is only about the status page.

Screenshot 2024-02-14 at 20 02 44

Note: we may want a bool for each, about whether to register plain text or secure port, even though in the case of most it is likely plain?

codefromthecrypt commented 9 months ago

@minwoox sorry I misread your last comment. I do agree though we don't need to do exactly how Netflix does. Main thing is to be able to specify the relative path somehow (and fill the scheme, host, port stuff under it)

minwoox commented 9 months ago

I do agree though we don't need to do exactly how Netflix does

Yep, I believe so. :)

Note: we may want a bool for each, about whether to register plain text or secure port, even though in the case of most it is likely plain?

Eureka has secure and non-secure path for health check but it only uses non-secure path for homePageUrl and statusPageUrl. (This is what I find particularly frustrating about Eureka. ;) ) https://github.com/Netflix/eureka/blob/master/eureka-client/src/main/java/com/netflix/appinfo/InstanceInfo.java#L673-L681 https://github.com/Netflix/eureka/blob/master/eureka-client/src/main/java/com/netflix/appinfo/InstanceInfo.java#L587 https://github.com/Netflix/eureka/blob/master/eureka-client/src/main/java/com/netflix/appinfo/InstanceInfo.java#L628 Let's just use the plain text now and revisit this later if it becomes a problem. 😉

codefromthecrypt commented 9 months ago

Let's just use the plain text now and revisit this later if it becomes a problem. 😉

sounds good!

codefromthecrypt commented 9 months ago

@SankM1 so we'll get this fixed, but as it doesn't break communication it isn't going to be treated severely. I personally am a volunteer and need to get back to day job for a bit. Once https://github.com/line/armeria/issues/5464 is addressed, I'll chase it up here. Thanks for reporting!

codefromthecrypt commented 9 months ago

@SankM1 ETA within a week. thanks for the patience

minwoox commented 9 months ago

@codefromthecrypt and @SankM1 The patch version will be released next Monday. I apologize for the delay. We have a security issue that needs to be addressed in this patch version, and we've decided to release it on Monday to ensure that Armeria users are not inconvenienced by a weekend release.

codefromthecrypt commented 9 months ago

done! https://github.com/openzipkin/zipkin/releases/tag/3.1.0

SankM1 commented 9 months ago

Hi @codefromthecrypt , @minwoox , raised bug regarding registering zipkin on spring boot admin https://github.com/openzipkin/zipkin/issues/3739, kindly check, Thank you.