Skip to content

vm-sync fails when golden commit is not a git ancestor #39

@nsluss

Description

@nsluss

Problem

The vm-sync command fails when trying to sync changes to a VM created from the golden image:

./scripts/vers-client.sh vm-sync <vmId>

Output:

Creating git bundle from 5931196c..HEAD
Failed to create bundle. Is 5931196c an ancestor of HEAD?

Root Cause

The VERS_GOLDEN_COMMIT_ID is a Vers commit ID (VM snapshot), not a git commit hash. The vm-sync command assumes it can create a git bundle from the golden commit to HEAD, but this fails because:

  1. The Vers commit ID doesn't exist in the git history
  2. Git cannot create a bundle from a non-existent commit

Current Workaround

Must manually upload the binary:

./scripts/vers-client.sh vm-upload <vmId> dist/vers-agent-linux /tmp/vers-agent-new
./scripts/vers-client.sh vm-exec <vmId> "systemctl stop vers-agent; cp /tmp/vers-agent-new /usr/local/bin/vers-agent; chmod +x /usr/local/bin/vers-agent; systemctl start vers-agent"

Suggested Fix

Option A: Store the git commit hash alongside the Vers commit ID in golden image metadata

Option B: Modify vm-sync to detect when the base commit is invalid and offer alternative sync methods (full upload, rsync, etc.)

Option C: Add a --force-full flag to vm-sync that uploads the entire codebase instead of a bundle

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions