Skip to content
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

[BUG] When creating a resource with Terraform that has already been created somewhere else it hangs... #234

Closed
fernando-villalba opened this issue Jun 20, 2024 · 1 comment · Fixed by #243
Assignees
Labels
bug Something isn't working

Comments

@fernando-villalba
Copy link
Contributor

Description

If you create a resource in the Civo platform via the CLI for example, and then you try to create a resource with the same name in Terraform, the expected behaviour should be that it fails immediately with an error message saying something like:

"Resource X already exists, please go to dashboard https://dashboard.civo.com/ and check or pick a different name for resource"

Instead terraform just hangs until timeout is reached in 2 minutes, wasting a lot of the user's time.

Do this first:

civo network create test-crazy 

And then apply this:

resource "civo_network" "test-issue" {
    label = "test-crazy"
}

Result:

civo_network.test-issue: Creating...
civo_instance.foo: Creating...
civo_network.test-issue: Creation complete after 0s [id=14ba5453-c246-4446-b93e-5c3c90af387e]
civo_instance.foo: Still creating... [10s elapsed]
civo_instance.foo: Still creating... [20s elapsed]
civo_instance.foo: Still creating... [30s elapsed]
civo_instance.foo: Still creating... [40s elapsed]
civo_instance.foo: Still creating... [50s elapsed]
civo_instance.foo: Still creating... [1m0s elapsed]
civo_instance.foo: Still creating... [1m10s elapsed]
civo_instance.foo: Still creating... [1m20s elapsed]
civo_instance.foo: Still creating... [1m30s elapsed]
civo_instance.foo: Still creating... [1m40s elapsed]
civo_instance.foo: Still creating... [1m50s elapsed]
civo_instance.foo: Still creating... [2m0s elapsed]
╷
│ Error: [ERR] failed to create instance after multiple attempts: timeout reached
│ 
│   with civo_instance.foo,
│   on vm_instance.tf line 111, in resource "civo_instance" "foo":
│  111: resource "civo_instance" "foo" {

Acceptance Criteria

  • Fix this for instances and network. Instead of timing out, fail quickly with an error message similar to "Resource X already exists, please go to dashboard https://dashboard.civo.com/ and check or pick a different name for resource"
  • Check other resources and see if the same happens and fix that too

Screenshots

No response

Additional information

No response

@fernando-villalba fernando-villalba added the bug Something isn't working label Jun 20, 2024
@uzaxirr uzaxirr self-assigned this Jun 23, 2024
@Praveen005
Copy link
Contributor

Praveen005 commented Jun 23, 2024

Hi @uzaxirr,

I hope you're doing well.

I am willing to work on this issue. Could you please assign it to me if that's okay?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants