Skip to content

Error codes & fixes: Git, Terraform & Helm errors

6 Error codes & fixes commands: Git, Terraform & Helm errors. Click a command to see what each part does.

Index
6 items
Click a command to see what each part does.

Git, Terraform & Helm errors6

  • git pull --rebase origin <branch>rejected (non-fast-forward)"Updates were rejected because the remote contains work that you do not have"

    What it means

    Someone pushed to the branch since you last pulled; a plain push would overwrite their work.

    Usual causes & fixes

    • Pull with rebase, resolve conflicts, then git push.
    • Only after a deliberate rebase of your own branch: git push --force-with-lease.

    Diagnose: what each part of the command does

    1. pull --rebasefetch the remote commits and replay yours on top
    2. origin <branch>the branch you are pushing
  • git diff --name-only --diff-filter=UCONFLICTMerge conflict: which files?

    What it means

    Both sides changed the same lines; Git marked them with <<<<<<< ======= >>>>>>>.

    Usual causes & fixes

    • Edit the files, remove the markers, git add <file>, then git commit (or git rebase --continue).
    • Give up: git merge --abort / git rebase --abort.

    Diagnose: what each part of the command does

    1. --name-onlylist file names only
    2. --diff-filter=Uonly Unmerged (conflicted) files
  • git switch -c <new-branch>detached HEADKeep work done in detached HEAD

    What it means

    You checked out a commit or tag directly, not a branch. New commits belong to no branch.

    Usual causes & fixes

    • Already switched away? Find the commit in git reflog.

    Diagnose: what each part of the command does

    1. switch -c <new-branch>create a branch at the current commit so the work is not lost
  • git rev-parse --show-toplevelnot a git repository"fatal: not a git repository"

    What it means

    The current folder is not inside a Git working tree.

    Usual causes & fixes

    • cd into the repo, or git init / git clone first.
    • In CI/containers: "dubious ownership" → git config --global --add safe.directory <path>.

    Diagnose: what each part of the command does

    1. rev-parse --show-toplevelprint the repo root, or fail if you are not inside a repo
  • terraform force-unlock <lock-id>state lockTerraform "Error acquiring the state lock"Destructive

    What it means

    Another run holds the state lock, or a crashed/cancelled run left it behind.

    Usual causes & fixes

    • Make sure no other plan/apply is running first.
    • Avoid by not cancelling apply jobs; use a CI concurrency group per workspace.

    Diagnose: what each part of the command does

    1. force-unlock <lock-id>remove the lock (ID is in the error message)
  • helm history <release> -n <namespace>another operation in progressHelm "another operation (install/upgrade/rollback) is in progress"

    What it means

    A previous Helm operation was interrupted and left the release in a pending state.

    Usual causes & fixes

    • Roll back to the last deployed revision: helm rollback <release> <revision> -n <namespace>.
    • Use --rollback-on-failure (Helm 4) / --atomic (Helm 3) and a timeout so this cleans up itself.

    Diagnose: what each part of the command does

    1. history <release>revisions; the last one is stuck in pending-install / pending-upgrade

My DevOps Playbook by Angelo John Calleja

New runbook

GitHub not connected

Saving is handled by the site: the GitHub token is stored in Cloudflare, not in your browser. Enter the editor password (the EDITOR_PASSWORD secret) to unlock saving in this browser.

Saving commits to gelogrammer/My_DevOps_Playbook. Create a fine-grained token with access to only this repo andContents: Read and write, then paste it here. It is stored only in this browser.

src/content/docs/…