alibaba / packer-provider

Apache License 2.0
92 stars 26 forks source link

net/http: TLS handshake timeout #58

Closed elanuser closed 5 years ago

elanuser commented 5 years ago

hello Dev,

I faced frequent issue when I use ali-packer. I don't know why?

alicloud-ecs: Timeout waiting for instance to start: Aliyun API Error: RequestId: Status Code: -1 Code: AliyunGoClientFailure Message: Get https://ecs-cn-hangzhou.aliyuncs.com?xx: net/http: TLS handshake timeout

following is the code: { "variables": { "access_key": "{{env ALICLOUD_ACCESS_KEY}}", "secret_key": "{{env ALICLOUD_SECRET_KEY}}" }, "builders": [{ "type":"alicloud-ecs", "access_key":"{{user access_key}}", "secret_key":"{{user secret_key}}", "region":"cn-beijing", "image_name":"packer_test2", "source_image":"centos_7_03_64_20G_alibase_20170818.vhd", "ssh_username":"root", "instance_type":"ecs.n1.tiny", "io_optimized":"true", "internet_charge_type":"PayByTraffic", "image_force_delete":"true" }], "provisioners": [{ "type": "shell", "inline": [ "sleep 30", "yum install redis.x86_64 -y" ] }] }

chhaj5236 commented 5 years ago

Hi @elanuser , did you run Packer command out of China? This may happen due to the network issue. You could try export ECS_ENDPOINT env to the corresponding endpoint described in our official website. https://www.alibabacloud.com/help/doc-detail/25489.htm. Please let us know if it works, thanks for your contributions : )

chhaj5236 commented 5 years ago

We have updated the official doc for making this clear. See https://github.com/hashicorp/packer/pull/7329 for details.