Skip to content
This repository has been archived by the owner on May 9, 2021. It is now read-only.

Build 'virtualbox-iso' errored: Retryable error: seek .: The handle is invalid. #44

Open
tknerr opened this issue Jan 30, 2015 · 5 comments

Comments

@tknerr
Copy link

tknerr commented Jan 30, 2015

Tried for a couple of times now, but always getting this error:

W:\repo\ubuntu-vm>make virtualbox/ubuntu1404
cd ./
rm -rf output-virtualbox-iso
mkdir -p box/virtualbox
packer build -only=virtualbox-iso -var 'cm=nocm' -var 'headless=' -var 'update=' -var 'version=1.0.12' -var 'ssh_username=vagrant' -var 'ssh_password=vagrant' -var 'install_vagrant_key=true' -var "iso_url=http://releases.ubuntu.com/14.04/ubuntu-14.04.1-server-amd64.iso" ubuntu1404.json
virtualbox-iso output will be in this color.

==> virtualbox-iso: Downloading or copying Guest additions
    virtualbox-iso: Downloading or copying: file:///C:/Program%20Files/Oracle/VirtualBox/VBoxGuestAdditions.iso
==> virtualbox-iso: Downloading or copying ISO
    virtualbox-iso: Downloading or copying: http://releases.ubuntu.com/14.04/ubuntu-14.04.1-server-amd64.iso
==> virtualbox-iso: Starting HTTP server on port 8703
==> virtualbox-iso: Creating virtual machine...
==> virtualbox-iso: Creating hard drive...
==> virtualbox-iso: Creating forwarded port mapping for SSH (host port 3525)
==> virtualbox-iso: Executing custom VBoxManage commands...
    virtualbox-iso: Executing: modifyvm ubuntu1404 --memory 512
    virtualbox-iso: Executing: modifyvm ubuntu1404 --cpus 1
==> virtualbox-iso: Starting the virtual machine...
...

<snip>
...
    virtualbox-iso: zlib1g:amd64                                        install
    virtualbox-iso: ==> Clearing last login information
    virtualbox-iso: 2379047+0 records in
    virtualbox-iso: 2379047+0 records out
    virtualbox-iso: 2436144128 bytes (2.4 GB) copied, 11.1682 s, 218 MB/s
    virtualbox-iso: 192000+0 records in
    virtualbox-iso: 192000+0 records out
    virtualbox-iso: 196608000 bytes (197 MB) copied, 0.987907 s, 199 MB/s
    virtualbox-iso: dd: error writing ‘/EMPTY’: No space left on device
    virtualbox-iso: 2491+0 records in
    virtualbox-iso: 2490+0 records out
    virtualbox-iso: 2610987008 bytes (2.6 GB) copied, 9.05889 s, 288 MB/s
    virtualbox-iso:
    virtualbox-iso:
    virtualbox-iso:
    virtualbox-iso:
==> virtualbox-iso: Provisioning with shell script: script/cmtool.sh
    virtualbox-iso: ==> Building box without baking in a configuration management tool
==> virtualbox-iso: Provisioning with shell script: .
==> virtualbox-iso: Unregistering and deleting virtual machine...
==> virtualbox-iso: Deleting output directory...
Build 'virtualbox-iso' errored: Retryable error: seek .: The handle is invalid.

==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso: Retryable error: seek .: The handle is invalid.

==> Builds finished but no artifacts were created.
make: *** [box/virtualbox/ubuntu1404-nocm-1.0.12.box] Error 1

W:\repo\ubuntu-vm>

Sounds like a disk space issue, but I hardly believe it is as I was trying with various disk_sizes and it's always the same effect. This one was with "disk_size": 4096 and I still have 60 GB free.

Environment:

  • Win7 64-bit
  • VirtualBox 4.3.12
  • Packer 0.7.5

Any ideas what could be wrong here?

@tknerr
Copy link
Author

tknerr commented Jan 31, 2015

Well okay, it's definitely not disk space, I got misled by the cleanup script.

Turning debugging on via PACKER_LOG=1 shows this:

2015/01/31 00:29:19 ui:     virtualbox-iso: ==> Building box without baking in a config
uration management tool
2015/01/31 00:29:19 packer-builder-virtualbox-iso.exe: 2015/01/31 00:29:19 remote comma
    virtualbox-iso: ==> Building box without baking in a configuration management tooln
