Skip to content

Instantly share code, notes, and snippets.

@andywirv
Last active April 16, 2019 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andywirv/347aa7f1f372c0f2d13430be838603a5 to your computer and use it in GitHub Desktop.
Save andywirv/347aa7f1f372c0f2d13430be838603a5 to your computer and use it in GitHub Desktop.
Packer early SSH issue
packer build template.json
2016/12/01 14:55:23 [INFO] Packer version: 0.12.0
2016/12/01 14:55:23 Packer Target OS/Arch: darwin amd64
2016/12/01 14:55:23 Built with Go Version: go1.7.3
2016/12/01 14:55:23 Detected home directory from env var: /Users/user
2016/12/01 14:55:23 Using internal plugin for parallels-iso
2016/12/01 14:55:23 Using internal plugin for vmware-vmx
2016/12/01 14:55:23 Using internal plugin for googlecompute
2016/12/01 14:55:23 Using internal plugin for qemu
2016/12/01 14:55:23 Using internal plugin for amazon-chroot
2016/12/01 14:55:23 Using internal plugin for amazon-ebsvolume
2016/12/01 14:55:23 Using internal plugin for digitalocean
2016/12/01 14:55:23 Using internal plugin for profitbricks
2016/12/01 14:55:23 Using internal plugin for virtualbox-iso
2016/12/01 14:55:23 Using internal plugin for virtualbox-ovf
2016/12/01 14:55:23 Using internal plugin for azure-arm
2016/12/01 14:55:23 Using internal plugin for docker
2016/12/01 14:55:23 Using internal plugin for parallels-pvm
2016/12/01 14:55:23 Using internal plugin for file
2016/12/01 14:55:23 Using internal plugin for null
2016/12/01 14:55:23 Using internal plugin for openstack
2016/12/01 14:55:23 Using internal plugin for vmware-iso
2016/12/01 14:55:23 Using internal plugin for amazon-ebs
2016/12/01 14:55:23 Using internal plugin for amazon-instance
2016/12/01 14:55:23 Using internal plugin for cloudstack
2016/12/01 14:55:23 Using internal plugin for shell-local
2016/12/01 14:55:23 Using internal plugin for windows-restart
2016/12/01 14:55:23 Using internal plugin for windows-shell
2016/12/01 14:55:23 Using internal plugin for ansible
2016/12/01 14:55:23 Using internal plugin for file
2016/12/01 14:55:23 Using internal plugin for puppet-server
2016/12/01 14:55:23 Using internal plugin for shell
2016/12/01 14:55:23 Using internal plugin for puppet-masterless
2016/12/01 14:55:23 Using internal plugin for salt-masterless
2016/12/01 14:55:23 Using internal plugin for ansible-local
2016/12/01 14:55:23 Using internal plugin for chef-client
2016/12/01 14:55:23 Using internal plugin for chef-solo
2016/12/01 14:55:23 Using internal plugin for powershell
2016/12/01 14:55:23 Using internal plugin for artifice
2016/12/01 14:55:23 Using internal plugin for checksum
2016/12/01 14:55:23 Using internal plugin for docker-save
2016/12/01 14:55:23 Using internal plugin for vagrant-cloud
2016/12/01 14:55:23 Using internal plugin for compress
2016/12/01 14:55:23 Using internal plugin for docker-tag
2016/12/01 14:55:23 Using internal plugin for vagrant
2016/12/01 14:55:23 Using internal plugin for amazon-import
2016/12/01 14:55:23 Using internal plugin for docker-import
2016/12/01 14:55:23 Using internal plugin for googlecompute-export
2016/12/01 14:55:23 Using internal plugin for manifest
2016/12/01 14:55:23 Using internal plugin for atlas
2016/12/01 14:55:23 Using internal plugin for docker-push
2016/12/01 14:55:23 Using internal plugin for shell-local
2016/12/01 14:55:23 Using internal plugin for vsphere
2016/12/01 14:55:23 Detected home directory from env var: /Users/airvine
2016/12/01 14:55:23 Attempting to open config file: /Users/airvine/.packerconfig
2016/12/01 14:55:23 [WARN] Config file doesn't exist: /Users/airvine/.packerconfig
2016/12/01 14:55:23 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[openstack:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-openstack vmware-vmx:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-vmware-vmx digitalocean:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-digitalocean virtualbox-ovf:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-virtualbox-ovf parallels-pvm:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-parallels-pvm amazon-ebs:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebs parallels-iso:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-parallels-iso qemu:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-qemu amazon-chroot:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-chroot docker:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-docker null:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-null amazon-instance:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-instance googlecompute:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-googlecompute virtualbox-iso:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-virtualbox-iso azure-arm:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-azure-arm file:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-file amazon-ebsvolume:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebsvolume profitbricks:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-profitbricks vmware-iso:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-vmware-iso cloudstack:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-cloudstack] PostProcessors:map[checksum:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-checksum docker-save:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-save amazon-import:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-amazon-import shell-local:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-shell-local compress:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-compress atlas:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-atlas artifice:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-artifice vagrant-cloud:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vagrant-cloud vagrant:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vagrant docker-import:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-import manifest:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-manifest docker-push:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-push docker-tag:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-tag googlecompute-export:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-googlecompute-export vsphere:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vsphere] Provisioners:map[windows-shell:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-windows-shell file:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-file puppet-masterless:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-puppet-masterless ansible-local:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-ansible-local chef-client:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-chef-client chef-solo:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-chef-solo shell-local:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-shell-local windows-restart:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-windows-restart shell:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-shell salt-masterless:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-salt-masterless powershell:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-powershell ansible:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-ansible puppet-server:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-puppet-server]}
2016/12/01 14:55:23 Setting cache directory: /Users/airvine/packer/pingfed/packer_cache
2016/12/01 14:55:23 Detected home directory from env var: /Users/airvine
2016/12/01 14:55:23 Loading builder: amazon-ebs
2016/12/01 14:55:23 Plugin could not be found. Checking same directory as executable.
2016/12/01 14:55:23 Current exe path: /usr/local/bin/packer
2016/12/01 14:55:23 Creating plugin client for path: /usr/local/bin/packer
2016/12/01 14:55:23 Starting plugin: /usr/local/bin/packer []string{"/usr/local/bin/packer", "plugin", "packer-builder-amazon-ebs"}
2016/12/01 14:55:23 Waiting for RPC address for: /usr/local/bin/packer
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 [INFO] Packer version: 0.12.0
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Packer Target OS/Arch: darwin amd64
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Built with Go Version: go1.7.3
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Detected home directory from env var: /Users/airvine
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Attempting to open config file: /Users/airvine/.packerconfig
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 [WARN] Config file doesn't exist: /Users/airvine/.packerconfig
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[] PostProcessors:map[] Provisioners:map[]}
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Setting cache directory: /Users/airvine/packer/pingfed/packer_cache
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 args: []string{"packer-builder-amazon-ebs"}
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Detected home directory from env var: /Users/airvine
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Plugin minimum port: 10000
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Plugin maximum port: 25000
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Plugin address: unix /var/folders/9r/33qg31vn7r5f0jvt92zqpyn570cfxw/T/packer-plugin933848072
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Waiting for connection...
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Serving a plugin connection...
2016/12/01 14:55:23 Loading provisioner: file
2016/12/01 14:55:23 Plugin could not be found. Checking same directory as executable.
2016/12/01 14:55:23 Current exe path: /usr/local/bin/packer
2016/12/01 14:55:23 Creating plugin client for path: /usr/local/bin/packer
2016/12/01 14:55:23 Starting plugin: /usr/local/bin/packer []string{"/usr/local/bin/packer", "plugin", "packer-provisioner-file"}
2016/12/01 14:55:23 Waiting for RPC address for: /usr/local/bin/packer
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 [INFO] Packer version: 0.12.0
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Packer Target OS/Arch: darwin amd64
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Built with Go Version: go1.7.3
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Detected home directory from env var: /Users/airvine
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Attempting to open config file: /Users/airvine/.packerconfig
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 [WARN] Config file doesn't exist: /Users/airvine/.packerconfig
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[] PostProcessors:map[] Provisioners:map[]}
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Setting cache directory: /Users/airvine/packer/pingfed/packer_cache
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 args: []string{"packer-provisioner-file"}
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Detected home directory from env var: /Users/airvine
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Plugin minimum port: 10000
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Plugin maximum port: 25000
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Plugin address: unix /var/folders/9r/33qg31vn7r5f0jvt92zqpyn570cfxw/T/packer-plugin533165320
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Waiting for connection...
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Serving a plugin connection...
2016/12/01 14:55:23 Loading provisioner: shell
2016/12/01 14:55:23 Plugin could not be found. Checking same directory as executable.
2016/12/01 14:55:23 Current exe path: /usr/local/bin/packer
2016/12/01 14:55:23 Creating plugin client for path: /usr/local/bin/packer
2016/12/01 14:55:23 Starting plugin: /usr/local/bin/packer []string{"/usr/local/bin/packer", "plugin", "packer-provisioner-shell"}
2016/12/01 14:55:23 Waiting for RPC address for: /usr/local/bin/packer
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 [INFO] Packer version: 0.12.0
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Packer Target OS/Arch: darwin amd64
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Built with Go Version: go1.7.3
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Detected home directory from env var: /Users/airvine
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Attempting to open config file: /Users/airvine/.packerconfig
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 [WARN] Config file doesn't exist: /Users/airvine/.packerconfig
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[] PostProcessors:map[] Provisioners:map[]}
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Setting cache directory: /Users/airvine/packer/pingfed/packer_cache
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 args: []string{"packer-provisioner-shell"}
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Plugin minimum port: 10000
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Plugin maximum port: 25000
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Detected home directory from env var: /Users/airvine
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Plugin address: unix /var/folders/9r/33qg31vn7r5f0jvt92zqpyn570cfxw/T/packer-plugin706054656
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Waiting for connection...
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Serving a plugin connection...
2016/12/01 14:55:23 ui: amazon-ebs output will be in this color.
2016/12/01 14:55:23 ui:
2016/12/01 14:55:23 Build debug mode: false
2016/12/01 14:55:23 Force build: false
2016/12/01 14:55:23 On error:
2016/12/01 14:55:23 Preparing build: amazon-ebs
amazon-ebs output will be in this color.
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 Config: {PackerConfig:{PackerBuildName:amazon-ebs PackerBuilderType:amazon-ebs PackerDebug:false PackerForce:false PackerOnError: PackerUserVars:map[aws_secret_key: aws_access_key:]} AccessConfig:{AccessKey: SecretKey: RawRegion:eu-west-1 SkipValidation:false Token: ProfileName:} AMIConfig:{AMIName:packer-example-1480604123 AMIDescription: AMIVirtType: AMIUsers:[] AMIGroups:[] AMIProductCodes:[] AMIRegions:[] AMISkipRegionValidation:false AMITags:map[] AMIEnhancedNetworking:false AMIForceDeregister:false AMIEncryptBootVolume:false} BlockDevices:{AMIBlockDevices:{AMIMappings:[]} LaunchBlockDevices:{LaunchMappings:[]}} RunConfig:{AssociatePublicIpAddress:false AvailabilityZone: EbsOptimized:false IamInstanceProfile: InstanceType:t2.small RunTags:map[] SourceAmi:ami-ed82e39e SourceAmiFilter:{Filters:map[] Owners:[] MostRecent:false} SpotPrice: SpotPriceAutoProduct: DisableStopInstance:false SecurityGroupId: SecurityGroupIds:[sg-f9c6479f] SubnetId:subnet-1d9f9875 TemporaryKeyPairName:packer_584039db-0987-1a5e-4925-4d4e5887cf44 UserData: UserDataFile:user_data.sh WindowsPasswordTimeout:10m0s VpcId: InstanceInitiatedShutdownBehavior:stop Comm:{Type:ssh SSHHost: SSHPort:22 SSHUsername:root SSHPassword: SSHPrivateKey: SSHPty:false SSHTimeout:5m0s SSHAgentAuth:false SSHDisableAgent:false SSHHandshakeAttempts:10 SSHBastionHost: SSHBastionPort:0 SSHBastionUsername: SSHBastionPassword: SSHBastionPrivateKey: SSHFileTransferMethod:scp WinRMUser: WinRMPassword: WinRMHost: WinRMPort:0 WinRMTimeout:0s WinRMUseSSL:false WinRMInsecure:false WinRMTransportDecorator:<nil>} SSHKeyPairName: SSHPrivateIp:false} VolumeRunTags:map[] ctx:{Data:<nil> Funcs:map[clean_ami_name:0x4da810] UserVariables:map[aws_access_key: aws_secret_key:] EnableEnv:false BuildName:amazon-ebs BuildType:amazon-ebs TemplatePath:/Users/airvine/packer/pingfed/template.json}}
2016/12/01 14:55:23 Waiting on builds to complete...
2016/12/01 14:55:23 Starting build run: amazon-ebs
2016/12/01 14:55:23 Running builder: amazon-ebs
2016/12/01 14:55:23 packer: 2016/12/01 14:55:23 [INFO] Finding AZ for the given subnet 'subnet-1d9f9875'
2016/12/01 14:55:24 packer: 2016/12/01 14:55:24 [INFO] AZ found: 'eu-west-1a'
2016/12/01 14:55:24 ui: ==> amazon-ebs: Prevalidating AMI Name...
==> amazon-ebs: Prevalidating AMI Name...
2016/12/01 14:55:25 packer: 2016/12/01 14:55:25 Using AMI Filters {
2016/12/01 14:55:25 packer: ImageIds: ["ami-ed82e39e"]
2016/12/01 14:55:25 packer: }
2016/12/01 14:55:25 ui: amazon-ebs: Found Image ID: ami-ed82e39e
amazon-ebs: Found Image ID: ami-ed82e39e
2016/12/01 14:55:25 ui: ==> amazon-ebs: Creating temporary keypair: packer_584039db-0987-1a5e-4925-4d4e5887cf44
==> amazon-ebs: Creating temporary keypair: packer_584039db-0987-1a5e-4925-4d4e5887cf44
2016/12/01 14:55:26 packer: 2016/12/01 14:55:26 Using specified security groups: [sg-f9c6479f]
2016/12/01 14:55:26 packer: 2016/12/01 14:55:26 [DEBUG] Waiting for tempSecurityGroup: sg-f9c6479f
2016/12/01 14:55:26 packer: 2016/12/01 14:55:26 [DEBUG] Found security group sg-f9c6479f
2016/12/01 14:55:26 packer: 2016/12/01 14:55:26 [DEBUG] base64 encoding user data...
2016/12/01 14:55:26 ui: ==> amazon-ebs: Launching a source AWS instance...
==> amazon-ebs: Launching a source AWS instance...
2016/12/01 14:55:26 ui: amazon-ebs: Instance ID: i-d4f8c83c
amazon-ebs: Instance ID: i-d4f8c83c
2016/12/01 14:55:26 ui: ==> amazon-ebs: Waiting for instance (i-d4f8c83c) to become ready...
==> amazon-ebs: Waiting for instance (i-d4f8c83c) to become ready...
2016/12/01 14:55:26 packer: 2016/12/01 14:55:26 Waiting for state to become: running
2016/12/01 14:55:26 packer: 2016/12/01 14:55:26 Using 2s as polling delay (change with AWS_POLL_DELAY_SECONDS)
2016/12/01 14:55:26 packer: 2016/12/01 14:55:26 Allowing 300s to complete (change with AWS_TIMEOUT_SECONDS)
2016/12/01 14:55:47 packer: 2016/12/01 14:55:47 [INFO] Not using winrm communicator, skipping get password...
2016/12/01 14:55:47 packer: 2016/12/01 14:55:47 [INFO] Waiting for SSH, up to timeout: 5m0s
2016/12/01 14:55:47 ui: ==> amazon-ebs: Waiting for SSH to become available...
==> amazon-ebs: Waiting for SSH to become available...
2016/12/01 14:56:02 packer: 2016/12/01 14:56:02 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 172.31.25.112:22: i/o timeout
2016/12/01 14:56:08 packer: 2016/12/01 14:56:08 [INFO] Attempting SSH connection...
2016/12/01 14:56:08 packer: 2016/12/01 14:56:08 reconnecting to TCP connection for SSH
2016/12/01 14:56:08 packer: 2016/12/01 14:56:08 handshaking with SSH
2016/12/01 14:56:08 packer: 2016/12/01 14:56:08 handshake complete!
2016/12/01 14:56:08 packer: 2016/12/01 14:56:08 opening new ssh session
2016/12/01 14:56:08 packer: 2016/12/01 14:56:08 [ERROR] RequestAgentForwarding: &errors.errorString{s:"forwarding request denied"}
2016/12/01 14:56:08 ui: ==> amazon-ebs: Connected to SSH!
==> amazon-ebs: Connected to SSH!
2016/12/01 14:56:08 packer: 2016/12/01 14:56:08 Running the provision hook
2016/12/01 14:56:08 ui: ==> amazon-ebs: Uploading test.txt => /tmp/test.txt
==> amazon-ebs: Uploading test.txt => /tmp/test.txt
2016/12/01 14:56:08 packer: 2016/12/01 14:56:08 [INFO] 0 bytes written for 'uploadData'
2016/12/01 14:56:08 [INFO] 0 bytes written for 'uploadData'
2016/12/01 14:56:08 packer: 2016/12/01 14:56:08 opening new ssh session
2016/12/01 14:56:08 packer: 2016/12/01 14:56:08 Starting remote scp process: scp -vt /tmp
2016/12/01 14:56:08 packer: 2016/12/01 14:56:08 Started SCP session, beginning transfers...
2016/12/01 14:56:08 packer: 2016/12/01 14:56:08 [DEBUG] scp: Uploading test.txt: perms=C0644 size=0
2016/12/01 14:56:08 ui error: ==> amazon-ebs: Upload failed: lease login as the user "ubuntu" rather than the user "root".
==> amazon-ebs: Upload failed: lease login as the user "ubuntu" rather than the user "root".
2016/12/01 14:56:08 ui: ==> amazon-ebs: Terminating the source AWS instance...
==> amazon-ebs: Terminating the source AWS instance...
2016/12/01 14:56:09 packer: 2016/12/01 14:56:09 Waiting for state to become: terminated
2016/12/01 14:56:09 packer: 2016/12/01 14:56:09 Using 2s as polling delay (change with AWS_POLL_DELAY_SECONDS)
2016/12/01 14:56:09 packer: 2016/12/01 14:56:09 Allowing 300s to complete (change with AWS_TIMEOUT_SECONDS)
2016/12/01 14:57:13 ui: ==> amazon-ebs: Cleaning up any extra volumes...
==> amazon-ebs: Cleaning up any extra volumes...
2016/12/01 14:57:13 ui: ==> amazon-ebs: No volumes to clean up, skipping
==> amazon-ebs: No volumes to clean up, skipping
2016/12/01 14:57:13 ui: ==> amazon-ebs: Deleting temporary keypair...
==> amazon-ebs: Deleting temporary keypair...
2016/12/01 14:57:14 ui error: Build 'amazon-ebs' errored: lease login as the user "ubuntu" rather than the user "root".
2016/12/01 14:57:14 Builds completed. Waiting on interrupt barrier...
2016/12/01 14:57:14 machine readable: error-count []string{"1"}
2016/12/01 14:57:14 ui error:
==> Some builds didn't complete successfully and had errors:
2016/12/01 14:57:14 machine readable: amazon-ebs,error []string{"lease login as the user \"ubuntu\" rather than the user \"root\"."}
2016/12/01 14:57:14 ui error: --> amazon-ebs: lease login as the user "ubuntu" rather than the user "root".
2016/12/01 14:57:14 ui:
==> Builds finished but no artifacts were created.
2016/12/01 14:57:14 waiting for all plugin processes to complete...
Build 'amazon-ebs' errored: lease login as the user "ubuntu" rather than the user "root".
==> Some builds didn't complete successfully and had errors:
--> amazon-ebs: lease login as the user "ubuntu" rather than the user "root".
==> Builds finished but no artifacts were created.
packer build template2.json
2016/12/01 14:59:17 [INFO] Packer version: 0.12.0
2016/12/01 14:59:17 Packer Target OS/Arch: darwin amd64
2016/12/01 14:59:17 Built with Go Version: go1.7.3
2016/12/01 14:59:17 Detected home directory from env var: /Users/user
2016/12/01 14:59:17 Using internal plugin for amazon-ebsvolume
2016/12/01 14:59:17 Using internal plugin for digitalocean
2016/12/01 14:59:17 Using internal plugin for vmware-vmx
2016/12/01 14:59:17 Using internal plugin for amazon-chroot
2016/12/01 14:59:17 Using internal plugin for amazon-ebs
2016/12/01 14:59:17 Using internal plugin for file
2016/12/01 14:59:17 Using internal plugin for googlecompute
2016/12/01 14:59:17 Using internal plugin for qemu
2016/12/01 14:59:17 Using internal plugin for virtualbox-iso
2016/12/01 14:59:17 Using internal plugin for virtualbox-ovf
2016/12/01 14:59:17 Using internal plugin for amazon-instance
2016/12/01 14:59:17 Using internal plugin for azure-arm
2016/12/01 14:59:17 Using internal plugin for null
2016/12/01 14:59:17 Using internal plugin for parallels-iso
2016/12/01 14:59:17 Using internal plugin for profitbricks
2016/12/01 14:59:17 Using internal plugin for vmware-iso
2016/12/01 14:59:17 Using internal plugin for cloudstack
2016/12/01 14:59:17 Using internal plugin for docker
2016/12/01 14:59:17 Using internal plugin for openstack
2016/12/01 14:59:17 Using internal plugin for parallels-pvm
2016/12/01 14:59:17 Using internal plugin for ansible
2016/12/01 14:59:17 Using internal plugin for chef-solo
2016/12/01 14:59:17 Using internal plugin for file
2016/12/01 14:59:17 Using internal plugin for shell
2016/12/01 14:59:17 Using internal plugin for windows-restart
2016/12/01 14:59:17 Using internal plugin for windows-shell
2016/12/01 14:59:17 Using internal plugin for ansible-local
2016/12/01 14:59:17 Using internal plugin for chef-client
2016/12/01 14:59:17 Using internal plugin for powershell
2016/12/01 14:59:17 Using internal plugin for puppet-masterless
2016/12/01 14:59:17 Using internal plugin for puppet-server
2016/12/01 14:59:17 Using internal plugin for salt-masterless
2016/12/01 14:59:17 Using internal plugin for shell-local
2016/12/01 14:59:17 Using internal plugin for docker-import
2016/12/01 14:59:17 Using internal plugin for docker-save
2016/12/01 14:59:17 Using internal plugin for manifest
2016/12/01 14:59:17 Using internal plugin for vagrant
2016/12/01 14:59:17 Using internal plugin for vsphere
2016/12/01 14:59:17 Using internal plugin for checksum
2016/12/01 14:59:17 Using internal plugin for compress
2016/12/01 14:59:17 Using internal plugin for shell-local
2016/12/01 14:59:17 Using internal plugin for artifice
2016/12/01 14:59:17 Using internal plugin for atlas
2016/12/01 14:59:17 Using internal plugin for docker-push
2016/12/01 14:59:17 Using internal plugin for vagrant-cloud
2016/12/01 14:59:17 Using internal plugin for amazon-import
2016/12/01 14:59:17 Using internal plugin for docker-tag
2016/12/01 14:59:17 Using internal plugin for googlecompute-export
2016/12/01 14:59:17 Detected home directory from env var: /Users/airvine
2016/12/01 14:59:17 Attempting to open config file: /Users/airvine/.packerconfig
2016/12/01 14:59:17 [WARN] Config file doesn't exist: /Users/airvine/.packerconfig
2016/12/01 14:59:17 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[amazon-instance:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-instance docker:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-docker digitalocean:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-digitalocean vmware-vmx:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-vmware-vmx amazon-ebs:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebs file:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-file azure-arm:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-azure-arm null:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-null profitbricks:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-profitbricks amazon-chroot:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-chroot googlecompute:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-googlecompute qemu:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-qemu virtualbox-iso:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-virtualbox-iso virtualbox-ovf:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-virtualbox-ovf amazon-ebsvolume:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebsvolume parallels-iso:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-parallels-iso vmware-iso:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-vmware-iso cloudstack:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-cloudstack openstack:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-openstack parallels-pvm:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-parallels-pvm] PostProcessors:map[docker-import:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-import shell-local:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-shell-local atlas:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-atlas docker-push:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-push vsphere:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vsphere amazon-import:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-amazon-import manifest:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-manifest vagrant:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vagrant artifice:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-artifice vagrant-cloud:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vagrant-cloud docker-tag:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-tag googlecompute-export:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-googlecompute-export docker-save:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-save checksum:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-checksum compress:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-compress] Provisioners:map[file:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-file shell:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-shell chef-client:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-chef-client puppet-server:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-puppet-server ansible:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-ansible chef-solo:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-chef-solo windows-restart:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-windows-restart windows-shell:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-windows-shell ansible-local:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-ansible-local powershell:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-powershell puppet-masterless:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-puppet-masterless salt-masterless:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-salt-masterless shell-local:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-shell-local]}
2016/12/01 14:59:17 Setting cache directory: /Users/airvine/packer/pingfed/packer_cache
2016/12/01 14:59:17 Detected home directory from env var: /Users/airvine
2016/12/01 14:59:17 Loading builder: amazon-ebs
2016/12/01 14:59:17 Plugin could not be found. Checking same directory as executable.
2016/12/01 14:59:17 Current exe path: /usr/local/bin/packer
2016/12/01 14:59:17 Creating plugin client for path: /usr/local/bin/packer
2016/12/01 14:59:17 Starting plugin: /usr/local/bin/packer []string{"/usr/local/bin/packer", "plugin", "packer-builder-amazon-ebs"}
2016/12/01 14:59:17 Waiting for RPC address for: /usr/local/bin/packer
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 [INFO] Packer version: 0.12.0
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 Packer Target OS/Arch: darwin amd64
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 Built with Go Version: go1.7.3
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 Detected home directory from env var: /Users/airvine
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 Attempting to open config file: /Users/airvine/.packerconfig
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 [WARN] Config file doesn't exist: /Users/airvine/.packerconfig
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[] PostProcessors:map[] Provisioners:map[]}
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 Setting cache directory: /Users/airvine/packer/pingfed/packer_cache
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 args: []string{"packer-builder-amazon-ebs"}
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 Detected home directory from env var: /Users/airvine
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 Plugin minimum port: 10000
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 Plugin maximum port: 25000
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 Plugin address: unix /var/folders/9r/33qg31vn7r5f0jvt92zqpyn570cfxw/T/packer-plugin748231141
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 Waiting for connection...
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 Serving a plugin connection...
2016/12/01 14:59:17 Loading provisioner: shell
2016/12/01 14:59:17 Plugin could not be found. Checking same directory as executable.
2016/12/01 14:59:17 Current exe path: /usr/local/bin/packer
2016/12/01 14:59:17 Creating plugin client for path: /usr/local/bin/packer
2016/12/01 14:59:17 Starting plugin: /usr/local/bin/packer []string{"/usr/local/bin/packer", "plugin", "packer-provisioner-shell"}
2016/12/01 14:59:17 Waiting for RPC address for: /usr/local/bin/packer
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 [INFO] Packer version: 0.12.0
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 Packer Target OS/Arch: darwin amd64
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 Built with Go Version: go1.7.3
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 Detected home directory from env var: /Users/airvine
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 Attempting to open config file: /Users/airvine/.packerconfig
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 [WARN] Config file doesn't exist: /Users/airvine/.packerconfig
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[] PostProcessors:map[] Provisioners:map[]}
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 Setting cache directory: /Users/airvine/packer/pingfed/packer_cache
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 args: []string{"packer-provisioner-shell"}
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 Plugin minimum port: 10000
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 Plugin maximum port: 25000
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 Detected home directory from env var: /Users/airvine
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 Plugin address: unix /var/folders/9r/33qg31vn7r5f0jvt92zqpyn570cfxw/T/packer-plugin733758287
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 Waiting for connection...
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 Serving a plugin connection...
2016/12/01 14:59:17 ui: amazon-ebs output will be in this color.
2016/12/01 14:59:17 ui:
2016/12/01 14:59:17 Build debug mode: false
2016/12/01 14:59:17 Force build: false
2016/12/01 14:59:17 On error:
2016/12/01 14:59:17 Preparing build: amazon-ebs
amazon-ebs output will be in this color.
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 Config: {PackerConfig:{PackerBuildName:amazon-ebs PackerBuilderType:amazon-ebs PackerDebug:false PackerForce:false PackerOnError: PackerUserVars:map[aws_access_key: aws_secret_key:]} AccessConfig:{AccessKey: SecretKey: RawRegion:eu-west-1 SkipValidation:false Token: ProfileName:} AMIConfig:{AMIName:packer-example-1480604357 AMIDescription: AMIVirtType: AMIUsers:[] AMIGroups:[] AMIProductCodes:[] AMIRegions:[] AMISkipRegionValidation:false AMITags:map[] AMIEnhancedNetworking:false AMIForceDeregister:false AMIEncryptBootVolume:false} BlockDevices:{AMIBlockDevices:{AMIMappings:[]} LaunchBlockDevices:{LaunchMappings:[]}} RunConfig:{AssociatePublicIpAddress:false AvailabilityZone: EbsOptimized:false IamInstanceProfile: InstanceType:t2.small RunTags:map[] SourceAmi:ami-ed82e39e SourceAmiFilter:{Filters:map[] Owners:[] MostRecent:false} SpotPrice: SpotPriceAutoProduct: DisableStopInstance:false SecurityGroupId: SecurityGroupIds:[sg-f9c6479f] SubnetId:subnet-1d9f9875 TemporaryKeyPairName:packer_58403ac5-3c62-bd77-6bed-a0971b191f26 UserData: UserDataFile:user_data.sh WindowsPasswordTimeout:10m0s VpcId: InstanceInitiatedShutdownBehavior:stop Comm:{Type:ssh SSHHost: SSHPort:22 SSHUsername:root SSHPassword: SSHPrivateKey: SSHPty:false SSHTimeout:5m0s SSHAgentAuth:false SSHDisableAgent:false SSHHandshakeAttempts:10 SSHBastionHost: SSHBastionPort:0 SSHBastionUsername: SSHBastionPassword: SSHBastionPrivateKey: SSHFileTransferMethod:scp WinRMUser: WinRMPassword: WinRMHost: WinRMPort:0 WinRMTimeout:0s WinRMUseSSL:false WinRMInsecure:false WinRMTransportDecorator:<nil>} SSHKeyPairName: SSHPrivateIp:false} VolumeRunTags:map[] ctx:{Data:<nil> Funcs:map[clean_ami_name:0x4da810] UserVariables:map[aws_access_key: aws_secret_key:] EnableEnv:false BuildName:amazon-ebs BuildType:amazon-ebs TemplatePath:/Users/airvine/packer/pingfed/template2.json}}
2016/12/01 14:59:17 Waiting on builds to complete...
2016/12/01 14:59:17 Starting build run: amazon-ebs
2016/12/01 14:59:17 Running builder: amazon-ebs
2016/12/01 14:59:17 packer: 2016/12/01 14:59:17 [INFO] Finding AZ for the given subnet 'subnet-1d9f9875'
2016/12/01 14:59:18 packer: 2016/12/01 14:59:18 [INFO] AZ found: 'eu-west-1a'
2016/12/01 14:59:18 ui: ==> amazon-ebs: Prevalidating AMI Name...
==> amazon-ebs: Prevalidating AMI Name...
2016/12/01 14:59:19 packer: 2016/12/01 14:59:19 Using AMI Filters {
2016/12/01 14:59:19 packer: ImageIds: ["ami-ed82e39e"]
2016/12/01 14:59:19 packer: }
2016/12/01 14:59:19 ui: amazon-ebs: Found Image ID: ami-ed82e39e
amazon-ebs: Found Image ID: ami-ed82e39e
2016/12/01 14:59:19 ui: ==> amazon-ebs: Creating temporary keypair: packer_58403ac5-3c62-bd77-6bed-a0971b191f26
==> amazon-ebs: Creating temporary keypair: packer_58403ac5-3c62-bd77-6bed-a0971b191f26
2016/12/01 14:59:19 packer: 2016/12/01 14:59:19 Using specified security groups: [sg-f9c6479f]
2016/12/01 14:59:19 packer: 2016/12/01 14:59:19 [DEBUG] Waiting for tempSecurityGroup: sg-f9c6479f
2016/12/01 14:59:19 packer: 2016/12/01 14:59:19 [DEBUG] Found security group sg-f9c6479f
2016/12/01 14:59:19 packer: 2016/12/01 14:59:19 [DEBUG] base64 encoding user data...
2016/12/01 14:59:19 ui: ==> amazon-ebs: Launching a source AWS instance...
==> amazon-ebs: Launching a source AWS instance...
2016/12/01 14:59:20 ui: amazon-ebs: Instance ID: i-72faca9a
amazon-ebs: Instance ID: i-72faca9a
2016/12/01 14:59:20 ui: ==> amazon-ebs: Waiting for instance (i-72faca9a) to become ready...
==> amazon-ebs: Waiting for instance (i-72faca9a) to become ready...
2016/12/01 14:59:20 packer: 2016/12/01 14:59:20 Waiting for state to become: running
2016/12/01 14:59:20 packer: 2016/12/01 14:59:20 Using 2s as polling delay (change with AWS_POLL_DELAY_SECONDS)
2016/12/01 14:59:20 packer: 2016/12/01 14:59:20 Allowing 300s to complete (change with AWS_TIMEOUT_SECONDS)
2016/12/01 14:59:39 packer: 2016/12/01 14:59:39 [INFO] Not using winrm communicator, skipping get password...
2016/12/01 14:59:39 packer: 2016/12/01 14:59:39 [INFO] Waiting for SSH, up to timeout: 5m0s
2016/12/01 14:59:39 ui: ==> amazon-ebs: Waiting for SSH to become available...
==> amazon-ebs: Waiting for SSH to become available...
2016/12/01 14:59:54 packer: 2016/12/01 14:59:54 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 172.31.25.21:22: i/o timeout
2016/12/01 15:00:01 packer: 2016/12/01 15:00:01 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 172.31.25.21:22: getsockopt: connection refused
2016/12/01 15:00:06 packer: 2016/12/01 15:00:06 [DEBUG] TCP connection to SSH ip/port failed: dial tcp 172.31.25.21:22: getsockopt: connection refused
2016/12/01 15:00:11 packer: 2016/12/01 15:00:11 [INFO] Attempting SSH connection...
2016/12/01 15:00:11 packer: 2016/12/01 15:00:11 reconnecting to TCP connection for SSH
2016/12/01 15:00:11 packer: 2016/12/01 15:00:11 handshaking with SSH
2016/12/01 15:00:12 packer: 2016/12/01 15:00:12 handshake complete!
2016/12/01 15:00:12 packer: 2016/12/01 15:00:12 opening new ssh session
2016/12/01 15:00:12 packer: 2016/12/01 15:00:12 [ERROR] RequestAgentForwarding: &errors.errorString{s:"forwarding request denied"}
2016/12/01 15:00:12 ui: ==> amazon-ebs: Connected to SSH!
==> amazon-ebs: Connected to SSH!
2016/12/01 15:00:12 packer: 2016/12/01 15:00:12 Running the provision hook
2016/12/01 15:00:12 ui: ==> amazon-ebs: Provisioning with shell script: /var/folders/9r/33qg31vn7r5f0jvt92zqpyn570cfxw/T/packer-shell011109986
==> amazon-ebs: Provisioning with shell script: /var/folders/9r/33qg31vn7r5f0jvt92zqpyn570cfxw/T/packer-shell011109986
2016/12/01 15:00:12 packer: 2016/12/01 15:00:12 Opening /var/folders/9r/33qg31vn7r5f0jvt92zqpyn570cfxw/T/packer-shell011109986 for reading
2016/12/01 15:00:12 packer: 2016/12/01 15:00:12 [INFO] 72 bytes written for 'uploadData'
2016/12/01 15:00:12 packer: 2016/12/01 15:00:12 opening new ssh session
2016/12/01 15:00:12 [INFO] 72 bytes written for 'uploadData'
2016/12/01 15:00:12 packer: 2016/12/01 15:00:12 Starting remote scp process: scp -vt /tmp
2016/12/01 15:00:12 packer: 2016/12/01 15:00:12 Started SCP session, beginning transfers...
2016/12/01 15:00:12 packer: 2016/12/01 15:00:12 Copying input data into temporary file so we can read the length
2016/12/01 15:00:12 packer: 2016/12/01 15:00:12 [DEBUG] scp: Uploading script_9810.sh: perms=C0644 size=72
2016/12/01 15:00:12 packer: 2016/12/01 15:00:12 Retryable error: Error uploading script: lease login as the user "ubuntu" rather than the user "root".
2016/12/01 15:00:14 packer: 2016/12/01 15:00:14 [INFO] 72 bytes written for 'uploadData'
2016/12/01 15:00:14 [INFO] 72 bytes written for 'uploadData'
2016/12/01 15:00:14 packer: 2016/12/01 15:00:14 opening new ssh session
2016/12/01 15:00:14 packer: 2016/12/01 15:00:14 Starting remote scp process: scp -vt /tmp
2016/12/01 15:00:14 packer: 2016/12/01 15:00:14 Started SCP session, beginning transfers...
2016/12/01 15:00:14 packer: 2016/12/01 15:00:14 Copying input data into temporary file so we can read the length
2016/12/01 15:00:14 packer: 2016/12/01 15:00:14 [DEBUG] scp: Uploading script_9810.sh: perms=C0644 size=72
2016/12/01 15:00:14 packer: 2016/12/01 15:00:14 Retryable error: Error uploading script: lease login as the user "ubuntu" rather than the user "root".
2016/12/01 15:00:16 packer: 2016/12/01 15:00:16 [INFO] 72 bytes written for 'uploadData'
2016/12/01 15:00:16 [INFO] 72 bytes written for 'uploadData'
2016/12/01 15:00:16 packer: 2016/12/01 15:00:16 opening new ssh session
2016/12/01 15:00:16 packer: 2016/12/01 15:00:16 Starting remote scp process: scp -vt /tmp
2016/12/01 15:00:16 packer: 2016/12/01 15:00:16 Started SCP session, beginning transfers...
2016/12/01 15:00:16 packer: 2016/12/01 15:00:16 Copying input data into temporary file so we can read the length
2016/12/01 15:00:16 packer: 2016/12/01 15:00:16 [DEBUG] scp: Uploading script_9810.sh: perms=C0644 size=72
2016/12/01 15:00:16 packer: 2016/12/01 15:00:16 Retryable error: Error uploading script: lease login as the user "ubuntu" rather than the user "root".
2016/12/01 15:00:18 packer: 2016/12/01 15:00:18 [INFO] 72 bytes written for 'uploadData'
2016/12/01 15:00:18 [INFO] 72 bytes written for 'uploadData'
2016/12/01 15:00:18 packer: 2016/12/01 15:00:18 opening new ssh session
2016/12/01 15:00:18 packer: 2016/12/01 15:00:18 Starting remote scp process: scp -vt /tmp
2016/12/01 15:00:19 packer: 2016/12/01 15:00:19 Started SCP session, beginning transfers...
2016/12/01 15:00:19 packer: 2016/12/01 15:00:19 Copying input data into temporary file so we can read the length
2016/12/01 15:00:19 packer: 2016/12/01 15:00:19 [DEBUG] scp: Uploading script_9810.sh: perms=C0644 size=72
2016/12/01 15:00:19 packer: 2016/12/01 15:00:19 Retryable error: Error uploading script: lease login as the user "ubuntu" rather than the user "root".
2016/12/01 15:00:21 packer: 2016/12/01 15:00:21 [INFO] 72 bytes written for 'uploadData'
2016/12/01 15:00:21 [INFO] 72 bytes written for 'uploadData'
2016/12/01 15:00:21 packer: 2016/12/01 15:00:21 opening new ssh session
2016/12/01 15:00:21 packer: 2016/12/01 15:00:21 Starting remote scp process: scp -vt /tmp
2016/12/01 15:00:21 packer: 2016/12/01 15:00:21 Started SCP session, beginning transfers...
2016/12/01 15:00:21 packer: 2016/12/01 15:00:21 Copying input data into temporary file so we can read the length
2016/12/01 15:00:21 packer: 2016/12/01 15:00:21 [DEBUG] scp: Uploading script_9810.sh: perms=C0644 size=72
2016/12/01 15:00:21 packer: 2016/12/01 15:00:21 Retryable error: Error uploading script: lease login as the user "ubuntu" rather than the user "root".
2016/12/01 15:00:23 packer: 2016/12/01 15:00:23 [INFO] 72 bytes written for 'uploadData'
2016/12/01 15:00:23 packer: 2016/12/01 15:00:23 opening new ssh session
2016/12/01 15:00:23 [INFO] 72 bytes written for 'uploadData'
2016/12/01 15:00:23 packer: 2016/12/01 15:00:23 Starting remote scp process: scp -vt /tmp
2016/12/01 15:00:23 packer: 2016/12/01 15:00:23 Started SCP session, beginning transfers...
2016/12/01 15:00:23 packer: 2016/12/01 15:00:23 Copying input data into temporary file so we can read the length
2016/12/01 15:00:23 packer: 2016/12/01 15:00:23 [DEBUG] scp: Uploading script_9810.sh: perms=C0644 size=72
2016/12/01 15:00:23 packer: 2016/12/01 15:00:23 Retryable error: Error uploading script: lease login as the user "ubuntu" rather than the user "root".
2016/12/01 15:00:25 packer: 2016/12/01 15:00:25 [INFO] 72 bytes written for 'uploadData'
2016/12/01 15:00:25 [INFO] 72 bytes written for 'uploadData'
2016/12/01 15:00:25 packer: 2016/12/01 15:00:25 opening new ssh session
2016/12/01 15:00:25 packer: 2016/12/01 15:00:25 Starting remote scp process: scp -vt /tmp
2016/12/01 15:00:25 packer: 2016/12/01 15:00:25 Started SCP session, beginning transfers...
2016/12/01 15:00:25 packer: 2016/12/01 15:00:25 Copying input data into temporary file so we can read the length
2016/12/01 15:00:25 packer: 2016/12/01 15:00:25 [DEBUG] scp: Uploading script_9810.sh: perms=C0644 size=72
2016/12/01 15:00:25 packer: 2016/12/01 15:00:25 Retryable error: Error uploading script: lease login as the user "ubuntu" rather than the user "root".
2016/12/01 15:00:27 packer: 2016/12/01 15:00:27 [INFO] 72 bytes written for 'uploadData'
2016/12/01 15:00:27 [INFO] 72 bytes written for 'uploadData'
2016/12/01 15:00:27 packer: 2016/12/01 15:00:27 opening new ssh session
2016/12/01 15:00:27 packer: 2016/12/01 15:00:27 Starting remote scp process: scp -vt /tmp
2016/12/01 15:00:27 packer: 2016/12/01 15:00:27 Started SCP session, beginning transfers...
2016/12/01 15:00:27 packer: 2016/12/01 15:00:27 Copying input data into temporary file so we can read the length
2016/12/01 15:00:27 packer: 2016/12/01 15:00:27 [DEBUG] scp: Uploading script_9810.sh: perms=C0644 size=72
2016/12/01 15:00:27 packer: 2016/12/01 15:00:27 Retryable error: Error uploading script: lease login as the user "ubuntu" rather than the user "root".
2016/12/01 15:00:29 packer: 2016/12/01 15:00:29 [INFO] 72 bytes written for 'uploadData'
2016/12/01 15:00:29 [INFO] 72 bytes written for 'uploadData'
2016/12/01 15:00:29 packer: 2016/12/01 15:00:29 opening new ssh session
2016/12/01 15:00:29 packer: 2016/12/01 15:00:29 Starting remote scp process: scp -vt /tmp
2016/12/01 15:00:29 packer: 2016/12/01 15:00:29 Started SCP session, beginning transfers...
2016/12/01 15:00:29 packer: 2016/12/01 15:00:29 Copying input data into temporary file so we can read the length
2016/12/01 15:00:29 packer: 2016/12/01 15:00:29 [DEBUG] scp: Uploading script_9810.sh: perms=C0644 size=72
2016/12/01 15:00:29 packer: 2016/12/01 15:00:29 Retryable error: Error uploading script: lease login as the user "ubuntu" rather than the user "root".
2016/12/01 15:00:31 packer: 2016/12/01 15:00:31 [INFO] 72 bytes written for 'uploadData'
2016/12/01 15:00:31 [INFO] 72 bytes written for 'uploadData'
2016/12/01 15:00:31 packer: 2016/12/01 15:00:31 opening new ssh session
2016/12/01 15:00:31 packer: 2016/12/01 15:00:31 Starting remote scp process: scp -vt /tmp
2016/12/01 15:00:31 packer: 2016/12/01 15:00:31 Started SCP session, beginning transfers...
2016/12/01 15:00:31 packer: 2016/12/01 15:00:31 Copying input data into temporary file so we can read the length
2016/12/01 15:00:31 packer: 2016/12/01 15:00:31 [DEBUG] scp: Uploading script_9810.sh: perms=C0644 size=72
2016/12/01 15:00:31 packer: 2016/12/01 15:00:31 Retryable error: Error uploading script: lease login as the user "ubuntu" rather than the user "root".
2016/12/01 15:00:33 packer: 2016/12/01 15:00:33 [INFO] 72 bytes written for 'uploadData'
2016/12/01 15:00:33 [INFO] 72 bytes written for 'uploadData'
2016/12/01 15:00:33 packer: 2016/12/01 15:00:33 opening new ssh session
2016/12/01 15:00:33 packer: 2016/12/01 15:00:33 Starting remote scp process: scp -vt /tmp
2016/12/01 15:00:33 packer: 2016/12/01 15:00:33 Started SCP session, beginning transfers...
2016/12/01 15:00:33 packer: 2016/12/01 15:00:33 Copying input data into temporary file so we can read the length
2016/12/01 15:00:33 packer: 2016/12/01 15:00:33 [DEBUG] scp: Uploading script_9810.sh: perms=C0644 size=72
2016/12/01 15:00:33 packer: 2016/12/01 15:00:33 Retryable error: Error uploading script: lease login as the user "ubuntu" rather than the user "root".
^C2016/12/01 15:00:33 Closing stdin because interrupt received.
2016/12/01 15:00:33 Stopping build: amazon-ebs
2016/12/01 15:00:33 packer: 2016/12/01 15:00:33 Received interrupt signal (count: 1). Ignoring.
2016/12/01 15:00:33 packer: 2016/12/01 15:00:33 Received interrupt signal (count: 1). Ignoring.
2016/12/01 15:00:33 packer: 2016/12/01 15:00:33 Cancelling the step runner...
2016/12/01 15:00:33 packer: 2016/12/01 15:00:33 Cancelling provisioning due to interrupt...
2016/12/01 15:00:33 Provisioner.Cancel err: unexpected EOF
2016/12/01 15:00:33 /usr/local/bin/packer: plugin process exited
2016/12/01 15:00:33 ui: ==> amazon-ebs: Terminating the source AWS instance...
==> amazon-ebs: Terminating the source AWS instance...
2016/12/01 15:00:34 packer: 2016/12/01 15:00:34 Waiting for state to become: terminated
2016/12/01 15:00:34 packer: 2016/12/01 15:00:34 Using 2s as polling delay (change with AWS_POLL_DELAY_SECONDS)
2016/12/01 15:00:34 packer: 2016/12/01 15:00:34 Allowing 300s to complete (change with AWS_TIMEOUT_SECONDS)
{
"variables": {
"aws_access_key": "",
"aws_secret_key": ""
},
"builders": [
{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"ami_name": "packer-example-{{timestamp}}",
"instance_type": "t2.small",
"region": "eu-west-1",
"secret_key": "{{user `aws_secret_key`}}",
"source_ami": "ami-ed82e39e",
"ssh_username": "root",
"subnet_id": "subnet-1d9f9875",
"security_group_ids": "sg-f9c6479f",
"user_data_file": "user_data.sh"
}
],
"provisioners": [
{
"type": "file",
"source": "test.txt",
"destination": "/tmp/test.txt"
},
{
"type": "shell",
"inline_shebang": "/bin/bash -e",
"inline": [
"sleep 10",
"adduser testuser --disabled-password --gecos \"\"",
"mv /tmp/test.txt /tmp/moved.txt"
]
}
]
}
{
"variables": {
"aws_access_key": "",
"aws_secret_key": ""
},
"builders": [
{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"ami_name": "packer-example-{{timestamp}}",
"instance_type": "t2.small",
"region": "eu-west-1",
"secret_key": "{{user `aws_secret_key`}}",
"source_ami": "ami-ed82e39e",
"ssh_username": "root",
"subnet_id": "subnet-1d9f9875",
"security_group_ids": "sg-f9c6479f",
"user_data_file": "user_data.sh"
}
],
"provisioners": [
{
"type": "shell",
"inline_shebang": "/bin/bash -e",
"inline": [
"sleep 10",
"adduser testuser --disabled-password --gecos \"\""
]
}
]
}
@MushuEE
Copy link

MushuEE commented Apr 16, 2019

Was this SSH issue solved? I am hitting the same: Build 'openstack' errored: Retryable error: Error uploading script: lease login as the user "ubuntu" rather than the user "root".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment