diff --git a/communicator/ssh/communicator.go b/communicator/ssh/communicator.go index a6ebeefa2..b08eec587 100644 --- a/communicator/ssh/communicator.go +++ b/communicator/ssh/communicator.go @@ -804,7 +804,10 @@ func scpUploadFile(dst string, src io.Reader, w io.Writer, r *bufio.Reader, fi * log.Println("[DEBUG] Copying input data into temporary file so we can read the length") if _, err := io.Copy(tf, src); err != nil { - return err + return fmt.Errorf("Error copying input data into local temporary "+ + "file. Check that TEMPDIR has enough space. Please see "+ + "https://www.packer.io/docs/other/environment-variables.html#tmpdir"+ + "for more info. Error: %s", err) } // Sync the file so that the contents are definitely on disk, then