Repository navigation
[python] Show why the server refused a credential. - #7858
Merged
Merged
Conversation
Contributor
|
LGTM. Ran: |
12 tasks
mihaibudiu
approved these changes
Nov 5, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Nov 5, 2026
On a 401, the pipeline manager gives the reason in the `error_description` of its `WWW-Authenticate` header, and the body is empty. The client error read only the body, so it said "credential rejected (invalid or expired token / API key)" for every refusal. In could not show why. The 401 error message now has a `Reason:` line with that description. Signed-off-by: Ben Pfaff <blp@feldera.com>
blp
force-pushed
the
python-401-reason
branch
from
November 5, 2026 22:23
63dda0e to
4571416
Compare
Contributor
|
It may help to also query /healthz in this case to find out more, I believe if the database is unreachable it could also result in a 401 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked Issue
Related to #7048. This does not fix it.
On a 401, the pipeline manager gives the reason in the
error_descriptionof itsWWW-Authenticateheader, and the body is empty. The client error read only the body, so it said "credential rejected (invalid or expired token / API key)" for every refusal.In the two most recent reports in #7048 (runs 39514151001 and 41968241434), the token refresher log shows a refresh every 90 seconds with no misses. So the server refused tokens that had not expired. The client logs cannot show why.
The 401 error message now has a
Reason:line with that description. On the next failure, the CI log will show which check refused the token.Describe Manual Test Plan
New unit tests in
python/tests/unit/test_401_reason.py. The escaped-quote test fails whenerrors.pyis reverted. All oftests/unitpasses.Checklist
Breaking Changes?
Mark if you think the answer is yes for any of these components:
Describe Incompatible Changes
None. Only the text of 401 error messages changes.