d exited with '0': echo 'vagrant' | PACKER_BUILD_NAME='virtualbox-iso' PACKER_BUILDER_T
YPE='virtualbox-iso' CM='nocm' CM_VERSION='' CLEANUP_PAUSE='' UPDATE='' INSTALL_VAGRANT
_KEY='true' SSH_USERNAME='vagrant' SSH_PASSWORD='vagrant' http_proxy='' https_proxy=''
 ftp_proxy='' rsync_proxy='' no_proxy='' sudo -E -S bash '/tmp/script.sh'
2015/01/31 00:29:19 packer-builder-virtualbox-iso.exe: 2015/01/31 00:29:19 [INFO] RPC e
ndpoint: Communicator ended with: 0
2015/01/31 00:29:19 [INFO] 0 bytes written for 'stderr'
2015/01/31 00:29:19 [INFO] RPC client: Communicator ended with: 0
2015/01/31 00:29:19 [INFO] RPC endpoint: Communicator ended with: 0
2015/01/31 00:29:19 [INFO] 68 bytes written for 'stdout'
2015/01/31 00:29:19 packer-provisioner-shell.exe: 2015/01/31 00:29:19 [INFO] 0 bytes wr
itten for 'stderr'
2015/01/31 00:29:19 packer-provisioner-shell.exe: 2015/01/31 00:29:19 [INFO] RPC client
: Communicator ended with: 0
2015/01/31 00:29:19 packer-provisioner-shell.exe: 2015/01/31 00:29:19 [INFO] 68 bytes w
ritten for 'stdout'
2015/01/31 00:29:19 ui: ==> virtualbox-iso: Provisioning with shell script: .
2015/01/31 00:29:19 packer-provisioner-shell.exe: 2015/01/31 00:29:19 Opening . for rea
ding
2015/01/31 00:29:19 packer-provisioner-shell.exe: 2015/01/31 00:29:19 Retryable error:
seek .: The handle is invalid.
==> virtualbox-iso: Provisioning with shell script: .
2015/01/31 00:29:21 packer-provisioner-shell.exe: 2015/01/31 00:29:21 Retryable error:
seek .: The handle is invalid.
2015/01/31 00:29:23 packer-provisioner-shell.exe: 2015/01/31 00:29:23 Retryable error:
seek .: The handle is invalid.
2015/01/31 00:29:25 packer-provisioner-shell.exe: 2015/01/31 00:29:25 Retryable error:
seek .: The handle is invalid.

...

[ snip 5 minutes worth of log output ]

...

2015/01/31 00:34:15 packer-provisioner-shell.exe: 2015/01/31 00:34:15 Retryable error:
seek .: The handle is invalid.
2015/01/31 00:34:17 packer-provisioner-shell.exe: 2015/01/31 00:34:17 Retryable error:
seek .: The handle is invalid.
2015/01/31 00:34:19 packer-provisioner-shell.exe: 2015/01/31 00:34:19 Retryable error:
seek .: The handle is invalid.
2015/01/31 00:34:19 packer-builder-virtualbox-iso.exe: 2015/01/31 00:34:19 Executing VB
oxManage: []string{"controlvm", "ubuntu1404", "poweroff"}
2015/01/31 00:34:19 packer-builder-virtualbox-iso.exe: 2015/01/31 00:34:19 stdout:
2015/01/31 00:34:19 packer-builder-virtualbox-iso.exe: 2015/01/31 00:34:19 stderr: 0%..
.10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
2015/01/31 00:34:19 packer-builder-virtualbox-iso.exe: 2015/01/31 00:34:19 Executing VB
oxManage: []string{"storageattach", "ubuntu1404", "--storagectl", "IDE Controller", "--
port", "0", "--device", "1", "--medium", "none"}
2015/01/31 00:34:19 packer-builder-virtualbox-iso.exe: 2015/01/31 00:34:19 stdout:
2015/01/31 00:34:19 packer-builder-virtualbox-iso.exe: 2015/01/31 00:34:19 stderr:
2015/01/31 00:34:19 ui: ==> virtualbox-iso: Unregistering and deleting virtual machine.
..
2015/01/31 00:34:19 packer-builder-virtualbox-iso.exe: 2015/01/31 00:34:19 Executing VB
oxManage: []string{"unregistervm", "ubuntu1404", "--delete"}
==> virtualbox-iso: Unregistering and deleting virtual machine...
2015/01/31 00:34:20 packer-builder-virtualbox-iso.exe: 2015/01/31 00:34:20 stdout:
2015/01/31 00:34:20 packer-builder-virtualbox-iso.exe: 2015/01/31 00:34:20 stderr: 0%..
.10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
2015/01/31 00:34:20 ui: ==> virtualbox-iso: Deleting output directory...
2015/01/31 00:34:20 ui error: Build 'virtualbox-iso' errored: Retryable error: seek .:
The handle is invalid.
2015/01/31 00:34:20 Builds completed. Waiting on interrupt barrier...
==> virtualbox-iso: Deleting output directory...
2015/01/31 00:34:20 machine readable: error-count []string{"1"}
2015/01/31 00:34:20 ui error:
==> Some builds didn't complete successfully and had errors:
2015/01/31 00:34:20 machine readable: virtualbox-iso,error []string{"Retryable error: s
eek .: The handle is invalid."}
2015/01/31 00:34:20 ui error: --> virtualbox-iso: Retryable error: seek .: The handle i
s invalid.
2015/01/31 00:34:20 ui:
==> Builds finished but no artifacts were created.
2015/01/31 00:34:20 waiting for all plugin processes to complete...
Build 'virtualbox-iso' errored: Retryable error: seek .: The handle is invalid.

==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso: Retryable error: seek .: The handle is invalid.

==> Builds finished but no artifacts were created.
2015/01/31 00:34:20 c:\devel\bk23\tools\packer\packer-post-processor-vagrant.exe: plugi
n process exited
2015/01/31 00:34:20 c:\devel\bk23\tools\packer\packer-builder-virtualbox-iso.exe: plugi
n process exited
2015/01/31 00:34:20 c:\devel\bk23\tools\packer\packer-provisioner-shell.exe: plugin pro
cess exited
make: *** [box/virtualbox/ubuntu1404-nocm-1.0.12.box] Error 1

...which indicates an issue with the custom_script being set to .

I don't know what that should mean semantically, but I'll remove the custom_script part and try again...

@tknerr
Copy link
Author

tknerr commented Jan 31, 2015

@misheska FYI everything works now once I removed the "{{ user 'custom_script' }}" line here:
https://github.com/box-cutter/ubuntu-vm/blob/master/ubuntu1404-desktop.json#L150

What is the default of . supposed to do?
https://github.com/box-cutter/ubuntu-vm/blob/master/ubuntu1404-desktop.json#L19

@rasa
Copy link
Contributor

rasa commented Feb 2, 2015

Does any know if changing

"custom_script": "."

to

"custom_script": ""

or

"custom_script": "/dev/null"

or some other working default value would help?

@seal-ss
Copy link

seal-ss commented Feb 4, 2015

I have the same issue for VMware Workstation 10 on a Windows machine. Win 2008R2, Packer 0.7.5, VMware Workstation 10.0.0.5.

I'll have a look at it, too.

@StefanScherer
Copy link
Contributor

@rasa changing to "custom_script": "" does not work. Packer seems to check whether the file exists:

λ packer build --only=vmware-iso ubuntu1204.json
vmware-iso output will be in this color.

1 error(s) occurred:

* Bad script '': Stat : Das System kann den angegebenen Pfad nicht finden.

And changing to "custom_script": "nil" also does not work, at least on a Windows host:

λ packer build --only=vmware-iso ubuntu1204.json
vmware-iso output will be in this color.

1 error(s) occurred:

* Bad script '/dev/null': GetFileAttributesEx /dev/null: Das System kann den angegebenen Pfad nicht finden.

But also nil which is the equivalent on Windows in a CMD.exe does not work.

So I'll try another run with the suggested workaround to remove this line to build from a Windows host.

StefanScherer added a commit to StefanScherer/ubuntu-vm that referenced this issue Feb 4, 2015
StefanScherer added a commit to StefanScherer/ubuntu-vm that referenced this issue Jul 6, 2015
* 'my' of github.com:StefanScherer/ubuntu-vm:
  removed custom_script as discussed in box-cutter#44
  No more VagrantCloud downloads and Cloudbees no longer sponsoring
  fixed typo
  start video recording
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

4 participants