These are chat archives for spring-cloud/spring-cloud

5th
Jul 2016
MaggieX
@xmjdream
Jul 05 2016 02:08
@all,I have two eureka server instances replica for each other, I'd like the client to use the eureka1 as default and when use the eureka2 when eureka1 is crashed, how to configure the client application.yml?
Spencer Gibb
@spencergibb
Jul 05 2016 02:12
Comma separated list of eureka servers
MaggieX
@xmjdream
Jul 05 2016 02:13
@spencergibb do you means the eureka.client.serviceUrl.defaultZone?
I have tried the comma lists, but it doesn't work
MaggieX
@xmjdream
Jul 05 2016 02:19
when I stop the eureka1, I'm getting the registragtion failedBad status:404 error
Thibaud Lepretre
@kakawait
Jul 05 2016 08:22

Anyone facing such issue when upgrading to org.springframework.cloud:spring-cloud-dependencies:Brixton.SR2

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.security.oauth2.proxy.AuthenticationHeaderFilter]: Factory method 'authenticationHeaderFilter' threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper.setTraces(Lorg/springframework/boot/actuate/trace/TraceRepository;)V
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) ~[spring-beans-4.3.1.RELEASE.jar:4.3.1.RELEASE]
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ~[spring-beans-4.3.1.RELEASE.jar:4.3.1.RELEASE]
    ... 49 common frames omitted
Caused by: java.lang.NoSuchMethodError: org.springframework.cloud.netflix.zuul.filters.ProxyRequestHelper.setTraces(Lorg/springframework/boot/actuate/trace/TraceRepository;)V
    at org.springframework.cloud.security.oauth2.proxy.OAuth2ProxyAutoConfiguration$AuthenticationHeaderFilterConfiguration.authenticationHeaderFilter(OAuth2ProxyAutoConfiguration.java:79) ~[spring-cloud-security-1.1.0.RELEASE.jar:1.1.0.RELEASE]
    at org.springframework.cloud.security.oauth2.proxy.OAuth2ProxyAutoConfiguration$AuthenticationHeaderFilterConfiguration$$EnhancerBySpringCGLIB$$26c27b3b.CGLIB$authenticationHeaderFilter$0(<generated>) ~[spring-cloud-security-1.1.0.RELEASE.jar:1.1.0.RELEASE]
    at org.springframework.cloud.security.oauth2.proxy.OAuth2ProxyAutoConfiguration$AuthenticationHeaderFilterConfiguration$$EnhancerBySpringCGLIB$$26c27b3b$$FastClassBySpringCGLIB$$f6d0f2f8.invoke(<generated>) ~[spring-cloud-security-1.1.0.RELEASE.jar:1.1.0.RELEASE]
    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-4.3.1.RELEASE.jar:4.3.1.RELEASE]
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356) ~[spring-context-4.3.1.RELEASE.jar:4.3.1.RELEASE]
    at org.springframework.cloud.security.oauth2.proxy.OAuth2ProxyAutoConfiguration$AuthenticationHeaderFilterConfiguration$$EnhancerBySpringCGLIB$$26c27b3b.authenticationHeaderFilter(<generated>) ~[spring-cloud-security-1.1.0.RELEASE.jar:1.1.0.RELEASE]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_91]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_91]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_91]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_91]
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ~[spring-beans-4.3.1.RELEASE.jar:4.3.1.RELEASE]
    ... 50 common frames omitted

No problem by using org.springframework.cloud:spring-cloud-dependencies:Brixton.SR1

