hashicorp / packer-plugin-tencentcloud

Packer plugin for Tencent Cloud Image Builder
https://www.packer.io/docs/builders/tencentcloud-cvm
Mozilla Public License 2.0
8 stars 12 forks source link

tencentcloud-cvm Failed to wait for instance ready: instance(ins-xxxx) not exist #6

Closed ghost closed 7 months ago

ghost commented 3 years ago

This issue was originally opened by @virain as hashicorp/packer#10396. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


Overview of the Issue

I used the packer to package the image. An ansible syntax error occurred. The packer stopped running and deleted the instance. After running the packer again, the prompt failed to wait for instance ready: instance (INS XXX) not exist

packer 1.6.5

error logs

==> tencentcloud-cvm.tencentcloud: Trying to use existing securitygroup: sg-ni4d1vkh...
    tencentcloud-cvm.tencentcloud: Securitygroup found: default
2020/12/16 17:39:08 packer-builder-tencentcloud-cvm plugin: 2020/12/16 17:39:08 step_run_instance.go:198: [DEBUG]getUserData: user_data:
==> tencentcloud-cvm.tencentcloud: Trying to create a new instance...
    tencentcloud-cvm.tencentcloud: Waiting for instance ready
==> tencentcloud-cvm.tencentcloud: Failed to wait for instance ready: instance(ins-jnoiqr60) not exist
==> tencentcloud-cvm.tencentcloud: Deleting instance because of error...
==> tencentcloud-cvm.tencentcloud: Failed to terminate instance(ins-jnoiqr60), please delete it manually: [TencentCloudSDKError] Code=InvalidInstanceId.NotFound, Message=The specified instance ID `['ins-jnoiqr60']` is not found., RequestId=ccb15216-aac2-4344-ae56-d8579418acfe
==> tencentcloud-cvm.tencentcloud: Deleting keypair because of error...
2020/12/16 17:39:09 [INFO] (telemetry) ending 
==> Wait completed after 3 seconds 64 milliseconds
Build 'tencentcloud-cvm.tencentcloud' errored after 3 seconds 64 milliseconds: instance(ins-jnoiqr60) not exist
likexian commented 3 years ago

Hello @virain Sorry for the long long delay due to no notifications. Is this happen now?

virain commented 3 years ago

Hello @likexian I'm not sure. It took too long. I forgot the problem

likexian commented 3 years ago

Hello @virain I am sorry about that, I have try create a image and confirm it works. If you still have any problems, please post it here.

virain commented 2 years ago

@likexian Now the same problem occurs again. This time, after packaging multiple images successfully, the error invalidinstanceid.notfound occurs again. It seems that CVM was not created successfully, packer could not get the instance, and I could not see the creation of CVM from Tencent cloud console.Does the API have restrictions on creating CVMs, which makes it impossible to create CVMs after creating a certain number of CVMs?

==> tencentcloud-cvm.tencentcloud: Trying to create a new instance...
==> tencentcloud-cvm.tencentcloud: Trying to create a new instance...
    tencentcloud-cvm.tencentcloud: Subnet found: default
==> tencentcloud-cvm.tencentcloud: Trying to use existing securitygroup: sg-ni4d1vkh...
    tencentcloud-cvm.tencentcloud: Subnet found: default
==> tencentcloud-cvm.tencentcloud: Trying to use existing securitygroup: sg-ni4d1vkh...
    tencentcloud-cvm.tencentcloud: Waiting for instance ready
    tencentcloud-cvm.tencentcloud: Waiting for instance ready
    tencentcloud-cvm.tencentcloud: Securitygroup found: default
2021/11/13 14:32:35 packer-builder-tencentcloud-cvm plugin: 2021/11/13 14:32:35 step_run_instance.go:198: [DEBUG]getUserData: user_data:
==> tencentcloud-cvm.tencentcloud: Trying to create a new instance...
    tencentcloud-cvm.tencentcloud: Securitygroup found: default
2021/11/13 14:32:36 packer-builder-tencentcloud-cvm plugin: 2021/11/13 14:32:36 step_run_instance.go:198: [DEBUG]getUserData: user_data:
==> tencentcloud-cvm.tencentcloud: Trying to create a new instance...
    tencentcloud-cvm.tencentcloud: Waiting for instance ready
    tencentcloud-cvm.tencentcloud: Waiting for instance ready
==> tencentcloud-cvm.tencentcloud: Failed to wait for instance ready: instance(ins-lf982wdg) not exist
==> tencentcloud-cvm.tencentcloud: Deleting instance because of error...
==> tencentcloud-cvm.tencentcloud: Failed to wait for instance ready: instance(ins-qfv552ci) not exist
==> tencentcloud-cvm.tencentcloud: Deleting instance because of error...
==> tencentcloud-cvm.tencentcloud: Failed to wait for instance ready: instance(ins-dxj5drnm) not exist
==> tencentcloud-cvm.tencentcloud: Deleting instance because of error...
==> tencentcloud-cvm.tencentcloud: Failed to terminate instance(ins-lf982wdg), please delete it manually: [TencentCloudSDKError] Code=InvalidInstanceId.NotFound, Message=The specified instance ID `['ins-lf982wdg']` is not found., RequestId=a8ff558e-7a6f-47ad-818e-f95a43f0fc08
2021/11/13 14:32:36 [INFO] (telemetry) ending tencentcloud-cvm.tencentcloud
Build 'tencentcloud-cvm.tencentcloud' errored after 2 seconds 462 milliseconds: instance(ins-lf982wdg) not exist
2021/11/13 14:32:36 [INFO] (telemetry) ending tencentcloud-cvm.tencentcloud
==> tencentcloud-cvm.tencentcloud: Failed to terminate instance(ins-qfv552ci), please delete it manually: [TencentCloudSDKError] Code=InvalidInstanceId.NotFound, Message=The specified instance ID `['ins-qfv552ci']` is not found., RequestId=f0abe63c-1399-4ad9-bfd4-6b025769923e
Build 'tencentcloud-cvm.tencentcloud' errored after 2 seconds 477 milliseconds: instance(ins-qfv552ci) not exist
==> tencentcloud-cvm.tencentcloud: Failed to wait for instance ready: instance(ins-m5qgd6km) not exist
==> tencentcloud-cvm.tencentcloud: Deleting instance because of error...
2021/11/13 14:32:36 [INFO] (telemetry) ending tencentcloud-cvm.tencentcloud
==> tencentcloud-cvm.tencentcloud: Failed to terminate instance(ins-dxj5drnm), please delete it manually: [TencentCloudSDKError] Code=InvalidInstanceId.NotFound, Message=The specified instance ID `['ins-dxj5drnm']` is not found., RequestId=e2be99c0-2f7a-4beb-819b-458687f00c5d
Build 'tencentcloud-cvm.tencentcloud' errored after 2 seconds 650 milliseconds: instance(ins-dxj5drnm) not exist
==> tencentcloud-cvm.tencentcloud: Failed to terminate instance(ins-m5qgd6km), please delete it manually: [TencentCloudSDKError] Code=InvalidInstanceId.NotFound, Message=The specified instance ID `['ins-m5qgd6km']` is not found., RequestId=2dcd4b8f-a9d4-4d27-9829-dc3c5bc2575a
2021/11/13 14:32:36 [INFO] (telemetry) ending tencentcloud-cvm.tencentcloud
==> Wait completed after 2 seconds 749 milliseconds
2021/11/13 14:32:36 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2021/11/13 14:32:36 machine readable: tencentcloud-cvm.tencentcloud,error []string{"instance(ins-m5qgd6km) not exist"}
==> Builds finished but no artifacts were created.
2021/11/13 14:32:36 [INFO] (telemetry) Finalizing.
Build 'tencentcloud-cvm.tencentcloud' errored after 2 seconds 749 milliseconds: instance(ins-m5qgd6km) not exist

==> Wait completed after 2 seconds 749 milliseconds

==> Some builds didn't complete successfully and had errors:
--> tencentcloud-cvm.tencentcloud: instance(ins-m5qgd6km) not exist

