Expired authentication credentials are reported as HTTP 503 (Service Unavailable) errors
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 65/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- google-cloud, python
- 领域
- api, authentication
调研方向
Reproduce the failure from stormware/google/secrets.py at line 71 using expired credentials, then trace the generated Secret Manager client through google/api_core/gapic_v1/method.py and google/api_core/retry/retry_unary.py. Done means expired-credential failures surface immediately as an authentication error rather than being retried as HTTP 503 until the 60-second timeout.
由索引模型根据 Issue 内容生成。
描述
Determine this is the right repository
- I determined this is the correct repository in which to report this bug.
Summary of the issue
Context
Whenever we try to use the SDK clients with expired authentication credentials our programs halt for 60 seconds. This is because such requests get a 503 HTTP response back (which is not the correct response), so the library keeps retrying until the default timeout (which is 60 seconds).
Expected Behavior:
We expect SDK clients to fail immediately when credentials are expired.
Actual Behavior:
SDK clients do not fail immediately when credentials are expired.
API client name and version
google-cloud-secret-manager==2.30.0
Reproduction steps: code
See https://github.com/logikal-io/stormware/blob/main/stormware/google/secrets.py#L71.
Reproduction steps: supporting files
No response
Reproduction steps: actual results
The errors seen are as follows:
File ".../lib/python3.12/site-packages/stormware/google/secrets.py", line 71, in __getitem__
response = self.client.access_secret_version(name=name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../lib/python3.12/site-packages/google/cloud/secretmanager_v1/services/secret_manager_service/client.py", line 1875, in access_secret_version
response = rpc(
^^^^
File ".../lib/python3.12/site-packages/google/api_core/gapic_v1/method.py", line 373, in __call__
result = wrapped_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../lib/python3.12/site-packages/google/api_core/retry/retry_unary.py", line 295, in retry_wrapped_func
return retry_target(
^^^^^^^^^^^^^
File ".../lib/python3.12/site-packages/google/api_core/retry/retry_unary.py", line 157, in retry_target
next_sleep = _retry_error_helper(
^^^^^^^^^^^^^^^^^^^^
File ".../lib/python3.12/site-packages/google/api_core/retry/retry_base.py", line 230, in _retry_error_helper
raise final_exc from source_exc
google.api_core.exceptions.RetryError: Timeout of 60.0s exceeded, last exception: 503 Getting metadata from plugin failed with error: Reauthentication is needed. Please run `gcloud auth application-default login` to reauthenticate.
Reproduction steps: expected results
We'd expect these calls to fail immediately.
OS & version + platform
No response
Python environment
No response
Python dependencies
No response
Additional context
No response
- 主要语言
- Python
- 星标
- 5.4k
- 派生
- 1.8k
- 平均合并
- 2 天 22 小时
- 30 天内合并 PR
- 102
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
googleapis/google-cloud-python 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
googleapis/google-cloud-python#18428 ·
-
priority: p2 type: bug
难度 2/5 1-3 小时 新手友好度 72/100
googleapis/google-cloud-python#18375 · 1 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 76/100
googleapis/google-cloud-python#18339 ·
-
auth priority: p2
难度 2/5 1-3 小时 新手友好度 88/100
googleapis/google-cloud-python#18315 ·
-
priority: p2 type: bug
难度 2/5 1-3 小时 新手友好度 78/100
googleapis/google-cloud-python#18260 ·
查看 googleapis/google-cloud-python 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 90/100
-
bug
难度 2/5 1-3 小时 新手友好度 86/100
zostera/django-bootstrap4#894 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
use-agent-os/agent-os#3276 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
难度 2/5 1-3 小时 新手友好度 88/100
NousResearch/hermes-agent#117848 ·