PS: I'm using latest spring version 4.3.1
PS2: On Zuul server with @EnableOAuth2Sso
Dave Syer
@dsyer
Jul 05 2016 08:51
Can you throw together a sample. Looks like a classpath problem.
But maybe we need a workaround in Zuul
Thibaud Lepretre
@kakawait
Jul 05 2016 08:52
I will try to extract my problem on simpler sample
gimme ~10min
Dave Syer
@dsyer
Jul 05 2016 08:55
I think you have an old version of spring-cloud-netflix-core on your classpath.
Let's see what you find.
Thibaud Lepretre
@kakawait
Jul 05 2016 08:57
you can try this one
I just reproduce the same issue
as you can see on my pom.xml I'm not setting any versions
maybe this it the problem
Thibaud Lepretre
@kakawait
Jul 05 2016 09:05
@dsyer I just pushed a new commit that reduce the maximum number of deps on pom.xml
Dave Syer
@dsyer
Jul 05 2016 09:05
Looks OK superficially
It's a bug in spring-cloud-security
Thibaud Lepretre
@kakawait
Jul 05 2016 09:06
but you can try by running mvn spring-boot:run
Dave Syer
@dsyer
Jul 05 2016 09:06
Can you raise an issue there?
Thibaud Lepretre
@kakawait
Jul 05 2016 09:06
ok on SCS project so?
Dave Syer
@dsyer
Jul 05 2016 09:06
SCS?
Thibaud Lepretre
@kakawait
Jul 05 2016 09:06
Spring cloud security
Dave Syer
@dsyer
Jul 05 2016 09:07
Yes, please
Thibaud Lepretre
@kakawait
Jul 05 2016 09:07
yeah spring cloud * is too long I'm using scn (spring cloud netflix), scs, etc :)
And I will try to propose PR if I have time to see problem more deeply
Dave Syer
@dsyer
Jul 05 2016 09:11
That's fine
It's trivial
Thibaud Lepretre
@kakawait
Jul 05 2016 09:14
PS: https://github.com/kakawait/scn-sr2-issue no longer exists I recreated on https://github.com/kakawait/scs-gh-97 with README.md(linked on issue message)
Dave Syer
@dsyer
Jul 05 2016 09:17
You can probably fix your app quickly by switching to a snapshot for spring-cloud-security (1.1.1.BUILD-SNAPSHOT)
I'll make a 1.1.1.RELEASE as well
We have a bug in sleuth as well so Brixton.SR3 is probably going to be this week
Thibaud Lepretre
@kakawait
Jul 05 2016 09:18
I prefer rollbacking to SR1 because I have to release something SNAPSHOT-less
btw I'm not waiting on special feature or fix from SR2
Dave Syer
@dsyer
Jul 05 2016 09:20
OK. Thanks.
Thibaud Lepretre
@kakawait
Jul 05 2016 09:20
I was playing with mvn versions:* plugins that why I was faced the issue. Because I was on .RELEASE ^^
is really not mandatory for my case :)
ouch already closed you are fast ^^
Dave Syer
@dsyer
Jul 05 2016 09:24
1.1.1.RELEASE is in repo.spring.io if you want to try it
Thibaud Lepretre
@kakawait
Jul 05 2016 09:25
Ok thank I will try
@dsyer off-topic question, does Spring cloud portfolio will upgrade its code base to Java8 as same as Spring 5 or you have different roadmap/release?
Dave Syer
@dsyer
Jul 05 2016 09:29
We will move to Java 8 when Spring does, yes.
Thibaud Lepretre
@kakawait
Jul 05 2016 09:30
nice
bitsofinfo
@bitsofinfo
Jul 05 2016 21:10
Any suggestions for how I can get more details as to the underlying network/exception/issue that is causing this to retry? I have logging set to trace but I'm not sure why its failing: (i.e. the post to my auth node on port 9000)
2016-07-05 15:04:58.641  INFO 97084 --- [           main] c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at: https://localhost:8888
2016-07-05 15:04:58.641 DEBUG 97084 --- [           main] g.c.ClientCredentialsAccessTokenProvider : Retrieving token from https://localhost:9000/oauth/token
2016-07-05 15:04:58.642 DEBUG 97084 --- [           main] o.s.web.client.RestTemplate              : Created POST request for "https://localhost:9000/oauth/token"
2016-07-05 15:04:58.642 DEBUG 97084 --- [           main] g.c.ClientCredentialsAccessTokenProvider : Encoding and sending form: {grant_type=[client_credentials], scope=[execute]}
2016-07-05 15:04:58.707 DEBUG 97084 --- [           main] o.s.r.backoff.ExponentialBackOffPolicy   : Sleeping for 3375
bitsofinfo
@bitsofinfo
Jul 05 2016 21:28
underlying cause is javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No name matching localhost found but I am not sure how to get that output info to the logs. Somewhere in Ribbon? Do I need to wire in a HostnameVerifier somewhere?
Fabian Wallwitz
@cforce
Jul 05 2016 23:34
how can i make zuul forward"https://anyhost:anyport/admin/*" to "serviceIdHost:serviceIdPort/* .. in fact using eureka to lookup the confugured service id and strip the prefix part /admin ?
Fabian Wallwitz
@cforce
Jul 05 2016 23:47
i correct the example: how can i make zuul forward"https://anyhost:anyport/admin/path1/**" to "serviceIdHost:serviceIdPort/path1/** .
so how can i strip "/admin" but keep "/path1"?
next cfg entry could be like foward "/admin/path2/" to "anotherServiceIdHost:anotherServiceIdPort/path2/ .
Spencer Gibb
@spencergibb
Jul 05 2016 23:50
We only support stripping a global prefix. So unless zuul.prefix=/admin you’ll have to write your own routing filter.