Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

git cat-file warnings on bumped git revision #2885

Closed
mdkent opened this issue Feb 17, 2014 · 0 comments · Fixed by #2899
Closed

git cat-file warnings on bumped git revision #2885

mdkent opened this issue Feb 17, 2014 · 0 comments · Fixed by #2899

Comments

@mdkent
Copy link
Contributor

mdkent commented Feb 17, 2014

Hiya! We are occasionally seeing some neat warnings out of our bundler deploys:

 ** [out :: yyy] Retrying git cat-file -e 803ce88710f853db3e310bca889912f22c6472d6 due to error (2/3): Bundler::Source::Git::GitCommandError Git error: command `git cat-file -e 803ce88710f853db3e310bca889912f22c6472d6` in directory /foo/bar/shared/bundle-rails4/ruby/x/cache/bundler/git/foo-c6395bcedd77f151eba090b253e0e7db95b5e961 has failed.
 ** [out :: yyy] If this error persists you could try removing the cache directory '/foo/bar/shared/bundle-rails4/ruby/x/cache/bundler/git/foo-b6395bcedd77f151eba090b253e0e7db95b5e961'
 ** [out :: yyy] Retrying git cat-file -e 803ce88710f853db3e310bca889912f22c6472d6 due to error (3/3): Bundler::Source::Git::GitCommandError Git error: command `git cat-file -e 803ce88710f853db3e310bca889912f22c6472d6` in directory /foo/bar/shared/bundle-rails4/ruby/x/cache/bundler/git/foo-c6395bcedd77f151eba090b253e0e7db95b5e961 has failed.
 ** [out :: yyy] If this error persists you could try removing the cache directory '/foo/bar/shared/bundle-rails4/ruby/x/cache/bundler/git/foo-b6395bcedd77f151eba090b253e0e7db95b5e961'

They seem to popup whenever we bump a git revision in the Gemfile.lock and deploy for the first time. They disappear on subsequent runs.

The issue appears to be caused by has_revision_cached? checking to see if it already has the reference in https://github.com/bundler/bundler/blob/master/lib/bundler/source/git/git_proxy.rb#L115-L121. This command correctly returns a non-zero exit status on the first run, which gets sent somewhat needlessly through the Bundler::Retry attempts.

The simplest solution is to just pass

          in_path { git("cat-file -e #{@revision}", false) }

to suppress the error output. The retry logic puts this particular command in a tough spot as it's expected to exit(1), but could also fail if github is having issues.

This user https://discussion.heroku.com/t/build-error-retrying-git-cat-file-e/448 is suffering the same issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant