Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git write back - Updates were rejected because the tip of your current branch is behind #879

Closed
mimartin12 opened this issue Oct 2, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@mimartin12
Copy link

Describe the bug
Using git write back, and when the updater is performing a second update to the branch. It throws an error with git as it attempts to push the changes and git rejects the changes with the error tip of your current branch is behind with the remote counterpart.

To Reproduce

  1. Setup git write back to a helmvalues file.
    argocd-image-updater.argoproj.io/write-back-target: 'helmvalues:/chart/argo_params.yaml'
    Along with setting the branch base and target. argocd-image-updater.argoproj.io/git-branch: 'main:{{.branch}}-test'

  2. Push new images, allow image updater to create a commit with the newest versions.

  3. Push another image, image updater will see it and attempt to perform updates to the same branch, but will fail with the error.

Expected behavior
I expect this to be able to push commits after the first successful commit.

Additional context
This seems to be happening to me for both helm values and parameters.

Version
0.14.0

Logs

time="2024-10-02T16:50:35Z" level=error msg="`git push origin {{.branch}}-test` failed exit status 1: To github.com:org/chart.git\n ! [rejected]        {{.branch}}-test -> {{.branch}}-test (non-fast-forward)\nerror: failed to push some refs to 'github.com:org/chart.git'\nhint: Updates were rejected because the tip of your current branch is behind\nhint: its remote counterpart. If you want to integrate the remote changes,\nhint: use 'git pull' before pushing again.\nhint: See the 'Note about fast-forwards' in 'git push --help' for details." execID=f087c
time="2024-10-02T16:50:35Z" level=info msg=Trace args="[git push origin {{.branch}}-test]" dir=/tmp/git-app3321241721 operation_name="exec git" time_ms=758.927234
time="2024-10-02T16:50:35Z" level=info msg="Processing results: applications=1 images_considered=3 images_skipped=0 images_updated=0 errors=2"
time="2024-10-02T16:50:35Z" level=error msg="Could not update application spec: could not push {{.branch}}-test to origin: `git push origin {{.branch}}-test` failed exit status 1: To github.com:org/chart.git\n ! [rejected]        {{.branch}}-test -> {{.branch}}-test (non-fast-forward)\nerror: failed to push some refs to 'github.com:org/chart.git'\nhint: Updates were rejected because the tip of your current branch is behind\nhint: its remote counterpart. If you want to integrate the remote changes,\nhint: use 'git pull' before pushing again.\nhint: See the 'Note about fast-forwards' in 'git push --help' for details." application=app
@mimartin12 mimartin12 added the bug Something isn't working label Oct 2, 2024
@chengfang
Copy link
Collaborator

see the other similar issue #673

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants