source-github: 401 and 404 both surface the user-facing message "Conflict."
- 主要語言
- Python
- 星號
- 22.1k
- 分支
- 5.4k
- 平均合併
- 5 小時
- 30 天內合併 PR
- 671
描述
## Problem
In `source-github`, `GITHUB_DEFAULT_ERROR_MAPPING` (`source_github/errors_handlers.py`) maps **401**, **404** and **409** to the same `error_message="Conflict."`:
```python
GITHUB_DEFAULT_ERROR_MAPPING = DEFAULT_ERROR_MAPPING | {
401: ErrorResolution(response_action=ResponseAction.RETRY, failure_type=FailureType.config_error, error_message="Conflict."),
...
404: ErrorResolution(response_action=ResponseAction.RETRY, failure_type=FailureType.config_error, error_message="Conflict."),
409: ErrorResolution(response_action=ResponseAction.RETRY, failure_type=FailureType.config_error, error_message="Conflict."),
}
```
`HttpClient._handle_error_resolution` puts that string into the raised `DefaultBackoffException`, so a 401 (expired/revoked token) and a 404 (missing org/repo, or an org-scoped endpoint asked about a personal account) both surface to the user as:
```
airbyte_cdk.sources.streams.http.exceptions.DefaultBackoffException: Conflict.
```
That is what real Cloud sync logs show while retrying a 404 on an org-scoped stream — five retry lines and a give-up line, all saying `Conflict.` with no mention of the actual status, the URL, the stream or any remediation. "Conflict." is only accurate for 409 (empty repository); for the other two it actively misleads whoever reads the failure.
## Expected
Distinct, specific messages per status, in line with the messages the connector already writes for 403/410/502/504:
- **401** — authentication failed; the token may be expired, revoked or missing scopes; renew it. Also worth revisiting whether 401 should be `RETRY` at all — a bad credential does not become good on retry.
- **404** — the resource does not exist or the token cannot see it; name the stream and whether it was an organization- or repository-scoped lookup.
- **409** — keep "Conflict"/"repository is likely empty (no commits)".
No URLs inside the user-facing string, and `failure_type` should stay `config_error` for 401/404.
## Notes
- Found while triaging a source-github 2.2.0 sync failure; the misleading `Conflict.` text is what made the failing status code hard to identify from the logs.
- The fix is independent of the functional fix in https://github.com/airbytehq/airbyte/pull/85253, which does not touch this mapping.
貢獻指南
研究方向
Start with source_github/errors_handlers.py and trace how HttpClient._handle_error_resolution uses each ErrorResolution. Compare the existing 403/410/502/504 messages, then define distinct user-facing messages for 401, 404 and 409 while preserving config_error for 401/404; also resolve whether 401 should remain RETRY.
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- api, backend
- Issue 類型
- 缺陷
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 活躍度
- 活躍
- 描述清晰度
- 基本清楚
- 新手友好度
- 70/100