source-github: 401 and 404 both surface the user-facing message "Conflict."
- Vorherrschende Sprache
- Python
- Sterne
- 22.1k
- Forks
- 5.3k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
## 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.
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.