Skip to content

Bad object refs on environment git repositories #1399

@ymartin-ovh

Description

@ymartin-ovh

Hello

We use r10k to create puppet environment based on an active git repository.
Sysadmins tend to create feature-branch (and do push-force in their dev environment).

Describe the Bug

Some environment (/etc/puppet/code/environments/dev_XXX) may be "stuck", git operations fail with something like:

   fatal: bad object refs/remotes/cache/dev/YYY
   error: ssh://<upstream repo>.git did not send all necessary objects

I encountered two types of issues:

  • refs/remotes/cache/dev/YYY is gone (merged or deleted) => maybe --prune should be added (
    def fetch(remote = 'cache')
    )
  • refs/remotes/cache/dev/YYY: local hash does not exist anymore because DEV2 issued git push --force on his branch

Expected Behavior

On environment repositories (/etc/puppet/code/environments), maybe r10k should not do a "git fetch cache" as we just need code for a specific branch.

Steps to Reproduce

I think my issue is a race condition on active repository (aka concurrent r10k environment deploy) with people issuing "git push --force" on branches

Environment

  • Version 3.15.4
  • Platform Debian bookworm

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions