Skip to content

[source-github] Commits stream sync fails on empty repositories with 409 Conflict error #72891

@jjose1508

Description

@jjose1508

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

  1. Create a new GitHub repository but don't add any files/commits (leave it empty)
  2. Configure the GitHub source connector with a repository list that includes the empty repo
  3. Enable the commits stream in the sync
  4. Run a sync job
  5. 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

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions