alibaba / packer-provider

Apache License 2.0
93 stars 26 forks source link

Error attaching keypair #26

Closed cosmos-sun closed 7 years ago

cosmos-sun commented 7 years ago

alicloud-ecs: Error attaching keypair packer_5965d231-20d8-2d88-04d7-05559a18878d to instance i-2zei5wmjez4q2za8pl49 : Aliyun API Error: RequestId: 699E67CC-EEB8-4DF7-B019-F921F8AA1464 Status Code: 503 Code: ServiceUnavailable Message: The request has failed due to a temporary failure of the server.

I am using 'centos_7_03_64_40G_alibase_20170625.vhd' as the source image of Packer

zhuzhih2017 commented 7 years ago

This is a temporary system issue, we are seeking the root cause, before we find it. Could you try again and check whether it can work and just happen occasionally? Thanks.

cosmos-sun commented 7 years ago

I don't think it's a temporary issue, I used this tool to build Aliyun image successfully couple weeks ago(The source image was ubuntu one), but this week I can't use it to build any images.

I just guess if Aliyun API or 'aliyungo' was changed...

More information:

➜  packer-provider git:(master) ✗ packer build -var-file=key_own.json build_test.json
alicloud-ecs output will be in this color.

==> alicloud-ecs: Force delete flag found, skipping prevalidating alicloud image name
    alicloud-ecs: Found image ID: ubuntu_16_0402_64_40G_alibase_20170625.vhd
==> alicloud-ecs: Start create temporary keypair: packer_5965d9b3-9105-67a0-6593-186c00607567
==> alicloud-ecs: Start create alicloud vpc
==> alicloud-ecs: Start creating vswitch...
==> alicloud-ecs: Start creating security groups...
==> alicloud-ecs: Start creating alicloud instance
==> alicloud-ecs: Start allocated alicloud eip
==> alicloud-ecs: Allocated alicloud eip 123.56.216.165
==> alicloud-ecs: Alcoud instance starting
==> alicloud-ecs: Error attaching keypair packer_5965d9b3-9105-67a0-6593-186c00607567 to instance i-2ze7ym5r82qourl9t3v1 : Aliyun API Error: RequestId: 15C26F88-A699-469C-A570-9169CA3E5528 Status Code: 503 Code: ServiceUnavailable Message: The request has failed due to a temporary failure of the server.
    alicloud-ecs: Detach keypair packer_5965d9b3-9105-67a0-6593-186c00607567 from instance: i-2ze7ym5r82qourl9t3v1
==> alicloud-ecs: Stop alicloud instance i-2ze7ym5r82qourl9t3v1 failed <nil>
==> alicloud-ecs: Delete the EIP because cancelation or error...
==> alicloud-ecs: Delete the instance because cancelation or error...
==> alicloud-ecs: Delete the security group because cancelation or error...
==> alicloud-ecs: Delete the vSwitch because cancelation or error...
==> alicloud-ecs: Delete the VPC because cancelation or error...
==> alicloud-ecs: Deleting temporary keypair...
Build 'alicloud-ecs' errored: Error attaching keypair packer_5965d9b3-9105-67a0-6593-186c00607567 to instance i-2ze7ym5r82qourl9t3v1 : Aliyun API Error: RequestId: 15C26F88-A699-469C-A570-9169CA3E5528 Status Code: 503 Code: ServiceUnavailable Message: The request has failed due to a temporary failure of the server.

==> Some builds didn't complete successfully and had errors:
--> alicloud-ecs: Error attaching keypair packer_5965d9b3-9105-67a0-6593-186c00607567 to instance i-2ze7ym5r82qourl9t3v1 : Aliyun API Error: RequestId: 15C26F88-A699-469C-A570-9169CA3E5528 Status Code: 503 Code: ServiceUnavailable Message: The request has failed due to a temporary failure of the server.

==> Builds finished but no artifacts were created.

My packer version is 1.0.2 and using the latest paceker-provider

zhuzhih2017 commented 7 years ago

We are found something from the log, but we need the vm instance to find the root cause. I can't recreate it today with my script, I'm not sure whether you can give me a simple build script which can recreate your problem. my mail is dongxiao.zzh@alibaba-inc.com. Thx.

zhuzhih2017 commented 7 years ago

I have add logic to dispose this case. you can download the latest version packer alicloud plugin in the release.