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

12th
Oct 2015
Pedro Vilaça
@pmvilaca
Oct 12 2015 16:49
hey guys
I’m upgrading one app that was using spring-boot 1.2.x and spring-cloud 1.0.2.RELEASE
but It’s blowing up during the startup with an error related with the OAuth2 config
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.security.oauth2.client.resource.OAuth2ProtectedResourceDetails] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
Dave Syer
@dsyer
Oct 12 2015 16:54
The configuration keys changed
Pedro Vilaça
@pmvilaca
Oct 12 2015 16:55
ah.. thanks @dsyer
Pedro Vilaça
@pmvilaca
Oct 12 2015 16:57
works like a charm now
just after replacing the initial key “spring” by “security"
we could add a mention to that particular change here
Dave Syer
@dsyer
Oct 12 2015 17:09
Good idea
turick
@turick
Oct 12 2015 21:08
hi all -- revisiting my sleuth issue. i fired up wireshark. When I start my Zulu app, I see my local machine sending a SYN TCP packet to the zipkin service. The zipkin service responds with a SYN,ACK, and then finally my local machine sends back an ACK. that's the end of the traffic -- any request to any of the sample endpoints generates trace IDs in the response, but no other traffic gets sent to the zipkin server.
@marcingrzejszczak -- i downloaded the source so i could set debugging break points, but there are other dependencies (messaging, etc) that i don't have the source for so I can't run it right now... hopefully i'll have time to get that squared away tomorrow.
i'm not sure if there's anything i need to do on the zipkin server config? or if there are any other programmatic considerations i should be taking into account on my app? i assumed that just generating the traces from the sample code would "magically" push that info to zipkin
turick
@turick
Oct 12 2015 21:14
also, i'm assuming sleuth needs to be included on each service? right now i just have it on my zuul service and testing against that. it's a pretty unique scenario architecturally, but anybody who ever reaches my edge server should have a cookie identifying themselves and i use that in a spring security pre authentication filter, and i use spring session to externalize the session. could the introduction of those filters in combination with the zuul filters be mucking up the sleuth filters?
Spencer Gibb
@spencergibb
Oct 12 2015 21:15
if sleuth isn’t included on a service it won’t be part of the trace
turick
@turick
Oct 12 2015 21:17
thanks, that's what i figured, but the traces i'm generating with the sample code should be, right? it feels like i might just be missing some simple configuration, but i have exactly what's in the sample project.
Spencer Gibb
@spencergibb
Oct 12 2015 21:17
something is different if the sample works and yours doesn’t. Can you share anything?
turick
@turick
Oct 12 2015 21:20
i'll have to check if i can actually publish any of this. i'm introducing this to my company and it's quickly becoming a big deal, but it's all contract work in support of govt contracts that are very sensitive. the level of support you guys all provide is amazing and i'm very thankful, so i don't know if you would be open to this, but i could do a screenshare in a google hangout room
turick
@turick
Oct 12 2015 21:32
and it's fine if you don't want to do that... i'll just have to figure out how to convey my config over chat :) is there anything on the zipkin side i need to consider? i literally just deployed the zipkin docker project and assumed it would be ready to accept anything pushed to it
Marcin Grzejszczak
@marcingrzejszczak
Oct 12 2015 21:41
@turick - coming back to my advice - if you have 1.0.0.M1 and you already have a Filter registered in your application then no request coming to your controllers will have the span appended
turick
@turick
Oct 12 2015 21:43
they won't? i do have 1.0.0.M1 and I even added the filter registration bean manually to my main class that you spelled out in your ticket
Marcin Grzejszczak
@marcingrzejszczak
Oct 12 2015 21:44
if you added manually they will
just ensure that the bean is created
turick
@turick
Oct 12 2015 21:46
hmm i feel like i'm missing something. i added your bean, i see some sort of initialization traffic going to my zipkin server, and i'm executing the code found in the sample controller... but still nothing in the zipkin console
and when i hit the controller and it generates a trace, there is no traffic to zipkin
Marcin Grzejszczak
@marcingrzejszczak
Oct 12 2015 21:49
but via Wireshark you see some trafic right?
turick
@turick
Oct 12 2015 21:50
yes sir... when the app starts, i see the SYN request going to zipkin, then the SYN,ACK coming back, then my app sends the final ACK
but that's the end of it
Marcin Grzejszczak
@marcingrzejszczak
Oct 12 2015 21:50
and try adding these beans:
@Value("${spring.sleuth.instrument.web.skipPattern:}") String skipPattern;

    @Autowired Trace trace;

    @Bean
    public Sampler<?> defaultSampler() {
        return new AlwaysSampler();
    }

    @Bean
    public FilterRegistrationBean traceWebFilter(ApplicationEventPublisher publisher) {
        Pattern pattern = org.springframework.util.StringUtils.hasText(this.skipPattern) ? Pattern.compile(this.skipPattern)
                : TraceFilter.DEFAULT_SKIP_PATTERN;
        TraceFilter filter = new TraceFilter(this.trace, pattern);
        filter.setApplicationEventPublisher(publisher);
        return new FilterRegistrationBean(filter);
    }
turick
@turick
Oct 12 2015 21:51
i have exactly that in my main class
ps, how do you encapsulate code like that in this chat?
Marcin Grzejszczak
@marcingrzejszczak
Oct 12 2015 21:52
like in Markdown
turick
@turick
Oct 12 2015 21:53
ok thanks
Marcin Grzejszczak
@marcingrzejszczak
Oct 12 2015 21:54
ok do you have some asynchronous communication going on in your application? Or Hystrix?
turick
@turick
Oct 12 2015 21:57
i do have a websocket broker enabled
beyond that, it's a basic zuul proxy service, with spring security and my preauth filter
and spring session
Marcin Grzejszczak
@marcingrzejszczak
Oct 12 2015 21:59
I guess without a sample it will be difficult
turick
@turick
Oct 12 2015 22:01
ya, i totally understand. i can work on it and see if i'm allowed to push this out on the internet, but again, i would be willing to do a google hangouts screen share if you are available
Spencer Gibb
@spencergibb
Oct 12 2015 23:09
for public record, zipkin listens by default on port 9410 and sleuth requires boot 1.3.x
turick
@turick
Oct 12 2015 23:59
after updating to spring boot 1.3, i had to fix my web socket dependencies to use io.ractor instead of org.reactor to find the right classes... but then it worked! i now see my calls to the sample traces in zipkin