concourse: can not login after upgrading to 4
i have the following set for my web config
CONCOURSE_BASIC_AUTH_USERNAME=admin
CONCOURSE_BASIC_AUTH_PASSWORD=xxxxxx
CONCOURSE_EXTERNAL_URL=https://ci.xxxx.com
CONCOURSE_MAIN_TEAM_LOCAL_USER=admin
CONCOURSE_ADD_LOCAL_USER=admin:xxxxxx
CONCOURSE_MAIN_TEAM_ALLOW_ALL_USERS=true
now when i try and login, it just sits there spinning. if i look in the inspector i can see it pending on
it will finally time out after a while.
in the logs i see
Aug 4 00:21:36 ip-10-200-1-205 concourse[4491]: {"timestamp":"1533342096.544905424","source":"atc","message":"atc.dex.event","log_level":1,"data":{"fields":{},"message":"login successful: connector \"local\", name=\"\", email=\"admin\", groups=[]","session":"5"}}
if i put in the wrong login info it instantly comes back and says bad login/password. when it does work it seems to just timeout.
after it times out i see this in the log:
Aug 4 00:27:10 ip-10-200-1-205 concourse[4491]: {"timestamp":"1533342430.388325930","source":"atc","message":"atc.sky.callback.failed-to-fetch-dex-token","log_level":2,"data":{"error":"Post https://ci.wizr.com/sky/issuer/token: dial tcp 34.210.127.211:443: i/o timeout","session":"4.277"}}
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 11
- Comments: 43 (17 by maintainers)
Commits related to this issue
- bump atc flag concourse/concourse#2463 Submodule src/github.com/concourse/atc 084a5efe2..b079f507c: > use bind ip for sky server config > clean up unused code in worker and GC Submodule src/gith... — committed to concourse/concourse by deleted user 6 years ago
- bump atc skymarshal concourse/concourse#2463 Submodule src/github.com/concourse/atc aa86856b..95bf9747: > add internal url for dex Submodule src/github.com/concourse/skymarshal abaf344c7..fba51182... — committed to concourse/concourse by deleted user 6 years ago
- bump dex skymarshal concourse/concourse#2463 Submodule src/github.com/concourse/dex 60cc557...5bba0d6: > use web host url for asset hosting > switch to go modules > rewrite imports to concours... — committed to concourse/concourse by deleted user 6 years ago
- bump atc concourse/concourse#2463 Submodule src/github.com/concourse/atc 897380a..8e2e856: > remove inferring of schema for bind ip > fix flake as a result of overlapping debug port Signed-off-... — committed to concourse/concourse by deleted user 6 years ago
- bump atc skymarshal concourse/concourse#2463 Submodule src/github.com/concourse/atc 3379392b9..fd2a08bd0: > Remove internal URL from skyserver config Submodule src/github.com/concourse/skymarshal ... — committed to concourse/concourse by deleted user 6 years ago
- bump atc skymarshal concourse/concourse#2463 Submodule src/github.com/concourse/atc 228d6457..40107fc6: > Use internal url for token requests to dex Submodule src/github.com/concourse/skymarshal f... — committed to concourse/concourse by jwntrs 6 years ago
- bump skymarshal concourse/concourse#2463 Submodule src/github.com/concourse/skymarshal cb41319b..5b92fd83: > Always use http for loopback communication because certs Signed-off-by: Divya Dadlani ... — committed to concourse/concourse by jwntrs 6 years ago
- reroute login flow dex traffic to internal url we can't rely on being able to reach the external URL from the ATC for a few reasons: * it might be pointing to a reverse-proxy with its own auth * it ... — committed to vmware-archive/atc by vito 6 years ago
- bump atc skymarshal concourse/concourse#2463 Submodule src/github.com/concourse/atc 40107fc6a..374d3ce91: > reroute login flow dex traffic to internal url Submodule src/github.com/concourse/skymar... — committed to concourse/concourse by vito 6 years ago
Hey @vito I just setup v4.1, but when I try to login as local user or github user, the login fails due to the same error. Is this issue fixed and verified? The relevant logging when I try to login as local user:
{"timestamp":"1536016247.228306532","source":"atc","message":"atc.dex.event","log_level":1,"data":{"fields":{},"message":"login successful: connector \"local\", username=\"concourse\", email=\"concourse\", groups=[]","session":"5"}} {"timestamp":"1536016249.150294065","source":"atc","message":"atc.sky.userinfo.failed-to-parse-authorization-header","log_level":1,"data":{"session":"4.104"}} {"timestamp":"1536016254.152165890","source":"atc","message":"atc.sky.userinfo.failed-to-parse-authorization-header","log_level":1,"data":{"session":"4.105"}} {"timestamp":"1536016255.191825628","source":"atc","message":"atc.build-tracker.track.start","log_level":0,"data":{"session":"19.48"}} {"timestamp":"1536016255.195375443","source":"atc","message":"atc.build-tracker.track.done","log_level":0,"data":{"session":"19.48"}} {"timestamp":"1536016257.772825003","source":"atc","message":"atc.sky.callback.failed-to-fetch-dex-token","log_level":2,"data":{"error":"Post https://externalurl/sky/issuer/token: net/http: TLS handshake timeout","session":"4.103"}} {"timestamp":"1536016259.153844595","source":"atc","message":"atc.sky.userinfo.failed-to-parse-authorization-header","log_level":1,"data":{"session":"4.106"}}Just setup v4.2.1 and login via github/local is working perfectly now!! Thank you so much for sorting the issue out!!! 💯
For posterity: 4.2.0 fixes my login issue.
The main problem here is that when the ATC can’t reach the
external_urlthen login doesn’t work. This happens because after the authorization_code gets issued the token exchange happens using theexternal_urleven though both components are running on the same host. We’re going to use the loopback address for the token exchange. This fix is going through our pipeline now.Hey there, I keep getting redirected to 127.0.0.1 right when I click the login button with a fresh install of concourse 4.2.1.
Could you please clarify if I need to specify an external URL for this not to happen? While some users seem to be happy, they haven’t specified their setup, and I’m still having problems.
Here’s my situation:
--add-local-userand--main-team-local-user).If in v4 I must specify a single external URL, I’ll have to stay on 3.14.1.
@pivotal-jamie-klassen Is this actually done? I see the code still using the external URL here and don’t see any commits pushed.
Moving back to the backlog. I thought this was in 4.1.0 but hadn’t done acceptance on it yet so I’m not sure. We may need to do another release soon to fix this. 😕
@eedwards-sk I don’t think this issue applies to the TSA.
Please open new issues instead of commenting on this one - there was a very specific thing to fix, and we fixed it, and received feedback from those affected by this issue that it was indeed fixed. The title of this GitHub issue is very open-ended and we’ll keep getting comments on here as long as anyone is having login issues. 😃 (We should maybe lock it eventually.)
@jeffawang An external URL must be configured for auth to work properly and securely. If you have a use case for multiple external URLs, we’d like to hear about it (but again, in a separate issue), but it at least sounds a bit strange.
I deployed 4.2.1 today and it works for me! Thanks @vito and team.
Hooray! Works for me too! Thanks guys!
To double tap on this, I am using Concourse behind a reverse proxy that doesn’t use authentication of any form, it just performs a TLS/SSL termination.
I’m still seeing errors:
Reading @vito’s comments about this not making it into 4.1.1 is a bit disheartening, but I wanted to validate some assumptions around the external URLs so there was more visibility into the issue. For me,
externalUrlis resolvable both within and external to my network, andpublicIPis reachable by everyone.Here are my deployed versions:
We investigated doing an internal redirect for all of the auth components, but that doesn’t work because of the way Dex is designed. To perform an internal redirect, the issuer URL in Dex needs to be set to the internal URL. This breaks for the following reasons:
Dex uses the issuer URL to issue tokens. Setting this URL to the internal URL (e.g. 127.0.0.1) would mean that the tokens issued are valid for any instance with that internal URL, which is too generic.
Dex also checks that the callback URL used by the external auth provider matches the issuer URL. If the issuer URL is the internal URL, this check would fail for external auth providers.
@UniqueElphie Correct, this ended up not making it in to 4.1. We’ve picked it up again and plan to push a 4.1.1 out this week.
Woops, we really shouldn’t be relying on the external URL internally.
I think the problem is just this one line:
https://github.com/concourse/atc/blob/8819682a06f74aa284de084b14955f42919a64cb/atccmd/command.go#L518
If we were to change that to the bind IP/port (except
127.0.0.1if it binds to0.0.0.0), this should be fixed.I’ll prioritize this highly somewhere. Sorry for the turbulence everyone! @r-chris I’m also gonna prioritize https://github.com/concourse/concourse/issues/2519 which should make changing the ports work a lot more smoothly.
@phynias @UniqueElphie give the concourse server ip with port or dns name in below parameter
eg:
In latest version of concourse by default it will redirecting to localhost:8080 if you do not specify CONCOURSE_EXTERNAL_URL.
use below parameters in latest version instead of basic authentication parameters and password should be in bcrypted format:
for reference: https://github.com/concourse/concourse/issues/2421
Our DNS was not working correctly. We updated the resolv.conf to use 8.8.8.8 and were able to login.