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

[azurerm] SIGSEGV on elasticpool import #5003

Closed
Dehalion opened this issue Nov 27, 2019 · 6 comments · Fixed by #5017
Closed

[azurerm] SIGSEGV on elasticpool import #5003

Dehalion opened this issue Nov 27, 2019 · 6 comments · Fixed by #5017
Assignees
Labels
bug crash service/mssql Microsoft SQL Server
Milestone

Comments

@Dehalion
Copy link

Dehalion commented Nov 27, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Terraform v0.12.16
+ provider.azurerm v1.37.0

Affected Resource(s)

  • azurerm_mssql_elasticpool

Terraform Configuration Files

# main.tf
provider "azurerm" {
    version         = "=1.37.0"
    tenant_id       = local.tenant_id
    subscription_id = local.dbs_subscription_id
}
module "sqlserverpool" {
    source = "./modules/dbs-elastic-pool"

    tenant_id       = local.tenant_id
    location        = local.location
    ressourcegroup  = module.sqlserver.resource_group_name
    servername      = module.sqlserver.dbs_name
    name            = "sqlserver"
    custom_tags     = merge(local.default_tags, {"environment": "qa"})
}
# modules/dbs-elastic-pool/main.tf
resource "azurerm_mssql_elasticpool" "ep" {
    location            = var.location
    resource_group_name = var.ressourcegroup
    server_name         = var.servername

    name                = "${local.project_name}-dbep"
    max_size_gb         = var.dbs_ep_max_size_gb

    sku {
        name     = var.dbs_ep_sku_name
        tier     = var.dbs_ep_tier
        capacity = var.dbs_ep_capacity
    }

    per_database_settings {
        min_capacity = 0
        max_capacity = local.max_capacity
    }
}

Debug Output

https://gist.github.com/Dehalion/744310ed8512e6607bd8bf5c2a780d46

Panic Output

https://gist.github.com/Dehalion/744310ed8512e6607bd8bf5c2a780d46

Expected Behavior

The elastic pool resource should be imported into the state.

Actual Behavior

Crash

Steps to Reproduce

  1. terraform import module.sqlserverpool.azurerm_mssql_elasticpool.ep /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sqlserver/providers/Microsoft.Sql/servers/sqlserver-dbs/elasticpools/sqlserver-dbep

Important Factoids

  • Running azure in West Europe
  • Similar/same crash happened with a colleague using PowerShell and azurerm=1.35.0

References

@tombuildsstuff
Copy link
Contributor

hey @Dehalion

Thanks for opening this issue.

I've opened #5017 which fixes the crash here - but this is ultimately caused by the Resource ID using the incorrect case here - in particular with the segment elasticpools which should be elasticPools. Due to the way the Azure API behaves we're forced to treat Resource ID's as case sensitive - and whilst this isn't the best UX here - in the future we're planning to add some validation to better explain this during both Import and referencing ID's between resources.

Would you be able to take a look and see if updating the casing for elasticpools to elasticPools works for you?

Thanks!

@tombuildsstuff tombuildsstuff added this to the v1.38.0 milestone Nov 28, 2019
@tombuildsstuff tombuildsstuff self-assigned this Nov 28, 2019
@tombuildsstuff
Copy link
Contributor

hey @Dehalion

Thanks for opening this issue.

I've opened #5017 which fixes the crash here - but this is ultimately caused by the Resource ID using the incorrect case here - in particular with the segment elasticpools which should be elasticPools. Due to the way the Azure API behaves we're forced to treat Resource ID's as case sensitive - and whilst this isn't the best UX here - in the future we're planning to add some validation to better explain this during both Import and referencing ID's between resources.

Would you be able to take a look and see if updating the casing for elasticpools to elasticPools works for you?

Thanks!

@Dehalion
Copy link
Author

👍 Yes, that works!
Thank you very much.

@ghost
Copy link

ghost commented Dec 7, 2019

This has been released in version 1.38.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 1.38.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Dec 29, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Dec 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug crash service/mssql Microsoft SQL Server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants