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

Enable osin internal error logging #18505

Merged
merged 3 commits into from
Feb 15, 2018

Conversation

mrogers950
Copy link
Contributor

osin now has an interface for internal error logging that provides some additional context on failure.

Example output:

=== RUN   TestClientCredentialFlow
--- PASS: TestClientCredentialFlow (0.00s)
=== RUN   TestAuthorizeStartFlow
I0206 14:58:22.818652   22392 access.go:561] osin: error=unauthorized_client, internal_error=<nil> get_client=client check failed, client_id=test
--- FAIL: TestAuthorizeStartFlow (0.00s)
osinserver_test.go:95: unexpected error: The client is not authorized to request a token using this method.
osinserver_test.go:135: unexpected error: Get http://127.0.0.1:39369/assert?code=KWhLRoflbPdPCNYNP6T3MpqZn4mv0zxKLU6TRg6QEAc&state=: EOF

@openshift/sig-security

@openshift-ci-robot openshift-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Feb 7, 2018
@openshift-merge-robot openshift-merge-robot added the vendor-update Touching vendor dir or related files label Feb 7, 2018
@mrogers950
Copy link
Contributor Author

/retest

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 10, 2018
}

func (l Logger) Printf(format string, v ...interface{}) {
if glog.V(3) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like we always want to log these. They are rare and point to "stuff is broken". Maybe V(1) in case we are really worried about spam. @sdodson @jupierce @smarterclayton any concerns? What log level do we normally run online at?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What log level do we normally run online at?

It's a loglevel 2 AFAIR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a loglevel 2 AFAIR.

Confirm this with @jupierce


func (l Logger) Printf(format string, v ...interface{}) {
if glog.V(3) {
glog.InfoDepth(2, fmt.Sprintf("osin: "+format, v...))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Info depth of 3 so we see the correct caller. Error depth is probably more appropriate (pretty sure every place we log leads to a failed OAuth flow).

@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 12, 2018
@mrogers950
Copy link
Contributor Author

@enj I rebased and turned the V level down to 2, and changed InfoDepth to an ErrorDepth of 3.

@mrogers950
Copy link
Contributor Author

/retest

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 12, 2018
@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 12, 2018
@enj
Copy link
Contributor

enj commented Feb 12, 2018

/lgtm

@deads2k can you tag?

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 12, 2018
@deads2k
Copy link
Contributor

deads2k commented Feb 13, 2018

So bumps require determination of whether you should actually bump the packages in question. Separating the repo dependencies into yours, mine and ours buckets, we do not pin "yours" (kube's). We always pin "mine" (but we have identified the set). We sometimes pin "ours" depending on whether we really care what it is and who the other dependant is.

We are actively trying to make this better (see #18543), but it isn't going to make 3.9.

@deads2k
Copy link
Contributor

deads2k commented Feb 13, 2018

Oh, and syncing out from our vendor folder is currently in progress. Rules merged early this morning and @mfojtik is trying to enable the bot.

@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Feb 13, 2018
@mrogers950
Copy link
Contributor Author

@deads2k I bumped only the osin dependency manually. I'm not sure how the vendor sync-out you mentioned affects this, so let me know if there is something I might need to do different here...

@deads2k
Copy link
Contributor

deads2k commented Feb 13, 2018

@deads2k I bumped only the osin dependency manually. I'm not sure how the vendor sync-out you mentioned affects this, so let me know if there is something I might need to do different here...

A manual change just leaves a time bomb for the next guy. I know it's annoying, I know it can be tedious, I know it's not something you'd like to do. I know this far more than the average person on the team. Understanding how our product manages golang dependencies must not remain an arcane skill. Please take the time to learn how to manage dependencies.

@openshift-ci-robot openshift-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 13, 2018
@mrogers950
Copy link
Contributor Author

@deads2k after rebasing, this time running update-deps resulted in only updating osin (a "mine" now pinned at 2dc1b431) and k8s.io/kubernetes. PTAL

@mrogers950
Copy link
Contributor Author

/retest

@mrogers950
Copy link
Contributor Author

mrogers950 commented Feb 14, 2018

@deads2k nevermind, this dep update was wrong again. specifically, it was just reverting upstream commits that have gone in to origin since the last kube sync (at 0f3cef4), so I think I need to wait until kube is caught up.

@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Feb 14, 2018
@mrogers950
Copy link
Contributor Author

@deads2k thanks for syncing kube! the dep bump is clean now. PTAL.

@deads2k
Copy link
Contributor

deads2k commented Feb 14, 2018

/approve

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 14, 2018
@enj
Copy link
Contributor

enj commented Feb 14, 2018

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 14, 2018
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, enj, mrogers950

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@mrogers950
Copy link
Contributor Author

/retest

@openshift-merge-robot
Copy link
Contributor

/test all [submit-queue is verifying that this PR is safe to merge]

@openshift-merge-robot
Copy link
Contributor

Automatic merge from submit-queue (batch tested with PRs 18505, 18617, 18604).

@openshift-merge-robot openshift-merge-robot merged commit b432985 into openshift:master Feb 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. sig/security size/L Denotes a PR that changes 100-499 lines, ignoring generated files. vendor-update Touching vendor dir or related files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants