mitchellh/vagrant — Issue #650: undefined method `execute' for #<Vagrant::SSH:0x101173ac0>
Author: jimhopp-lookout
Created: 2012-01-18 23:04:17+00:00
State: open

I upgraded to 0.9.1 and am now getting an error when my Rakefile attempts to run commands over ssh in a multi-VM environment.

This worked fine on the previous version of vagrant.

Here's the relevant method from my Rakefile:

def run_cmd_on_server(cmd)
puts ("run_cmd_on_server: cmd is '#{cmd}'") if DEBUG_DEFINED
env = Vagrant::Environment.new
output = nil;
env.vms[:chef_server].ssh.execute do |ssh|
output=ssh.exec!(cmd)
end
puts "output is #{output}" if DEBUG_DEFINED
output
end

Here's the dump:

mac-jhopp:vagrant jhopp$ export VAGRANT_LOG=debug
mac-jhopp:vagrant jhopp$ rake fix_paths
INFO environment: Environment initialized (#)
INFO environment: - cwd: /Users/jhopp/dev/vagrant
INFO environment: Home path: /Users/jhopp/.vagrant.d
INFO environment: Loading configuration...
DEBUG loader: Set :default = "/Users/jhopp/.rvm/gems/ree-1.8.7-2011.03/gems/vagrant-0.9.1/config/default.rb"
DEBUG loader: Populating proc cache for "/Users/jhopp/.rvm/gems/ree-1.8.7-2011.03/gems/vagrant-0.9.1/config/default.rb"
DEBUG loader: Load procs for pathname: #
DEBUG loader: Set :root = #
DEBUG loader: Populating proc cache for #
DEBUG loader: Load procs for pathname: #
DEBUG loader: Loading configuration in order: [:default, :box, :home, :root, :vm]
DEBUG loader: Loading from: default (evaluating)
DEBUG loader: Loading from: root (evaluating)
DEBUG loader: Configuration loaded successfully
DEBUG environment: Loading configuration for VM: chef_server
DEBUG loader: Set :default = "/Users/jhopp/.rvm/gems/ree-1.8.7-2011.03/gems/vagrant-0.9.1/config/default.rb"
DEBUG loader: Set :root = #
DEBUG loader: Set :vm = [#]
DEBUG loader: Populating proc cache for #
DEBUG loader: Loading configuration in order: [:default, :box, :home, :root, :vm]
DEBUG loader: Loading from: vm (evaluating)
DEBUG provisioner: Provisioner config: chef_solo
INFO provisioner: Provisioner class: Vagrant::Provisioners::ChefSolo
DEBUG provisioner: Configuring provisioner with: Vagrant::Provisioners::ChefSolo::Config
DEBUG loader: Configuration loaded successfully
DEBUG loader: Set :default = "/Users/jhopp/.rvm/gems/ree-1.8.7-2011.03/gems/vagrant-0.9.1/config/default.rb"
DEBUG loader: Set :box = #
DEBUG loader: Populating proc cache for #
DEBUG loader: Load procs for pathname: #
DEBUG loader: Set :root = #
DEBUG loader: Set :vm = [#]
DEBUG loader: Loading configuration in order: [:default, :box, :home, :root, :vm]
DEBUG loader: Loading from: box (evaluating)
DEBUG loader: Configuration loaded successfully
DEBUG environment: Loading configuration for VM: chef_client
DEBUG loader: Set :default = "/Users/jhopp/.rvm/gems/ree-1.8.7-2011.03/gems/vagrant-0.9.1/config/default.rb"
DEBUG loader: Set :root = #
DEBUG loader: Set :vm = [#]
DEBUG loader: Populating proc cache for #
DEBUG loader: Loading configuration in order: [:default, :box, :home, :root, :vm]
DEBUG loader: Loading from: vm (evaluating)
DEBUG provisioner: Provisioner config: chef_client
INFO provisioner: Provisioner class: Vagrant::Provisioners::ChefClient
DEBUG provisioner: Configuring provisioner with: Vagrant::Provisioners::ChefClient::Config
DEBUG loader: Configuration loaded successfully
DEBUG loader: Set :default = "/Users/jhopp/.rvm/gems/ree-1.8.7-2011.03/gems/vagrant-0.9.1/config/default.rb"
DEBUG loader: Set :box = #
DEBUG loader: Set :root = #
DEBUG loader: Set :vm = [#]
DEBUG loader: Loading configuration in order: [:default, :box, :home, :root, :vm]
DEBUG loader: Configuration loaded successfully
INFO datastore: Created: /Users/jhopp/dev/vagrant/.vagrant
INFO virtualbox_base: VBoxManage path: VBoxManage
INFO subprocess: Starting process: ["VBoxManage", "--version"]
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stdout: 4.1.0r73009

DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Exit status: 0
DEBUG virtualbox: Finding driver for VirtualBox version: 4.1.0
INFO virtualbox: Using VirtualBox driver: Vagrant::Driver::VirtualBox_4_1
INFO virtualbox_base: VBoxManage path: VBoxManage
INFO subprocess: Starting process: ["VBoxManage", "showvminfo", "6e58ecee-22d5-45e3-8082-1a719319dca0"]
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stdout: Name: vagrant_1326926765
Guest OS: Ubuntu (64 bit)
UUID: 6e58ecee-22d5-45e3-8082-1a719319dca0
Config file: /Users/jhopp/VirtualBox VMs/vagrant_1326926765/vagrant_1326926765.vbox
Snapshot folder: /Users/jhopp/VirtualBox VMs/vagrant_1326926765/Snapshots
Log folder: /Users/jhopp/VirtualBox VMs/vagrant_1326926765/Logs
Hardware UUID: 6e58ecee-22d5-45e3-8082-1a719319dca0
Memory size: 512MB
Page Fusion: off
VRAM size: 8MB
CPU exec cap: 100%
HPET: off
Chipset: piix3
Firmware: BIOS
Number of CPUs: 1
Synthetic Cpu: off
CPUID overrides: None
Boot menu mode: message and menu
Boot Device (1): HardDisk
Boot Device (2): DVD
Boot Device (3): Not Assigned
Boot Device (4): Not Assigned
ACPI: on
IOAPIC: on
PAE: on
Time offset: 0 ms
RTC: local time
Hardw. virt.ext: on
Hardw. virt.ext exclusive: off
Nested Paging: on
Large Pages: on
VT-x VPID: on
State: running (since 2012-01-18T22:46:31.762000000)
Monitor count: 1
3D Acceleration: off
2D Video Acceleration: off
Teleporter Enabled: off
Teleporter Port: 0
Teleporter Address:
Teleporter Password:
Storage Controller Name (0): IDE Controller
Storage Controller Type (0): PIIX4
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0): 2
Storage Controller Port Count (0): 2
Storage Controller Bootable (0): on
Storage Controller Name (1): SATA Controller
Storage Controller Type (1): IntelAhci
Storage Controller Instance Number (1): 0
Storage Controller Max Port Count (1): 30
Storage Controller Port Count (1): 30
Storage Controller Bootable (1): on
IDE Controller (1, 0): Empty
SATA Controller (0, 0): /Users/jhopp/VirtualBox VMs/lucid64_1/box-disk1.vmdk (UUID: 1de8cb86-549b-4651-ac22-d2c757f2027a)
NIC 1: MAC: 080027706AA2, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny
NIC 1 Settings: MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64)
NIC 1 Rule(0): name = 3t0-dlg, protocol = tcp, host ip = , host port = 14000, guest ip = , guest port = 4000
NIC 1 Rule(1): name = 3u8-dmo, protocol = tcp, host ip = , host port = 14040, guest ip = , guest port = 4040
NIC 1 Rule(2): name = 5r0-fjg, protocol = tcp, host ip = , host port = 15984, guest ip = , guest port = 5984
NIC 1 Rule(3): name = 8on-ih7, protocol = tcp, host ip = , host port = 18983, guest ip = , guest port = 8983
NIC 1 Rule(4): name = ssh, protocol = tcp, host ip = , host port = 2222, guest ip = , guest port = 22
NIC 2: MAC: 0800275DFDC4, Attachment: Host-only Interface 'vboxnet0', Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny
NIC 3: disabled
NIC 4: disabled
NIC 5: disabled
NIC 6: disabled
NIC 7: disabled
NIC 8: disabled
Pointing Device: PS/2 Mouse
Keyboard Device: PS/2 Keyboard
UART 1: disabled
UART 2: disabled
Audio: disabled
Clipboard Mode: Bidirectional
Video mode: 640x480x0
VRDE: disabled
USB: disabled

USB Device Filters:

Available remote USB devices:

Currently Attached USB Devices:

Shared folders:

Name: 'v-root', Host path: '/Users/jhopp/dev/vagrant' (machine mapping), writable
Name: 'v-csc-1', Host path: '/Users/jhopp/dev/chef-repo/bootstrap' (machine mapping), writable

VRDE Connection: not active
Clients so far: 0

Guest:

Configured memory balloon size: 0 MB
OS type: Linux26_64
Additions run level: 2
Additions version: 4.1.0 r73009

Guest Facilities:

Facility "VirtualBox Base Driver": active/running (last update: 2012/01/18 22:46:48 UTC)
Facility "VirtualBox System Service": active/running (last update: 2012/01/18 22:46:50 UTC)
Facility "Seamless Mode": not active (last update: 2012/01/18 22:46:48 UTC)
Facility "Graphics Mode": not active (last update: 2012/01/18 22:46:48 UTC)

DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 31999
DEBUG subprocess: Exit status: 0
INFO vm: Loading guest: linux
INFO virtualbox_base: VBoxManage path: VBoxManage
INFO subprocess: Starting process: ["VBoxManage", "--version"]
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stdout: 4.1.0r73009

DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Exit status: 0
DEBUG virtualbox: Finding driver for VirtualBox version: 4.1.0
INFO virtualbox: Using VirtualBox driver: Vagrant::Driver::VirtualBox_4_1
INFO virtualbox_base: VBoxManage path: VBoxManage
INFO vm: Loading guest: linux
rake aborted!
undefined method `execute' for #

Tasks: TOP => fix_paths
(See full trace by running task with --trace)