jedi4ever/veewee — Issue #191: Failure to re-build a basebox
Author: miketheman
Created: 2011-12-21 04:24:07+00:00
State: open

Environment
-----------------
OSX 10.7.2
Ruby 1.8.7
Rubygems 1.8.12
VirtualBox 4.1.8

Gems
-------
vagrant (0.8.10)
veewee (0.2.2)
virtualbox (0.9.2)

Commands
--------------

$ vagrant basebox define 'centos-57-64' 'CentOS-5.7-x86_64-netboot'
$ vagrant basebox build 'centos-57-64'

Ends fine, passes validation.

Then, when I edit something in the definition's `postinstall.sh` and run build again, I get this error:

```
$ vagrant basebox build 'centos-57-64'

Verifying the isofile CentOS-5.7-x86_64-netinstall.iso is ok.
Removing step [1] snapshot as it is no more valid
/Library/Ruby/Gems/1.8/gems/virtualbox-0.9.2/lib/virtualbox/com/implementer/ffi.rb:106:in `call_and_check': Error in API call to wait_for_completion: 2147500036 (VirtualBox::Exceptions::COMException)
from /Library/Ruby/Gems/1.8/gems/virtualbox-0.9.2/lib/virtualbox/com/implementer/ffi.rb:80:in `call_vtbl_function'
from /Library/Ruby/Gems/1.8/gems/virtualbox-0.9.2/lib/virtualbox/com/implementer/ffi.rb:61:in `call_function'
from /Library/Ruby/Gems/1.8/gems/virtualbox-0.9.2/lib/virtualbox/com/abstract_interface.rb:145:in `call_function'
from /Library/Ruby/Gems/1.8/gems/virtualbox-0.9.2/lib/virtualbox/com/abstract_interface.rb:62:in `wait_for_completion'
from /Library/Ruby/Gems/1.8/gems/virtualbox-0.9.2/lib/virtualbox/com/interface/4.1.x/Progress.rb:39:in `wait'
from /Library/Ruby/Gems/1.8/gems/virtualbox-0.9.2/lib/virtualbox/snapshot.rb:181:in `destroy'
from /Library/Ruby/Gems/1.8/gems/virtualbox-0.9.2/lib/virtualbox/vm.rb:416:in `with_open_session'
from /Library/Ruby/Gems/1.8/gems/virtualbox-0.9.2/lib/virtualbox/snapshot.rb:180:in `destroy'
from /Library/Ruby/Gems/1.8/gems/veewee-0.2.2/lib/veewee/session.rb:836:in `transaction'
from /Library/Ruby/Gems/1.8/gems/veewee-0.2.2/lib/veewee/session.rb:833:in `each'
from /Library/Ruby/Gems/1.8/gems/veewee-0.2.2/lib/veewee/session.rb:833:in `transaction'
from /Library/Ruby/Gems/1.8/gems/veewee-0.2.2/lib/veewee/session.rb:267:in `build'
from /Library/Ruby/Gems/1.8/gems/veewee-0.2.2/lib/veewee/command.rb:46:in `build'
from /Library/Ruby/Gems/1.8/gems/thor-0.14.6/lib/thor/task.rb:22:in `send'
from /Library/Ruby/Gems/1.8/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
from /Library/Ruby/Gems/1.8/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
from /Library/Ruby/Gems/1.8/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
from /Library/Ruby/Gems/1.8/gems/thor-0.14.6/lib/thor/invocation.rb:109:in `send'
from /Library/Ruby/Gems/1.8/gems/thor-0.14.6/lib/thor/invocation.rb:109:in `invoke'
from /Library/Ruby/Gems/1.8/gems/thor-0.14.6/lib/thor.rb:205:in `basebox'
from /Library/Ruby/Gems/1.8/gems/thor-0.14.6/lib/thor/task.rb:22:in `send'
from /Library/Ruby/Gems/1.8/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
from /Library/Ruby/Gems/1.8/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
from /Library/Ruby/Gems/1.8/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
from /Library/Ruby/Gems/1.8/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
from /Library/Ruby/Gems/1.8/gems/vagrant-0.8.10/bin/vagrant:26
from /usr/bin/vagrant:19:in `load'
from /usr/bin/vagrant:19
```

Trying to restore to the snapshot in the GUI produces this error:

```
Failed to restore the snapshot 1-postinstall.sh-4373d263c16c1317d798a0c3dc6c9cf0 of the virtual machine centos-57-64.

Could not open the medium '/Users/michael/VirtualBox VMs/centos-57-64/Snapshots/{561567b3-5678-49a9-b646-070285a9db16}.vdi'.

VD: error VERR_FILE_NOT_FOUND opening image file '/Users/michael/VirtualBox VMs/centos-57-64/Snapshots/{561567b3-5678-49a9-b646-070285a9db16}.vdi' (VERR_FILE_NOT_FOUND).

Result Code: NS_ERROR_FAILURE (0x80004005)
Component: Medium
Interface: IMedium {53f9cc0c-e0fd-40a5-a404-a7a5272082cd}
```

Trying to remove, restore, just recover anything isn't working.

Contents of relevant directories:

```
$ ll -R /Users/michael/VirtualBox\ VMs/centos-57-64/
total 2773192
drwxr-xr-x 5 michael staff 170 Dec 20 23:04 Logs
drwxr-xr-x 7 michael staff 238 Dec 20 23:18 Snapshots
-rw------- 1 michael staff 24868 Dec 20 23:21 centos-57-64.vbox
-rw------- 1 michael staff 24868 Dec 20 23:20 centos-57-64.vbox-prev
-rw------- 1 michael staff 1419816960 Dec 20 22:48 centos-57-64.vdi

/Users/michael/VirtualBox VMs/centos-57-64//Logs:
total 456
-rw------- 1 michael staff 73878 Dec 20 23:07 VBox.log
-rw------- 1 michael staff 74697 Dec 20 23:04 VBox.log.1
-rw------- 1 michael staff 76109 Dec 20 22:48 VBox.log.2

/Users/michael/VirtualBox VMs/centos-57-64//Snapshots:
total 3838704
-rw------- 1 michael staff 67322034 Dec 20 22:48 2011-12-21T03-48-40-466570000Z.sav
-rw------- 1 michael staff 132149800 Dec 20 23:04 2011-12-21T04-04-17-546543000Z.sav
-rw------- 1 michael staff 45056 Dec 20 23:18 {112c0252-9c6e-4fe3-9c34-7165923feb8c}.vdi
-rw------- 1 michael staff 1765847040 Dec 20 23:10 {2780d06e-c5ba-494c-ac97-dd5f29b5f8f2}.vdi
-rw------- 1 michael staff 45056 Dec 20 23:17 {7dc49450-5bf1-4a9c-8c41-0d28f8f27dba}.vdi
```

I cannot figure out how to recover from this state - trying many different ways, but may have to resort to destroying and starting over completely.