-
Notifications
You must be signed in to change notification settings - Fork 5k
Description
Connector Name
source-github
Connector Version
1.8.6
What step the error happened?
None
Relevant information
Description
The GitHub source connector fails during sync when one or more repositories in the configured repository list are empty (have no commits or branches). The entire sync job crashes instead of gracefully skipping the empty repository and continuing with others.
Error Message
{
"failureOrigin": "source",
"failureType": "system_error",
"internalMessage": "Conflict.",
"externalMessage": "Git Repository is empty."
}Environment
- Airbyte version: 0.64 (Self-hosted, Docker)
- GitHub connector version: 1.8.6
Steps to Reproduce
- Create a new GitHub repository but don't add any files/commits (leave it empty)
- Configure the GitHub source connector with a repository list that includes the empty repo
- Enable the
commitsstream in the sync - Run a sync job
- The sync fails with the "Git Repository is empty" error
Expected Behavior
The connector should detect that a repository is empty (has no branches), log a warning, skip it gracefully, and continue syncing commits from other non-empty repositories.
Actual Behavior
The entire sync job fails when it encounters an empty repository.
Root Cause
The issue is in Commits._validate_branches_to_pull() method in streams.py (lines ~736-758). When iterating repositories, it tries to access default_branches[repo] but for empty repos this key doesn't exist, causing a KeyError.
Related
- PR 🐛 Source Github: handling empty repos, check method using RepositoryStats stream #5788 (Sept 2021) fixed empty repo handling for connection check but not for commits stream sync
- Community forum report: https://discuss.airbyte.io/t/issue-with-github-source-logs/7962
Impact
Organizations using org/* wildcards or managing many repos cannot sync if any repo is empty.
Relevant log output
{
"failureOrigin": "source",
"failureType": "system_error",
"internalMessage": "Conflict.",
"externalMessage": "Git Repository is empty."
}Contribute
- Yes, I want to contribute
Internal Tracking: https://github.com/airbytehq/oncall/issues/11171