{"action":"created","issue":{"url":"https://api.github.com/repos/docker/machine/issues/2222","repository_url":"https://api.github.com/repos/docker/machine","labels_url":"https://api.github.com/repos/docker/machine/issues/2222/labels{/name}","comments_url":"https://api.github.com/repos/docker/machine/issues/2222/comments","events_url":"https://api.github.com/repos/docker/machine/issues/2222/events","html_url":"https://github.com/docker/machine/issues/2222","id":115776538,"number":2222,"title":"aws driver ssh exits with 255 (v5)","user":{"login":"hsingh23","id":1136514,"avatar_url":"https://avatars.githubusercontent.com/u/1136514?v=3","gravatar_id":"","url":"https://api.github.com/users/hsingh23","html_url":"https://github.com/hsingh23","followers_url":"https://api.github.com/users/hsingh23/followers","following_url":"https://api.github.com/users/hsingh23/following{/other_user}","gists_url":"https://api.github.com/users/hsingh23/gists{/gist_id}","starred_url":"https://api.github.com/users/hsingh23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hsingh23/subscriptions","organizations_url":"https://api.github.com/users/hsingh23/orgs","repos_url":"https://api.github.com/users/hsingh23/repos","events_url":"https://api.github.com/users/hsingh23/events{/privacy}","received_events_url":"https://api.github.com/users/hsingh23/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/machine/labels/area/ssh","name":"area/ssh","color":"006b75"},{"url":"https://api.github.com/repos/docker/machine/labels/driver/ec2","name":"driver/ec2","color":"bfdadc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-09T01:31:06Z","updated_at":"2016-03-14T19:50:10Z","closed_at":null,"body":"Docker Machine v5, (aws ec2), default ami, us-west-2 region\r\nWhen i run the create command - I get the following:\r\n\r\nGetting to WaitForSSH function...\r\n(aws01) Calling RpcServerDriver.GetSSHHostname\r\n(aws01) DBG | Making AWS API call with values:\r\n(aws01) DBG | {\r\n(aws01) DBG |     \"Action\": [\r\n(aws01) DBG |         \"DescribeInstances\"\r\n(aws01) DBG |     ],\r\n(aws01) DBG |     \"InstanceId.1\": [\r\n(aws01) DBG |         \"i-dce67318\"\r\n(aws01) DBG |     ],\r\n(aws01) DBG |     \"Version\": [\r\n(aws01) DBG |         \"2014-06-15\"\r\n(aws01) DBG |     ]\r\n(aws01) DBG | }\r\n(aws01) Calling RpcServerDriver.GetSSHPort\r\n(aws01) Calling RpcServerDriver.GetSSHKeyPath\r\n(aws01) Calling RpcServerDriver.GetSSHUsername\r\nUsing SSH client type: external\r\nAbout to run SSH command:\r\nexit 0\r\nSSH cmd err, output: exit status 255: \r\nError getting ssh command 'exit 0' : Something went wrong running an SSH command!\r\ncommand : exit 0\r\nerr     : exit status 255\r\noutput  : \r\n\r\n\r\nThe aws instance is spun up, but the certs are not in the .docker/machine/machines/aws01/ folder\r\n➜  ~  ls .docker/machine/machines/aws01/             \r\nconfig.json  id_rsa  id_rsa.pub\r\n\r\n\r\nThe really weird part is that this very command created an instance before and ssh worked, then i put my computer to sleep, came back and ssh was disconnected so I closed the terminal and tried sshing in again and got the same error. It had previously generated the certs in the folder, but I removed the machine I couldn't find the key pair used to ssh in (my ssh foo is awful). So I removed the instance and recreated it. Now the certs are not the machiene folder (maybe they are some where else) but ssh still does not work. (it may be an permission's error, I'm new to aws - but I don't think this is the case as I didn't change anything and it worked the first time...)"},"comment":{"url":"https://api.github.com/repos/docker/machine/issues/comments/196494947","html_url":"https://github.com/docker/machine/issues/2222#issuecomment-196494947","issue_url":"https://api.github.com/repos/docker/machine/issues/2222","id":196494947,"user":{"login":"kirstin","id":564775,"avatar_url":"https://avatars.githubusercontent.com/u/564775?v=3","gravatar_id":"","url":"https://api.github.com/users/kirstin","html_url":"https://github.com/kirstin","followers_url":"https://api.github.com/users/kirstin/followers","following_url":"https://api.github.com/users/kirstin/following{/other_user}","gists_url":"https://api.github.com/users/kirstin/gists{/gist_id}","starred_url":"https://api.github.com/users/kirstin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kirstin/subscriptions","organizations_url":"https://api.github.com/users/kirstin/orgs","repos_url":"https://api.github.com/users/kirstin/repos","events_url":"https://api.github.com/users/kirstin/events{/privacy}","received_events_url":"https://api.github.com/users/kirstin/received_events","type":"User","site_admin":false},"created_at":"2016-03-14T19:50:10Z","updated_at":"2016-03-14T19:50:10Z","body":"I think I have the same error.\r\n\r\n    PS C:\\Users\\Menthol> docker-machine -D create --driver amazonec2 --amazonec2-access-key **** --amazonec2\r\n    -secret-key ****** --amazonec2-region us-west-2 --amazonec2-vpc-id vpc-05e81b61 --amaz\r\n    onec2-zone b aws11\r\n    Docker Machine Version: 0.5.2 ( 0456b9f )\r\n    Found binary path at C:\\Program Files\\Docker Toolbox\\docker-machine-driver-amazonec2.exe\r\n    Launching plugin server for driver amazonec2\r\n    Plugin server listening at address 127.0.0.1:52601\r\n    () Calling .GetVersion\r\n    Using API Version 1\r\n    () Calling .SetConfigRaw\r\n    () Calling .GetMachineName\r\n    (flag-lookup) Calling .GetCreateFlags\r\n    Making call to close connection to plugin binary\r\n    Making call to close driver server\r\n    (flag-lookup) Calling .Close\r\n    Successfully made call to close driver server\r\n    Found binary path at C:\\Program Files\\Docker Toolbox\\docker-machine-driver-amazonec2.exe\r\n    Launching plugin server for driver amazonec2\r\n    Plugin server listening at address 127.0.0.1:52605\r\n    () Calling .GetVersion\r\n    Using API Version 1\r\n    () Calling .SetConfigRaw\r\n    () Calling .GetMachineName\r\n    (aws11) Calling .GetMachineName\r\n    (aws11) Calling .DriverName\r\n    (aws11) Calling .GetCreateFlags\r\n    (aws11) Calling .SetConfigFromFlags\r\n    Running pre-create checks...\r\n    (aws11) Calling .PreCreateCheck\r\n    (aws11) DBG | Making AWS API call with values:\r\n    (aws11) DBG | {\r\n    (aws11) DBG |     \"Action\": [\r\n    (aws11) DBG |         \"DescribeKeyPairs\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"Version\": [\r\n    (aws11) DBG |         \"2014-06-15\"\r\n    (aws11) DBG |     ]\r\n    (aws11) DBG | }\r\n    (aws11) DBG | Making AWS API call with values:\r\n    (aws11) DBG | {\r\n    (aws11) DBG |     \"Action\": [\r\n    (aws11) DBG |         \"DescribeSubnets\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"Filter.1.Name\": [\r\n    (aws11) DBG |         \"availabilityZone\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"Filter.1.Value\": [\r\n    (aws11) DBG |         \"us-west-2b\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"Filter.2.Name\": [\r\n    (aws11) DBG |         \"vpc-id\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"Filter.2.Value\": [\r\n    (aws11) DBG |         \"vpc-05e81b61\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"Version\": [\r\n    (aws11) DBG |         \"2014-06-15\"\r\n    (aws11) DBG |     ]\r\n    (aws11) DBG | }\r\n    (aws11) Calling .GetConfigRaw\r\n    Creating machine...\r\n    (aws11) Calling .Create\r\n    (aws11) DBG | Making AWS API call with values:\r\n    (aws11) DBG | {\r\n    (aws11) DBG |     \"Action\": [\r\n    (aws11) DBG |         \"DescribeKeyPairs\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"Version\": [\r\n    (aws11) DBG |         \"2014-06-15\"\r\n    (aws11) DBG |     ]\r\n    (aws11) DBG | }\r\n    (aws11) Launching instance...\r\n    (aws11) DBG | creating key pair: aws11\r\n    (aws11) DBG | Making AWS API call with values:\r\n    (aws11) DBG | {\r\n    (aws11) DBG |     \"Action\": [\r\n    (aws11) DBG |         \"ImportKeyPair\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"KeyName\": [\r\n    (aws11) DBG |         \"aws11\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"PublicKeyMaterial\": [\r\n    (aws11) DBG |         \"c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCQVFESEtuSm1sSVRRZjUyZG80YUNVYU9IM0Y4ZUc1UlU1dHd1S\r\n    HIrbnNEcC9vK2RoY3V4cmlRZzdBTkN5T0VxYWdZNG1zNTM3TkFFRDlseW1kM0w1SWhnbFN1ZU52c0tqamVjbVJmdGQybm8wSlR0NCtPWTNma3JaNUlMOUJ1T\r\n    CtXUm1lYjRwUXVSdisvbWtISzdTK29ORXdKVzNwdzVkRm5FK3Fja2c1VThMdk9LTTk4L0N5YkJnRW9NMzl4RVFiMUJkZVJ2OXh2VXoxMjYvSWNyTGRpbDEvU\r\n    E1UcDRlekNJeWJqaXYzU0lIRFlUd29iVnNRcnpkZytkQ09qaTE0N0ZYN0lyamJXc1c5Mnl2TXZNb09HU1lWajVlQkszQTU2YXpOc002STBZNWtoa2cxWHcrQ\r\n    3N0bCtJdU1TMHRQSUdBeDRvakVMYXFpY2E5K0RHcDkyME1wZW4K\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"Version\": [\r\n    (aws11) DBG |         \"2014-06-15\"\r\n    (aws11) DBG |     ]\r\n    (aws11) DBG | }\r\n    (aws11) DBG | configuring security group in vpc-05e81b61\r\n    (aws11) DBG | Making AWS API call with values:\r\n    (aws11) DBG | {\r\n    (aws11) DBG |     \"Action\": [\r\n    (aws11) DBG |         \"DescribeSecurityGroups\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"Version\": [\r\n    (aws11) DBG |         \"2014-06-15\"\r\n    (aws11) DBG |     ]\r\n    (aws11) DBG | }\r\n    (aws11) DBG | found existing security group (docker-machine) in vpc-05e81b61\r\n    (aws11) DBG | configuring security group authorization for 0.0.0.0/0\r\n    (aws11) DBG | launching instance in subnet subnet-cd5f99a9\r\n    (aws11) DBG | Making AWS API call with values:\r\n    (aws11) DBG | {\r\n    (aws11) DBG |     \"Action\": [\r\n    (aws11) DBG |         \"RunInstances\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"BlockDeviceMapping.0.DeviceName\": [\r\n    (aws11) DBG |         \"/dev/sda1\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"BlockDeviceMapping.0.Ebs.DeleteOnTermination\": [\r\n    (aws11) DBG |         \"1\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"BlockDeviceMapping.0.Ebs.VolumeSize\": [\r\n    (aws11) DBG |         \"16\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"BlockDeviceMapping.0.Ebs.VolumeType\": [\r\n    (aws11) DBG |         \"gp2\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"BlockDeviceMapping.0.VirtualName\": [\r\n    (aws11) DBG |         \"\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"ImageId\": [\r\n    (aws11) DBG |         \"ami-7f675e4f\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"InstanceType\": [\r\n    (aws11) DBG |         \"t2.micro\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"KeyName\": [\r\n    (aws11) DBG |         \"aws11\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"MaxCount\": [\r\n    (aws11) DBG |         \"1\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"MinCount\": [\r\n    (aws11) DBG |         \"1\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"Monitoring.Enabled\": [\r\n    (aws11) DBG |         \"0\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"NetworkInterface.0.AssociatePublicIpAddress\": [\r\n    (aws11) DBG |         \"1\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"NetworkInterface.0.DeviceIndex\": [\r\n    (aws11) DBG |         \"0\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"NetworkInterface.0.SecurityGroupId.0\": [\r\n    (aws11) DBG |         \"sg-118a1a76\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"NetworkInterface.0.SubnetId\": [\r\n    (aws11) DBG |         \"subnet-cd5f99a9\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"Placement.AvailabilityZone\": [\r\n    (aws11) DBG |         \"us-west-2b\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"Version\": [\r\n    (aws11) DBG |         \"2014-06-15\"\r\n    (aws11) DBG |     ]\r\n    (aws11) DBG | }\r\n    (aws11) DBG | waiting for ip address to become available\r\n    (aws11) DBG | Making AWS API call with values:\r\n    (aws11) DBG | {\r\n    (aws11) DBG |     \"Action\": [\r\n    (aws11) DBG |         \"DescribeInstances\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"InstanceId.1\": [\r\n    (aws11) DBG |         \"i-0b1f1d63c52e5b67d\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"Version\": [\r\n    (aws11) DBG |         \"2014-06-15\"\r\n    (aws11) DBG |     ]\r\n    (aws11) DBG | }\r\n    (aws11) DBG | Got the IP Address, it's \"52.26.63.205\"\r\n    (aws11) DBG | Making AWS API call with values:\r\n    (aws11) DBG | {\r\n    (aws11) DBG |     \"Action\": [\r\n    (aws11) DBG |         \"DescribeInstances\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"InstanceId.1\": [\r\n    (aws11) DBG |         \"i-0b1f1d63c52e5b67d\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"Version\": [\r\n    (aws11) DBG |         \"2014-06-15\"\r\n    (aws11) DBG |     ]\r\n    (aws11) DBG | }\r\n    (aws11) DBG | created instance ID i-0b1f1d63c52e5b67d, IP address 52.26.63.205, Private IP address 192.168.110.162\r\n    (aws11) DBG | Settings tags for instance\r\n    (aws11) DBG | Making AWS API call with values:\r\n    (aws11) DBG | {\r\n    (aws11) DBG |     \"Action\": [\r\n    (aws11) DBG |         \"CreateTags\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"ResourceId.1\": [\r\n    (aws11) DBG |         \"i-0b1f1d63c52e5b67d\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"Tag.1.Key\": [\r\n    (aws11) DBG |         \"Name\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"Tag.1.Value\": [\r\n    (aws11) DBG |         \"aws11\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"Version\": [\r\n    (aws11) DBG |         \"2014-06-15\"\r\n    (aws11) DBG |     ]\r\n    (aws11) DBG | }\r\n    (aws11) Calling .GetConfigRaw\r\n    (aws11) Calling .DriverName\r\n    Waiting for machine to be running, this may take a few minutes...\r\n    (aws11) Calling .GetState\r\n    (aws11) DBG | Making AWS API call with values:\r\n    (aws11) DBG | {\r\n    (aws11) DBG |     \"Action\": [\r\n    (aws11) DBG |         \"DescribeInstances\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"InstanceId.1\": [\r\n    (aws11) DBG |         \"i-0b1f1d63c52e5b67d\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"Version\": [\r\n    (aws11) DBG |         \"2014-06-15\"\r\n    (aws11) DBG |     ]\r\n    (aws11) DBG | }\r\n    Machine is running, waiting for SSH to be available...\r\n    Getting to WaitForSSH function...\r\n    (aws11) Calling .GetSSHHostname\r\n    (aws11) DBG | Making AWS API call with values:\r\n    (aws11) DBG | {\r\n    (aws11) DBG |     \"Action\": [\r\n    (aws11) DBG |         \"DescribeInstances\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"InstanceId.1\": [\r\n    (aws11) DBG |         \"i-0b1f1d63c52e5b67d\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"Version\": [\r\n    (aws11) DBG |         \"2014-06-15\"\r\n    (aws11) DBG |     ]\r\n    (aws11) DBG | }\r\n    (aws11) Calling .GetSSHPort\r\n    (aws11) Calling .GetSSHKeyPath\r\n    (aws11) Calling .GetSSHUsername\r\n    Using SSH client type: external\r\n    About to run SSH command:\r\n    exit 0\r\n    SSH cmd err, output: exit status 255:\r\n    Error getting ssh command 'exit 0' : Something went wrong running an SSH command!\r\n    command : exit 0\r\n    err     : exit status 255\r\n    output  :\r\n\r\n    Getting to WaitForSSH function...\r\n    (aws11) Calling .GetSSHHostname\r\n    (aws11) DBG | Making AWS API call with values:\r\n    (aws11) DBG | {\r\n    (aws11) DBG |     \"Action\": [\r\n    (aws11) DBG |         \"DescribeInstances\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"InstanceId.1\": [\r\n    (aws11) DBG |         \"i-0b1f1d63c52e5b67d\"\r\n    (aws11) DBG |     ],\r\n    (aws11) DBG |     \"Version\": [\r\n    (aws11) DBG |         \"2014-06-15\"\r\n    (aws11) DBG |     ]\r\n    (aws11) DBG | }\r\n    (aws11) Calling .GetSSHPort\r\n    (aws11) Calling .GetSSHKeyPath\r\n    (aws11) Calling .GetSSHUsername\r\n    Using SSH client type: external\r\n    About to run SSH command:\r\n    exit 0\r\n\r\nIt repeats the last part infinitely. The instance is up and running but I cannot connect to it properly from docker-machine. I created another instance also in us-west-2b before, but in another vpc. The vpc I am trying to create in now is a custom vpc, while before it was an existing one. Maybe that has some influence? I also had troubles because there was a security group for the other vpc named docker-machine. And the driver falsely assumed it could use this group. The API said no, because the security group belonged to another vpc. Trying to create a security group by specifying it on the command line did not work properly. It always wanted to create one, even if I tried giving it groups that already existed. I resolved this by creating a security group in the correct vpc also named docker-machine.\r\nStill I cannot connect to the instance, although the creation seems to work fine otherwise.\r\n\r\nI would be thankful for any advice on how to resolve this. "}}