Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Apr 22, 2021 · 11 comments · Fixed by tencentcloudstack/packer-plugin-tencentcloud#13 · May be fixed by #131

Comments

@ghost
Copy link

ghost commented Apr 22, 2021

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
Copy link
Contributor

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

@Vraint
Copy link

Vraint commented Aug 23, 2021

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

@likexian
Copy link
Contributor

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.

@Vraint
Copy link

Vraint commented Nov 13, 2021

@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
Copy link

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

@Vraint
Copy link

Vraint commented Nov 13, 2021

@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
Copy link
Contributor

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

@nywilken
Copy link
Contributor

nywilken commented Mar 8, 2023

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

@likexian
Copy link
Contributor

likexian commented Mar 9, 2023

Hello @nywilken please close.

@nywilken
Copy link
Contributor

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

@Jalle19
Copy link

Jalle19 commented Oct 22, 2024

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.

Jalle19 pushed a commit to Jalle19/packer-plugin-tencentcloud that referenced this issue Oct 22, 2024
The purpose of ClientToken is to ensure request idempotency in case the request needs to be retried. This means the value must be unique for all unique RunInstances API calls.

When building a template that references the same source multiple times (or multiple different sources), many calls to RunInstances are made. However, the same auto-generated instance name was used as "ClientToken".

This changes ClientToken to be unique regardless of whether the user has supplied a unique "instance_name" for each source/build.

Fixes hashicorp#6
Jalle19 added a commit to Jalle19/packer-plugin-tencentcloud that referenced this issue Oct 22, 2024
The purpose of ClientToken is to ensure request idempotency in case the request needs to be retried. This means the value must be unique for all unique RunInstances API calls.

When building a template that references the same source multiple times (or multiple different sources), many calls to RunInstances are made. However, the same auto-generated instance name was used as "ClientToken".

This changes ClientToken to be unique regardless of whether the user has supplied a unique "instance_name" for each source/build.

Fixes hashicorp#6
Jalle19 added a commit to Jalle19/packer-plugin-tencentcloud that referenced this issue Oct 22, 2024
The purpose of ClientToken is to ensure request idempotency in case the request needs to be retried. This means the value must be unique for all unique RunInstances API calls.

When building a template that references the same source multiple times (or multiple different sources), many calls to RunInstances are made. However, the same auto-generated instance name was used as "ClientToken".

This changes ClientToken to be unique regardless of whether the user has supplied a unique "instance_name" for each source/build.

Fixes hashicorp#6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants