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

Use user cache folder for Packer temporary files #45

Closed
Yorinh opened this issue Mar 8, 2017 · 6 comments
Closed

Use user cache folder for Packer temporary files #45

Yorinh opened this issue Mar 8, 2017 · 6 comments

Comments

@Yorinh
Copy link

Yorinh commented Mar 8, 2017

Hello !
I've a weird issue when i build a machine :

    virtualbox-iso (vagrant): Copying from artifact: builds/packer-virtualbox-iso-1488985646-disk1.vmdk
Build 'virtualbox-iso' errored: 1 error(s) occurred:

* Post-processor failed: write /tmp/packer720373497/packer-virtualbox-iso-1488985646-disk1.vmdk: no space left on device

==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso: 1 error(s) occurred:

* Post-processor failed: write /tmp/packer720373497/packer-virtualbox-iso-1488985646-disk1.vmdk: no space left on device

==> Builds finished but no artifacts were created.

----------------------------------
packer completed with return code 1
Packer failed. Build failed. Exiting...

I tried to change my TMPDIR / PACKER_CACHE_DIR / PACKER_TMP_DIR var but no luck...

I checked my disks ofc, still have space:

/dev/sdb2          117G    9,0G  102G   9% /
/dev/sda1          458G    109G  326G  26% /home

I try to run malboxes on ArchLinux without the package from AUR. (Manual install from github)

Thx for the project !

@obilodeau
Copy link
Member

What OS are you trying to build? Can you try with -d also?

@Yorinh
Copy link
Author

Yorinh commented Mar 13, 2017

Hello !

I try to bootup a win64

Here the output with -d

sudo malboxes -d build win10_64_analyst :
[...]
2017/03/13 11:14:53 ui:     virtualbox-iso (vagrant): Copying from artifact: builds/packer-virtualbox-iso-1489398639-disk1.vmdk
    virtualbox-iso (vagrant): Copying from artifact: builds/packer-virtualbox-iso-1489398639-disk1.vmdk
2017/03/13 11:14:56 Deleting original artifact for build 'virtualbox-iso'
2017/03/13 11:14:57 ui error: Build 'virtualbox-iso' errored: 1 error(s) occurred:

* Post-processor failed: write /tmp/packer370413124/packer-virtualbox-iso-1489398639-disk1.vmdk: no space left on device
2017/03/13 11:14:57 Builds completed. Waiting on interrupt barrier...
2017/03/13 11:14:57 machine readable: error-count []string{"1"}
2017/03/13 11:14:57 ui error:
==> Some builds didn't complete successfully and had errors:
2017/03/13 11:14:57 machine readable: virtualbox-iso,error []string{"1 error(s) occurred:\n\n* Post-processor failed: write /tmp/packer370413124/packer-virtualbox-iso-1489398639-disk1.vmdk: no space left on device"}
2017/03/13 11:14:57 ui error: --> virtualbox-iso: 1 error(s) occurred:

* Post-processor failed: write /tmp/packer370413124/packer-virtualbox-iso-1489398639-disk1.vmdk: no space left on device
2017/03/13 11:14:57 ui:
==> Builds finished but no artifacts were created.
2017/03/13 11:14:57 waiting for all plugin processes to complete...
Build 'virtualbox-iso' errored: 1 error(s) occurred:

* Post-processor failed: write /tmp/packer370413124/packer-virtualbox-iso-1489398639-disk1.vmdk: no space left on device

==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso: 1 error(s) occurred:

* Post-processor failed: write /tmp/packer370413124/packer-virtualbox-iso-1489398639-disk1.vmdk: no space left on device

==> Builds finished but no artifacts were created.
2017/03/13 11:14:57 /usr/bin/packer: plugin process exited
2017/03/13 11:14:57 /usr/bin/packer: plugin process exited
2017/03/13 11:14:57 /usr/bin/packer: plugin process exited
2017/03/13 11:14:57 /usr/bin/packer: plugin process exited
----------------------------------
packer completed with return code: 1
Packer failed. Build failed. Exiting...

Thanks for your help :)

@obilodeau
Copy link
Member

Is your /tmp partition a tmpfs filesystem? Run this command and give us the output:

df /tmp

On my arch system, /tmp is a tmpfs with 8Gb available (half of my RAM). I didn't realize that until now.

I wonder what step is making that copy on /tmp... We can either avoid that copy (best) or at least do it in malboxes' cache folder.

@obilodeau
Copy link
Member

By the way, you should not need to run malboxes with sudo if your user is a member of the vboxusers group.

@Yorinh
Copy link
Author

Yorinh commented Mar 14, 2017

df /tmp
tmpfs 4041388 612 4040776 1% /tmp

Same behavior as you, half of my RAM.

Here is an ouput of the install with -d searching for tmp folder:

[antivirus@Jyo:~/malboxes][3]$ malboxes -d build win10_64_analyst > loginstall                                                                  (03-13 11:14)
[antivirus@Jyo:~/malboxes]$ cat loginstall| grep tmp                                                                                            (03-13 17:40)
2017/03/13 17:07:02 packer: 2017/03/13 17:07:02 Plugin address: unix /home/antivirus/tmp/packer-plugin594183778
2017/03/13 17:07:02 packer: 2017/03/13 17:07:02 Plugin address: unix /home/antivirus/tmp/packer-plugin357747520
2017/03/13 17:07:02 packer: 2017/03/13 17:07:02 Plugin address: unix /home/antivirus/tmp/packer-plugin888326448
2017/03/13 17:07:02 packer: 2017/03/13 17:07:02 Plugin address: unix /home/antivirus/tmp/packer-plugin403047843
2017/03/13 17:07:30 packer: 2017/03/13 17:07:30 Floppy path: /home/antivirus/tmp/packer610146276
2017/03/13 17:07:31 packer: 2017/03/13 17:07:31 Copying floppy to temp location: /home/antivirus/tmp/packer892249075/floppy.vfd
2017/03/13 17:07:31 packer: 2017/03/13 17:07:31 Executing VBoxManage: []string{"storageattach", "packer-virtualbox-iso-1489421222", "--storagectl", "Floppy Controller", "--port", "0", "--device", "0", "--type", "fdd", "--medium", "/home/antivirus/tmp/packer892249075/floppy.vfd"}
2017/03/13 17:17:39 ui: ==> virtualbox-iso: Provisioning with shell script: /home/antivirus/tmp/packer-windows-shell-provisioner153366223
==> virtualbox-iso: Provisioning with shell script: /home/antivirus/tmp/packer-windows-shell-provisioner153366223
2017/03/13 17:17:39 packer: 2017/03/13 17:17:39 Opening /home/antivirus/tmp/packer-windows-shell-provisioner153366223 for reading
2017/03/13 17:36:36 packer: 2017/03/13 17:36:36 Deleting floppy disk: /home/antivirus/tmp/packer610146276
2017/03/13 17:37:47 packer: 2017/03/13 17:37:47 Renaming: '/home/antivirus/tmp/packer951738534/packer-virtualbox-iso-1489421222.ovf' => box.ovf
2017/03/13 17:37:47 packer: 2017/03/13 17:37:47 Turning dir into box: /home/antivirus/tmp/packer951738534 => boxes/win10_64_analyst.box
2017/03/13 17:37:47 packer: 2017/03/13 17:37:47 Skipping directory '/home/antivirus/tmp/packer951738534' for box 'boxes/win10_64_analyst.box'
2017/03/13 17:37:47 packer: 2017/03/13 17:37:47 Box add: '/home/antivirus/tmp/packer951738534/Vagrantfile' to 'boxes/win10_64_analyst.box'
2017/03/13 17:37:47 packer: 2017/03/13 17:37:47 Box add: '/home/antivirus/tmp/packer951738534/box.ovf' to 'boxes/win10_64_analyst.box'
2017/03/13 17:37:47 packer: 2017/03/13 17:37:47 Box add: '/home/antivirus/tmp/packer951738534/metadata.json' to 'boxes/win10_64_analyst.box'
2017/03/13 17:37:47 packer: 2017/03/13 17:37:47 Box add: '/home/antivirus/tmp/packer951738534/packer-virtualbox-iso-1489421222-disk1.vmdk' to 'boxes/win10_64_analyst.box'

I check the groups for my user, vboxusers is idd already assign.

Checking path show us that my /tmp/ dir changed to the one i set on my var env.
After checking my loginstall, seems like the remove of sudo did the trick... I really don't get it but... it's working now !
Maybe put a warning with the size of /tmp and the trick to avoid this behavior.

Thanks again !

@Yorinh Yorinh closed this as completed Mar 14, 2017
@obilodeau
Copy link
Member

I think I'll override packer's temporary location with malboxes' cache folder by default. This will centralize most of malboxes' cache files and so should be more obvious to users.

@obilodeau obilodeau reopened this Mar 14, 2017
@obilodeau obilodeau changed the title No space left on device Use user cache folder for Packer temporary files Jul 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants