Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login failure loop in v5.1.0 go v3-client #5739

Closed
guzzijason opened this issue Apr 12, 2021 · 2 comments · Fixed by #5746, #5818 or #5819
Closed

Login failure loop in v5.1.0 go v3-client #5739

guzzijason opened this issue Apr 12, 2021 · 2 comments · Fixed by #5746, #5818 or #5819
Assignees
Labels
authentication Relating to login, registration, passwords, tokens, etc. regression bug a bug in existing functionality introduced by a new version TO Client (Go) related to the Go implementation of a TC client
Milestone

Comments

@guzzijason
Copy link
Contributor

I'm submitting a ...

  • bug report

Traffic Control components affected ...

  • Traffic Control Client
  • Traffic Ops

Current behavior:

When building go client applications with the TC v5.1.0 v3-client library, we have observed that a login failure (such as resulting from passing incorrect login credentials) results in a looping condition, where a steady stream of login attempts are made against TO API.

Expected behavior:

When invalid login credentials are used, the login attempt should fail immediately, without a apparent retry loop.

Minimal reproduction of the problem with instructions:

Build a client app using github.com/apache/trafficcontrol v5.1.0+incompatible.
Pass invalid login credentials to that app.

Anything else:

Confirmed that building with github.com/apache/trafficcontrol v5.0.0+incompatible does not reproduce the problem.

@guzzijason guzzijason added the bug something isn't working as intended label Apr 12, 2021
@zrhoffman zrhoffman added TO Client (Go) related to the Go implementation of a TC client regression bug a bug in existing functionality introduced by a new version and removed bug something isn't working as intended labels Apr 12, 2021
@rawlinp
Copy link
Contributor

rawlinp commented Apr 12, 2021

For whoever fixes this:
request() is calling login() if the 1st attempt returned 401. login() eventually makes its way back to request(), which gets another 401, causing it to call login() again, getting stuck in infinite recursion. Instead of calling login(), we should probably make a "raw" login request instead of calling login() which also adds in all the version-retrying.

@srijeet0406
Copy link
Contributor

I can take this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
authentication Relating to login, registration, passwords, tokens, etc. regression bug a bug in existing functionality introduced by a new version TO Client (Go) related to the Go implementation of a TC client
Projects
None yet
4 participants