==> Builds finished but no artifacts were created.
2021/11/13 14:32:38 waiting for all plugin processes to complete...
2021/11/13 14:32:38 /usr/bin/packer: plugin process exited
2021/11/13 14:32:38 /usr/bin/packer: plugin process exited
2021/11/13 14:32:38 /usr/bin/packer: plugin process exited
2021/11/13 14:32:38 /usr/bin/packer: plugin process exited
nicholasleeeee commented 2 years ago

@virain not sure if it’s the same issue that I face. Try changing the instance name?

virain commented 2 years ago

@virain not sure if it’s the same issue that I face. Try changing the instance name?

Yep,Change the instance name to create

likexian commented 2 years ago

Yes, try change the instance name, when there are multiple buildings, uses difference instance name.

nywilken commented 1 year ago

@likexian it seems like this issue is safe to close. Please advise if there is any work to do here.

likexian commented 1 year ago

Hello @nywilken please close.

nywilken commented 7 months ago

Thank you for supporting this issue @likexian closing at your request.

Jalle19 commented 3 days ago

This is still happening. Started happening randomly while I was building various images:

sc-rocky-bastion.tencentcloud-cvm.ruby2: output will be in this color.

==> sc-rocky-bastion.tencentcloud-cvm.ruby2: Trying to check image name: sc-rocky-bastion-ruby2-x86-20241022-0827z...
    sc-rocky-bastion.tencentcloud-cvm.ruby2: Image name: useable
==> sc-rocky-bastion.tencentcloud-cvm.ruby2: Trying to check source image: img-apkyigzj...
    sc-rocky-bastion.tencentcloud-cvm.ruby2: Image found: sc-rocky-baseimage-x86-20241021-1241z
==> sc-rocky-bastion.tencentcloud-cvm.ruby2: Trying to create a new keypair: packer_6717620e...
    sc-rocky-bastion.tencentcloud-cvm.ruby2: Keypair created: skey-o68dkh87
==> sc-rocky-bastion.tencentcloud-cvm.ruby2: Trying to use existing vpc: vpc-b9xrn2ch...
    sc-rocky-bastion.tencentcloud-cvm.ruby2: Vpc found: builder-vpc
==> sc-rocky-bastion.tencentcloud-cvm.ruby2: Trying to use existing subnet: subnet-6jw5qh26...
    sc-rocky-bastion.tencentcloud-cvm.ruby2: Subnet found: builder-subnet1
==> sc-rocky-bastion.tencentcloud-cvm.ruby2: Trying to use existing securitygroup: sg-kmlp8ub7...
    sc-rocky-bastion.tencentcloud-cvm.ruby2: Securitygroup found: builder-security-group
==> sc-rocky-bastion.tencentcloud-cvm.ruby2: Trying to create a new instance...
    sc-rocky-bastion.tencentcloud-cvm.ruby2: Waiting for instance ready
==> sc-rocky-bastion.tencentcloud-cvm.ruby2: Failed to wait for instance ready: instance(ins-rrqcb8l7) not exist
==> sc-rocky-bastion.tencentcloud-cvm.ruby2: Deleting instance because of error...
==> sc-rocky-bastion.tencentcloud-cvm.ruby2: Failed to terminate instance(ins-rrqcb8l7), please delete it manually: [TencentCloudSDKError] Code=InvalidInstanceId.NotFound, Message=The specified instance ID `['ins-rrqcb8l7']` is not found., RequestId=171f0707-6c9d-40a7-b0b8-88a50646e1d9
==> sc-rocky-bastion.tencentcloud-cvm.ruby2: Deleting keypair because of error...
Build 'sc-rocky-bastion.tencentcloud-cvm.ruby2' errored after 9 seconds 878 milliseconds: instance(ins-rrqcb8l7) not exist

==> Wait completed after 9 seconds 878 milliseconds

==> Some builds didn't complete successfully and had errors:
--> sc-rocky-bastion.tencentcloud-cvm.ruby2: instance(ins-rrqcb8l7) not exist

==> Builds finished but no artifacts were created

No instances is actually created.