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

6th
Apr 2016
Paul
@asm0dey
Apr 06 2016 07:58
@spencergibb why spring cloud doesn't handle cause of CompletionException?
pakizito
@pakizito
Apr 06 2016 10:55
Hello All, I'm facing an issue that I thought it has been corrected in M5 which in my laptop works (port 443), but then in linux it does not :(, let me explain: I have a zuul proxy (port 443 on my laptop and 8443 on dev linux) which redirects to a portal, when authenticating on the portal zuul gets a header "Location: " with the port of the application (portal) and then the browser redirects to the portal :( which is not what I want at all... What I need is that for the user he continues on the zuul port while seeing the portal content... how can i achieve this?
Dave Syer
@dsyer
Apr 06 2016 12:09
Normally you have to do something in the backend to make it send the right location
pakizito
@pakizito
Apr 06 2016 12:10
but how is the backend aware of where is the zuul connected to?
Dave Syer
@dsyer
Apr 06 2016 12:10
A spring app will generally do that if the container is set to respect the proxy headers
There's a section in the spring boot user guide
pakizito
@pakizito
Apr 06 2016 12:10
what are the configurations for that Dsyer?
Dave Syer
@dsyer
Apr 06 2016 12:10
It's nothing to do with spring cloud or zuul
pakizito
@pakizito
Apr 06 2016 12:10
and thank you very much for the help!
Dave Syer
@dsyer
Apr 06 2016 12:11
No problem
Do a search in the Boot user guide for "proxy" or "forwarded"
pakizito
@pakizito
Apr 06 2016 12:12
i guess it has to do with the front end
I tried so many things that I lost track now...
on the front end, which is [browser] -> [zuul] -> [FE] is where I need to change things I guess
is this such a different architecture from normal load balanced ones?
pakizito
@pakizito
Apr 06 2016 12:42
another doubt... will test again the settings... but now I think there's a problem in the documentation
on the Enable HTTPS when running behind a proxy server
example: server.tomcat.remoteip_header ,- this is with ""
_
underscore
but elsewhere in the documentation is with regular -
what's the correct one? - or _
Dave Syer
@dsyer
Apr 06 2016 12:45
I do t think it matters
don't
But there's a single Boolean flag that works for all containers
So you don't have to set that one anyway if you use the flag
pakizito
@pakizito
Apr 06 2016 12:46
I'm putting this setting in the front-end
use-forward-headers: true
tomcat:
remote-ip-header: X-Forwarded-For
protocol-header: X-Forwarded-Proto
port-header: X-Forwarded-Port
server: in the beginning
:)
Dave Syer
@dsyer
Apr 06 2016 12:51
Mist if that is simply repeating the defaults
And I assume you have the correct indentation
pakizito
@pakizito
Apr 06 2016 12:52
yes :)
Dave Syer
@dsyer
Apr 06 2016 12:52
Otherwise looks good
pakizito
@pakizito
Apr 06 2016 12:52
zuul continues to redirect me to the FE port :(...
with Brixton.M5 I'm redirected to 443 for some reason, he ignores the port of the FE
Dave Syer
@dsyer
Apr 06 2016 12:53
zuul isn't doing anything
Your app is sending the wrong headers
pakizito
@pakizito
Apr 06 2016 12:54
ok... I guess you're correct... but I get different behaviors from Angel.SR6 and Brixton.M5
that's why I thought it could be from zuul
pakizito
@pakizito
Apr 06 2016 13:20
I still have an apache httpd in front of all of this, so I rewrite the Location and this way it works... strange that in my solution it does not work as expected :(
for for I'll still try to check if it's possible with those headers...
Dave Syer
@dsyer
Apr 06 2016 14:16
What kind of app is the backend service (behind Zuul)?
pakizito
@pakizito
Apr 06 2016 14:17
it's a Spring 1.3.3 boot with some cloud things such as eureka
hystrix
Dave Syer
@dsyer
Apr 06 2016 14:17
And how does it generate the redirect?
pakizito
@pakizito
Apr 06 2016 14:18
from the cloud security - form based
Dave Syer
@dsyer
Apr 06 2016 14:22
You know that M5 is not the latest release right?
Anyway, if you can reproduce the problem with a minimal sample using Brixton latest we'll have a look at it.
I can't reproduce the problem
pakizito
@pakizito
Apr 06 2016 14:24
you get zuul to maintain the port?
on the FE which is behind zuul I have Spring 1.3.3 the M5 is in Zuul
Dave Syer
@dsyer
Apr 06 2016 14:25
It all worked for me
I wasn't using HTTPS
pakizito
@pakizito
Apr 06 2016 14:25
ahhh
i'm using https yes
it's a requesit
e
Dave Syer
@dsyer
Apr 06 2016 14:25
I don't see why it would be different
pakizito
@pakizito
Apr 06 2016 14:25
me too :)
Dave Syer
@dsyer
Apr 06 2016 14:25
Try to recreate the problem for me, please
pakizito
@pakizito
Apr 06 2016 14:26
ok, I'll give it some time this week to do that... I'm just with a lot of things on my plate right now, but this week I'll find the time for it for sure
and again
thank you very much
what can I say... I finally think I found the technology I like :) spring is amazing guys!!
I was for a long time a consultant using other's technology like Documentum, but finally I got the freedom to choose
and let me say, Spring is amazing :)
thanks!
on the front-end I only have spring boot as parent, should I also include the dependencyManagement with the cloud pom?
Dave Syer
@dsyer
Apr 06 2016 14:29
If you are using cloud stuff, yes
pakizito
@pakizito
Apr 06 2016 14:30
ok, will do that
pakizito
@pakizito
Apr 06 2016 15:00
any remarks on the usage of the spring security regarding login? like I have configured like this: [ on the override of: configure(HttpSecurity http) ...] I have ... http.formLogin().loginPage("/login").permitAll() ... shall I do it differently?
Dave Syer
@dsyer
Apr 06 2016 15:00
I couldn't possibly say without more information
Personally I'm not a big user of formLogin()
pakizito
@pakizito
Apr 06 2016 15:01
you use oauth? from what i've seen you have a lot of examples with oauth
what's your preferred mechanism?
what do you advise?
i tried oauth, but got really weird behaviors regarding ajax calls... always gave me auth errors... but this is something that really needs more investigation from my part...
Dave Syer
@dsyer
Apr 06 2016 15:11
Indeed.
If you are using form login you generally need to permitAll() on the login page
pakizito
@pakizito
Apr 06 2016 15:56
Hi Dsyer, I think I found the problem... indeed was in zuul... seems to be solved in the new version of it, but if I put the RC1 I get an error with discovery, saying timestamp is not part of InstanceInfo, so I just created a new ZuulFilter which ensures that all the x-forward-* are there and this way, the port just stays the same... the Front-End I guess was already sending the information... but I guess when this new release comes to live, I'll upgrade, meanwhile I'll live with this "fix" on zuul...
on the new PreDecorationFilter it's all ok I guess
thank you very much for making me think what would be the problem!
Dave Syer
@dsyer
Apr 06 2016 16:01
So if you use snapshots it's all fine?
(I'm not sure what changed)
pakizito
@pakizito
Apr 06 2016 16:03
this port issue yes, but had more error: - eureka instanceinfo seems to have a different structure and got some weird thing: the login didn't work, for some reason the zuul maintained the port but on the FE i got redirected to the Login page... seems like the authentication didn't work... but needs more testing from me when the new version arrives
Dave Syer
@dsyer
Apr 06 2016 16:04
What new version?
pakizito
@pakizito
Apr 06 2016 16:04
RC1
Dave Syer
@dsyer
Apr 06 2016 16:04
Sorry, I'm not following
RC1 is already released
But I wish you would test with snapshots
pakizito
@pakizito
Apr 06 2016 16:05
ok, will try it :)
Dave Syer
@dsyer
Apr 06 2016 16:05
I actually don't understand how it could work even with snapshots
but I'm interested to see how close you get
pakizito
@pakizito
Apr 06 2016 16:07
ok... let me try tomorrow... today is done :) 9 hours straight :)
I'll let you know
thank you very much again!
Dave Syer
@dsyer
Apr 06 2016 16:07
No problem. Talk to you later.
Marcos Barbero
@marcosbarbero
Apr 06 2016 18:47
Hi everybody, has anyone configured eureka multi AZ region? I’m trying to configure multiple availibiliy zones per service but it just doesn’t work. I found spring-cloud/spring-cloud-netflix#203 but it’s lacking something.
When I shutdown the service instances from region A the instances from region B just got registered in the region’s A Eureka, it seens to be ok, but the Zuul Proxy doesn’t have a route for those new instances from another region.
Liam Morley
@carpeliam
Apr 06 2016 23:28
hi all - we're looking for resources on how to test a Spring Boot app that uses Hystrix (both unit testing and integration testing). Any pointers on getting started?