Skip to content
This repository has been archived by the owner on Mar 19, 2022. It is now read-only.

knife bootstrap fails with an rsync error #489

Open
percov opened this issue Jun 30, 2016 · 6 comments
Open

knife bootstrap fails with an rsync error #489

percov opened this issue Jun 30, 2016 · 6 comments

Comments

@percov
Copy link

percov commented Jun 30, 2016

knife solo bootstrap user@hostname -i .chef/key.pem runs successfully for me. Inside of knife.rb, I've specified knife[:solo] = true to make knife ec2 bootstrap with knife solo. When I run the following command knife bootstrap user@hostname -i .chef/key.pem I get the following error:

percent_expand: unknown key %C rsync: connection unexpectedly closed (0 bytes received so far) [sender] rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.0] ERROR: RuntimeError: Failed to launch command ["rsync", "-rL", "--rsh=ssh user@hostname -i .chef/key.pem -o ControlMaster=auto -o ControlPath=/var/lib/user/.chef/knife-solo-sockets/%C -o ControlPersist=3600", "--delete-after", "-zt", "--exclude=revision-deploys", "--exclude=.git", "--exclude=.hg", "--exclude=.svn", "--exclude=.bzr", "/var/lib/user/.chefdk/gem/ruby/2.1.0/gems/knife-solo-0.6.0/lib/knife-solo/resources/patch_cookbooks/", ":~/chef-solo/cookbooks-1"]

Both my host and client are using Ubuntu Server 14.04 LTS. Do you know what I am doing wrong?

@matschaffer
Copy link
Owner

The percent_expand: unknown key %C is likely the issue. You'll need a new-ish openssh client to support that.

For now I'd recommend running with --ssh-control-master no or knife[:ssh_control_master] = 'no' in your knife.rb.

@matschaffer
Copy link
Owner

Oh, just noticed you're calling bootstrap, so use the knife.rb setting.

@percov
Copy link
Author

percov commented Jul 1, 2016

Following your suggestion, I added the line of text to my knife.rb. knife solo bootstrap works fine however knife bootstrap keeps complaining about rsync. I've isolated the cause of the error with knife bootstrap to not being able to read the contents of the config with a line of code (215) in knife-solo/lib/knife-solo/ssh_command.rb. I edited the code to print out the value for config[:ssh_control_master].When I run knife solo bootstrap it displays the expected value of no, however when I run knife bootstrap it gives me nil. I also tried iterating all the values of the config to see if the file was formatted correctly and I got these two different outputs. Do you know why this is occurring?

@matschaffer
Copy link
Owner

Hm. Could be the setting doesn't get applied when going via bootstrap. Have you tried the latest release of knife-solo? The default in the newest version is "no" anyway.

@percov
Copy link
Author

percov commented Jul 5, 2016

I'm using version 0.6.0. I did notice that the default setting for ssh_control_master was no when I looked through it.

@vagifzeynalov
Copy link

vagifzeynalov commented Dec 10, 2016

I'm having the same problem too. And I'm using 0.6.0 version too.

% chef gem list knife --local
*** LOCAL GEMS ***
...
knife-solo (0.6.0)

Perhaps you can change the base path for it at

dir = File.join(ENV['HOME'], '.chef', 'knife-solo-sockets')

dir = File.join(ENV['HOME'], '.chef', 'knife-solo-sockets')
to something like /tmp/...
Or at least make it configurable?

Thank you!

P.S. Quick & dirty fix like dir = File.join('/tmp/.chef', 'knife-solo-sockets') resolved the problem

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

No branches or pull requests

3 participants