Provisioning non-zero status: 1 I can't upload Shell scripts

428 views
Skip to first unread message

Savage Hacker

unread,
Jun 11, 2018, 8:23:40 AM6/11/18
to Packer
Hey Guys. I have an issue with telling Packer to provision my shell scripts. When I debugged using the PACKER_LOG I got this

2018/06/08 15:42:48 packer.exe: 2018/06/08 15:42:48 [DEBUG] Opening new ssh session
2018/06/08 15:42:48 packer.exe: 2018/06/08 15:42:48 [DEBUG] Starting remote scp process:  scp -vt /tmp
2018/06/08 15:42:48 packer.exe: 2018/06/08 15:42:48 [DEBUG] Started SCP session, beginning transfers...
2018/06/08 15:42:48 packer.exe: 2018/06/08 15:42:48 [DEBUG] scp: Uploading script_4852.sh: perms=C0666 size=275
2018/06/08 15:42:48 packer.exe: 2018/06/08 15:42:48 [DEBUG] SCP session complete, closing stdin pipe.
2018/06/08 15:42:48 packer.exe: 2018/06/08 15:42:48 [DEBUG] Waiting for SSH session to complete.
2018/06/08 15:42:48 packer.exe: 2018/06/08 15:42:48 [DEBUG] non-zero exit status: 1
2018/06/08 15:42:48 packer.exe: 2018/06/08 15:42:48 [DEBUG] scp output: Broken pipe
2018/06/08 15:42:48 packer.exe: 2018/06/08 15:42:48 Retryable error: Error uploading script: Process exited with status 1
2018/06/08 15:42:50 packer.exe: 2018/06/08 15:42:50 [INFO] 264 bytes written for 'uploadData'
2018/06/08 15:42:50 [INFO] 264 bytes written for 'uploadData'


I am developing Packer on Windows 10 and I am using Packer to create an Ubuntu operation system.

This is my Packer provision code
"provisioners": [
{
"type": "shell",
"script": "C:/Users/SavageHacker/automation/packer/scripts/install-virtualbox-guest-additions.sh"
}],


This is my shell scripts


#!/bin/bash

# Mount the disk image
cd
/tmp
mkdir
/tmp/isomount
mount
-t iso9660 -o loop /root/VBoxGuestAdditions.iso /tmp/isomount

# Install the drivers
/tmp/isomount/VBoxLinuxAdditions.run

# Cleanup
umount isomount
rm
-rf isomount /root/VBoxGuestAdditions.iso

Lastly, this is what I see on my Windows 10 powershell when I run packer


The reason it deregister and deletes the VM because it receives a signal interrupt.

Auto Generated Inline Image 1

Gabo Kete

unread,
Jun 11, 2018, 5:31:52 PM6/11/18
to Packer
so far what shows in the logs , packer can't scp the script into the box you are provisioning... try to fix the issues you have with ssh/scp , not an issue with packer as far as I can see.. you need to troubleshoot your connection from your host to your guest ( virtualbox)
Reply all
Reply to author
Forward
0 new messages