I am trying to build a centos7 image in Azure. I wanted to do so from my 
Windows machine so I tried to use the linux subsystem to do the ssh scp 
file copy. It keeps erroring with a broken pipe error:

Here is the provisioning step it fails on:
{
    "type": "shell",
    "script": "scripts/bootstrap.sh",
    "execute_command": "{{ .Vars }} sudo -E -S sh {{ .Path }}"
  },

Here is the output:

2018/03/27 20:21:56 packer: 2018/03/27 20:21:56 [DEBUG] Opening new ssh 
session
2018/03/27 20:21:56 packer: 2018/03/27 20:21:56 [DEBUG] starting remote 
command: test -d "/tmp/script_8567.sh"
2018/03/27 20:21:56 packer: 2018/03/27 20:21:56 [ERROR] Remote command 
exited with '1': test -d "/tmp/script_8567.sh"
2018/03/27 20:21:56 packer: 2018/03/27 20:21:56 [DEBUG] Opening new ssh 
session
2018/03/27 20:21:56 packer: 2018/03/27 20:21:56 [DEBUG] Starting remote scp 
process:  scp -vt /tmp
2018/03/27 20:21:56 packer: 2018/03/27 20:21:56 [DEBUG] Started SCP 
session, beginning transfers...
2018/03/27 20:21:56 packer: 2018/03/27 20:21:56 [DEBUG] scp: Uploading 
script_8567.sh: perms=C0777 size=134
2018/03/27 20:21:56 packer: 2018/03/27 20:21:56 [DEBUG] SCP session 
complete, closing stdin pipe.
2018/03/27 20:21:56 packer: 2018/03/27 20:21:56 [DEBUG] Waiting for SSH 
session to complete.
2018/03/27 20:21:57 packer: 2018/03/27 20:21:57 [DEBUG] non-zero exit 
status: 1
2018/03/27 20:21:57 packer: 2018/03/27 20:21:57 [DEBUG] scp output:  ╔scp: 
Broken pipe
2018/03/27 20:21:57 packer: 2018/03/27 20:21:57 Retryable error: Error 
uploading script: Process exited with status 1
2018/03/27 20:21:59 packer: 2018/03/27 20:21:59 [INFO] 129 bytes written 
for 'uploadData'
2018/03/27 20:21:59 [INFO] 129 bytes written for 'uploadData'

I dont know if this is even possible but I have done lots of things from 
the Linux Subsytem in Windows so it seemed like it should work.

Curiously I get the same error in powershell running (obviously) on Windows

2018/03/27 20:44:14 packer.exe: 2018/03/27 20:44:14 [DEBUG] Opening new ssh 
session
2018/03/27 20:44:14 packer.exe: 2018/03/27 20:44:14 [DEBUG] Starting remote 
scp process:  scp -vt /tmp
2018/03/27 20:44:14 packer.exe: 2018/03/27 20:44:14 [DEBUG] Started SCP 
session, beginning transfers...
2018/03/27 20:44:14 packer.exe: 2018/03/27 20:44:14 [DEBUG] scp: Uploading 
script_5049.sh: perms=C0666 size=134
2018/03/27 20:44:14 packer.exe: 2018/03/27 20:44:14 [DEBUG] SCP session 
complete, closing stdin pipe.
2018/03/27 20:44:14 packer.exe: 2018/03/27 20:44:14 [DEBUG] Waiting for SSH 
session to complete.
2018/03/27 20:44:14 packer.exe: 2018/03/27 20:44:14 [DEBUG] non-zero exit 
status: 1
2018/03/27 20:44:14 packer.exe: 2018/03/27 20:44:14 [DEBUG] scp output:  
 scp: Broken pipe
2018/03/27 20:44:14 packer.exe: 2018/03/27 20:44:14 Retryable error: Error 
uploading script: Process exited with status 1
2018/03/27 20:44:16 packer.exe: 2018/03/27 20:44:16 [INFO] 129 bytes 
written for 'uploadData'
2018/03/27 20:44:16 [INFO] 129 bytes written for 'uploadData'

So it seems like the issue is something outbound that would be similar 
between the two. I just cant think of what it would be. The packer script 
works on my coworker's mac so I know it is a problem on my end.

- John

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/8438c709-e585-45f2-9eae-a334df420d7c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to