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

vagrant provision fails if validation.pem has read-only permissions #924

Closed
ubergeek42 opened this issue May 9, 2012 · 2 comments
Closed
Labels

Comments

@ubergeek42
Copy link

I ran into a minor issue earlier today. I have my own chef server, and keep a copy of my validation.pem from it in my home directory. I initially set the permissions of this file to 400(So it is a read only file, as it should never change).

Steps to reproduce:

  1. chmod 400 /path/to/your/validation.pem
  2. vagrant up
  3. vagrant provision

Expected results:
Chef to run successfully both times(once after the vagrant up, once after the provision)

Actual results:
When chef runs with the initial vagrant up, it works fine. Subsequent attempts to provision fail with the error below.
Logging in and modifying the permissions of /tmp/vagrant-chef-1/validation.pem to 600 and running vagrant provision again works fine.

I think a solution would be to either force overwriting the "read only" file, or delete it first before copying the new one. I'm not sure what the best approach is, so I'll leave that up to you.

System information
Ubuntu 12.04 LTS
Vagrant --version: Vagrant version 1.0.1 (Installed through the ubuntu repos)
An Ubuntu 12.04 vagrant boxfile, created from https://github.com/cal/vagrant-ubuntu-precise-64

Full log/error message:

$ vagrant provision
[default] Running provisioner: Vagrant::Provisioners::ChefClient...
[default] Creating folder to hold client key...
[default] Uploading chef client validation key...
/usr/lib/ruby/vendor_ruby/net/scp.rb:385:in `await_response_state': �scp: /tmp/vagrant-chef-1/validation.pem: Permission denied (RuntimeError)
    from /usr/lib/ruby/vendor_ruby/net/scp.rb:356:in `send'
    from /usr/lib/ruby/vendor_ruby/net/scp.rb:356:in `start_command'
    from /usr/lib/ruby/vendor_ruby/net/ssh/connection/channel.rb:311:in `call'
    from /usr/lib/ruby/vendor_ruby/net/ssh/connection/channel.rb:311:in `process'
    from /usr/lib/ruby/vendor_ruby/net/ssh/connection/session.rb:214:in `preprocess'
    from /usr/lib/ruby/vendor_ruby/net/ssh/connection/session.rb:214:in `each'
    from /usr/lib/ruby/vendor_ruby/net/ssh/connection/session.rb:214:in `preprocess'
    from /usr/lib/ruby/vendor_ruby/net/ssh/connection/session.rb:197:in `process'
    from /usr/lib/ruby/vendor_ruby/net/ssh/connection/session.rb:161:in `loop'
    from /usr/lib/ruby/vendor_ruby/net/ssh/connection/session.rb:161:in `loop_forever'
    from /usr/lib/ruby/vendor_ruby/net/ssh/connection/session.rb:161:in `loop'
    from /usr/lib/ruby/vendor_ruby/net/ssh/connection/channel.rb:269:in `wait'
    from /usr/lib/ruby/vendor_ruby/net/scp.rb:279:in `upload!'
    from /usr/lib/ruby/vendor_ruby/vagrant/communication/ssh.rb:81:in `upload'
    from /usr/lib/ruby/vendor_ruby/vagrant/communication/ssh.rb:110:in `connect'
    from /usr/lib/ruby/vendor_ruby/vagrant/communication/ssh.rb:79:in `upload'
    from /usr/lib/ruby/vendor_ruby/vagrant/provisioners/chef_client.rb:68:in `upload_validation_key'
    from /usr/lib/ruby/vendor_ruby/vagrant/provisioners/chef_client.rb:52:in `provision!'
    from /usr/lib/ruby/vendor_ruby/vagrant/action/vm/provision.rb:36:in `call'
    from /usr/lib/ruby/vendor_ruby/vagrant/action/vm/provision.rb:33:in `each'
    from /usr/lib/ruby/vendor_ruby/vagrant/action/vm/provision.rb:33:in `call'
    from /usr/lib/ruby/vendor_ruby/vagrant/action/warden.rb:33:in `call'
    from /usr/lib/ruby/vendor_ruby/vagrant/action/vm/check_accessible.rb:18:in `call'
    from /usr/lib/ruby/vendor_ruby/vagrant/action/warden.rb:33:in `call'
    from /usr/lib/ruby/vendor_ruby/vagrant/action/general/validate.rb:13:in `call'
    from /usr/lib/ruby/vendor_ruby/vagrant/action/warden.rb:33:in `call'
    from /usr/lib/ruby/vendor_ruby/vagrant/action/general/check_virtualbox.rb:23:in `call'
    from /usr/lib/ruby/vendor_ruby/vagrant/action/warden.rb:33:in `call'
    from /usr/lib/ruby/vendor_ruby/vagrant/action/builder.rb:92:in `call'
    from /usr/lib/ruby/vendor_ruby/vagrant/action/runner.rb:49:in `run'
    from /usr/lib/ruby/vendor_ruby/vagrant/util/busy.rb:19:in `busy'
    from /usr/lib/ruby/vendor_ruby/vagrant/action/runner.rb:49:in `run'
    from /usr/lib/ruby/vendor_ruby/vagrant/vm.rb:192:in `run_action'
    from /usr/lib/ruby/vendor_ruby/vagrant/vm.rb:164:in `provision'
    from /usr/lib/ruby/vendor_ruby/vagrant/command/provision.rb:23:in `execute'
    from /usr/lib/ruby/vendor_ruby/vagrant/command/base.rb:106:in `with_target_vms'
    from /usr/lib/ruby/vendor_ruby/vagrant/command/base.rb:101:in `each'
    from /usr/lib/ruby/vendor_ruby/vagrant/command/base.rb:101:in `with_target_vms'
    from /usr/lib/ruby/vendor_ruby/vagrant/command/provision.rb:19:in `execute'
    from /usr/lib/ruby/vendor_ruby/vagrant/cli.rb:38:in `execute'
    from /usr/lib/ruby/vendor_ruby/vagrant/environment.rb:167:in `cli'
    from /usr/bin/vagrant:43
@mitchellh
Copy link
Contributor

Sorry I never responded to this. Legitimate issue, labelled, and will fix prior to 1.1. Thanks.

@mitchellh
Copy link
Contributor

Fixed.

@ghost ghost locked and limited conversation to collaborators Apr 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants