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

Cannot force update branch error is back #289

Closed
axelrtgs opened this issue Jul 8, 2020 · 6 comments · Fixed by #296
Closed

Cannot force update branch error is back #289

axelrtgs opened this issue Jul 8, 2020 · 6 comments · Fixed by #296
Labels
Bug Something isn't working hacktoberfest An issue highlighted for the digital ocean Hacktoberfest Event Needs Triage Issue is waiting to be categorised

Comments

@axelrtgs
Copy link
Contributor

axelrtgs commented Jul 8, 2020

🗣️ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

👻 Brief Description

Looks like the git resources changes in chef 16 are at it again. Cannot force update the current branch. error is back again and this time it's using the legacy deploy branch so i'm not sure how to fix this. I checked on the ruby-build repo and theres no branch called deploy there. Not sure if this is a cookbook or upstream issue but it would be nice to get a proper fix for this so it doesn't happen again.

🥞 Cookbook version

2.4.0 (latest)

👩‍🍳 Chef-Infra Version

      System Info:
      ------------
      chef_version=16.2.73
      platform=ubuntu
      platform_version=18.04
      ruby=ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
      program_name=/usr/bin/chef-client
      executable=/opt/chef-workstation/bin/chef-client

🎩 Platform details

      System Info:
      ------------
      chef_version=16.2.73
      platform=ubuntu
      platform_version=18.04
      ruby=ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
      program_name=/usr/bin/chef-client
      executable=/opt/chef-workstation/bin/chef-client

Steps To Reproduce

Steps to reproduce the behavior:

add a simple ruby resource to the recipe:

rbenv_ruby '2.6.1' do
  user 'user'
end

🚓 Expected behavior

Successful converge

➕ Additional context

System Info:
      ------------
      chef_version=16.2.73
      platform=ubuntu
      platform_version=18.04
      ruby=ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
      program_name=/usr/bin/chef-client
      executable=/opt/chef-workstation/bin/chef-client


    ================================================================================
    Error executing action `install` on resource 'rbenv_ruby[2.6.1]'
    ================================================================================

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    rbenv_plugin[ruby-build] (/var/chef/cache/cookbooks/ruby_rbenv/resources/ruby.rb line 41) had an error: Mixlib::ShellOut::ShellCommandFailed: git[Install ruby-build plugin] (/var/chef/cache/cookbooks/ruby_rbenv/resources/plugin.rb line 32) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '128'
    ---- Begin output of git branch -f deploy 16421762a6a7901c1c12811940187e40f7dfc3b9 ----
    STDOUT:
    STDERR: fatal: Cannot force update the current branch.
    ---- End output of git branch -f deploy 16421762a6a7901c1c12811940187e40f7dfc3b9 ----
    Ran git branch -f deploy 16421762a6a7901c1c12811940187e40f7dfc3b9 returned 128
@axelrtgs axelrtgs added Bug Something isn't working Needs Triage Issue is waiting to be categorised labels Jul 8, 2020
@thr3a
Copy link

thr3a commented Sep 18, 2020

This problem is still occurring in my environment.
What is the progress of fixing this issue?

@ramereth
Copy link
Contributor

Unfortunately not but this would be a great candidate for Hacktoberfest 2020.

@ramereth ramereth added the hacktoberfest An issue highlighted for the digital ocean Hacktoberfest Event label Sep 18, 2020
@axelrtgs
Copy link
Contributor Author

@thr3a So the issue at heart is a bug in chef built in git resource. i can confirm that newer versions of chef-client don't exhibit this behaviour in my testing. We use 16.4.41 in our env and we do not have this issue anymore (even with the removed workaround) and the testing running on latest did not exhibit this issue either.

The solution to this is to update to a more recent chef client with the bugfix theres not much that can be done in this cookbook. removed the workaround in the cookbook since its no longer needed on more recent versions.

@ramereth
Copy link
Contributor

@axelrtgs is this only affecting Versions >= 16, < 16.4.41? with Chef?

@axelrtgs
Copy link
Contributor Author

i can tell you for sure its affect some versions inside that range. i know we noticed it when first trying out 16 in the lab then found out the git resource got a rewrite and then when we went to prod with it we pinned to version 16.4.41 which seems to work fine now. it may have been fixed in a slightly earlier version. I can leave a not in the readme that theres a chef bug that affected the cookbook in that range and that we have confirmed >=16.4.41 to be working properly now

ramereth added a commit that referenced this issue Oct 28, 2020
Remove workaround for chef bug in git resource (fixes #289)
@thr3a
Copy link

thr3a commented Oct 29, 2020

@axelrtgs

Thank you for providing me with useful information.
I also updated my chef version (16.6.14) and the problem was resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working hacktoberfest An issue highlighted for the digital ocean Hacktoberfest Event Needs Triage Issue is waiting to be categorised
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants