hashicorp / packer

Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.
http://www.packer.io
Other
15.12k stars 3.33k forks source link

Uploading file fails #3104

Closed bcw1000 closed 8 years ago

bcw1000 commented 8 years ago

Note as well, I included several diagnostic commands in the sequence - I can find no temporary .pem file to use to check on the target:

jenkins@ip-10-35-176-32:~/jobs/d-infrastructure/workspace/d-infrastructure/src/main/resources/devops-automation-specification/lab$ packer -v
0.8.6
jenkins@ip-10-35-176-32:~/jobs/d-infrastructure/workspace/d-infrastructure/src/main/resources/devops-automation-specification/lab$ packer build -debug target/debugging.json 
Debug mode enabled. Builds will not be parallelized.
amazon-ebs output will be in this color.

==> amazon-ebs: Prevalidating AMI Name...
==> amazon-ebs: Pausing after run of step 'StepPreValidate'. Press enter to continue. 
==> amazon-ebs: Inspecting the source AMI...
==> amazon-ebs: Pausing after run of step 'StepSourceAMIInfo'. Press enter to continue. 
==> amazon-ebs: Pausing after run of step 'StepKeyPair'. Press enter to continue. 
==> amazon-ebs: Creating temporary security group for this instance...
==> amazon-ebs: Authorizing access to port 22 the temporary security group...
==> amazon-ebs: Pausing after run of step 'StepSecurityGroup'. Press enter to continue. 
==> amazon-ebs: Pausing after run of step 'stepCleanupVolumes'. Press enter to continue. 
==> amazon-ebs: Launching a source AWS instance...
    amazon-ebs: Instance ID: i-102272cf
==> amazon-ebs: Waiting for instance (i-102272cf) to become ready...
    amazon-ebs: Public DNS: ec2-54-206-28-156.ap-southeast-2.compute.amazonaws.com
    amazon-ebs: Public IP: 54.206.28.156
    amazon-ebs: Private IP: 172.31.5.20
==> amazon-ebs: Pausing after run of step 'StepRunSourceInstance'. Press enter to continue. 
==> amazon-ebs: Pausing after run of step 'StepGetPassword'. Press enter to continue. 
==> amazon-ebs: Waiting for SSH to become available...
==> amazon-ebs: Connected to SSH!
==> amazon-ebs: Pausing after run of step 'StepConnect'. Press enter to continue. 
==> amazon-ebs: Executing local command: ls -hal
    amazon-ebs: total 88K
    amazon-ebs: drwxr-xr-x 7 jenkins nogroup 4.0K Jan 24 06:06 .
    amazon-ebs: drwxr-xr-x 7 jenkins nogroup 4.0K Jan 21 04:07 ..
    amazon-ebs: -rw-r--r-- 1 jenkins nogroup  210 Jan 21 04:07 configure.yml
    amazon-ebs: drwxr-xr-x 2 jenkins nogroup 4.0K Jan 22 08:12 definitions
    amazon-ebs: drwxr-xr-x 2 jenkins nogroup 4.0K Jan 21 04:07 inventory
    amazon-ebs: -rw-r--r-- 1 jenkins nogroup    8 Jan 22 07:10 name
    amazon-ebs: -rw-r--r-- 1 jenkins nogroup  35K Jan 22 02:33 output.txt
    amazon-ebs: -rwxr-xr-x 1 jenkins nogroup 1.1K Jan 21 04:07 packer.sh
    amazon-ebs: -rw-r--r-- 1 jenkins nogroup  653 Jan 21 04:07 packer-template.yml
    amazon-ebs: drwxr-xr-x 3 jenkins nogroup 4.0K Jan 23 08:11 sources
    amazon-ebs: drwxr-xr-x 2 jenkins nogroup 4.0K Jan 24 07:24 target
    amazon-ebs: drwxr-xr-x 2 jenkins nogroup 4.0K Jan 24 05:59 templates
    amazon-ebs: -rw-r--r-- 1 jenkins nogroup  659 Jan 22 11:27 write-app-template.yml
    amazon-ebs: -rw-r--r-- 1 jenkins nogroup  663 Jan 22 11:27 write-haproxy-template.yml
==> amazon-ebs: Executing local command: id
    amazon-ebs: uid=106(jenkins) gid=65534(nogroup) groups=65534(nogroup)
==> amazon-ebs: Executing local command: find . -name *.pem
==> amazon-ebs: Executing local command: ls -l sources/server
    amazon-ebs: total 65224
    amazon-ebs: drwxr-xr-x 4 jenkins nogroup     4096 Jan 23 08:11 mappings
    amazon-ebs: -rw-r--r-- 1 jenkins nogroup 59921106 Jan 23 08:11 server-core-1.0.0-SNAPSHOT.jar
    amazon-ebs: -rw-r--r-- 1 jenkins nogroup  6854875 Jan 23 08:11 wiremock-server-1.0.0-SNAPSHOT-jar-with-dependencies.jar
==> amazon-ebs: Uploading sources/server/server-core-1.0.0-SNAPSHOT.jar => /tmp
==> amazon-ebs: Upload failed: Process exited with: 1. Reason was:  ()
==> amazon-ebs: Pausing before cleanup of step 'StepConnect'. Press enter to continue. 
==> amazon-ebs: Pausing before cleanup of step 'StepGetPassword'. Press enter to continue. 
==> amazon-ebs: Pausing before cleanup of step 'StepRunSourceInstance'. Press enter to continue. 
==> amazon-ebs: Terminating the source AWS instance...
==> amazon-ebs: Pausing before cleanup of step 'stepCleanupVolumes'. Press enter to continue. 
==> amazon-ebs: No AMIs to cleanup
==> amazon-ebs: Pausing before cleanup of step 'StepSecurityGroup'. Press enter to continue. 
==> amazon-ebs: Deleting temporary security group...
==> amazon-ebs: Pausing before cleanup of step 'StepKeyPair'. Press enter to continue. 
==> amazon-ebs: Pausing before cleanup of step 'StepSourceAMIInfo'. Press enter to continue. 
==> amazon-ebs: Pausing before cleanup of step 'StepPreValidate'. Press enter to continue. 
Build 'amazon-ebs' errored: Process exited with: 1. Reason was:  ()

==> Some builds didn't complete successfully and had errors:
--> amazon-ebs: Process exited with: 1. Reason was:  ()

==> Builds finished but no artifacts were created.
bcw1000 commented 8 years ago

The first line is packer -v. I ran this while shelled into our Jenkins machine, as user jenkins.

rickard-von-essen commented 8 years ago

This is probably a usage question and better handled on IRC or in the mailing list, see https://packer.io/community

Try rerunning without --debug but with env PACKER_LOG=1 and gist your log and template. Be sure to remove your AWS credentials before you gist it.

bcw1000 commented 8 years ago

Question listed: https://groups.google.com/forum/#!topic/packer-tool/WnV2kcjFFwY

bcw1000 commented 8 years ago

I do think this was a usage issue now. I specified the target file name as well as the target folder and the copy succeeded.