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

Storage Gateway Upload Buffer creates resource but "Provider produced inconsistent apply" #12847

Closed
bpsi3m3ns opened this issue Apr 16, 2020 · 5 comments · Fixed by #18313
Closed
Assignees
Labels
bug Addresses a defect in current functionality. service/storagegateway Issues and PRs that pertain to the storagegateway service.
Milestone

Comments

@bpsi3m3ns
Copy link

bpsi3m3ns commented Apr 16, 2020

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 other comments that do not add relevant new information or questions, 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 Version

Terraform v0.12.24

  • provider.aws v2.54.0
  • provider.external v1.2.0
  • provider.local v1.4.0
  • provider.random v2.2.1
  • provider.template v2.1.2

Affected Resource(s)

  • aws_aws_storagegateway_upload_buffer

Terraform Configuration Files

resource "aws_storagegateway_gateway" "master_gateway" {
  depends_on = [aws_instance.master-gateway-instance]
  gateway_name = "${var.name_prefix}-gate1-${var.name_suffix}"
  gateway_timezone = "GMT-7:00"
  gateway_type     = "CACHED"
  activation_key   = "${data.external.master_activation_key.result["key"]}"
  tags = var.tags

  # The activation keys change periodically, but once the gateway is created they don't matter. Ignore them
  lifecycle {
    ignore_changes = [
      activation_key,
    ]
  }
}
data "aws_storagegateway_local_disk" "master-buffer" {
  disk_node = aws_volume_attachment.master-buffer-mount.device_name
  gateway_arn = aws_storagegateway_gateway.master_gateway.arn
}

resource "aws_storagegateway_upload_buffer" "master-buffer" {
  disk_id = data.aws_storagegateway_local_disk.master-buffer.id
  gateway_arn = aws_storagegateway_gateway.master_gateway.arn
}

resource "aws_volume_attachment" "master-buffer-mount" {
  device_name = "/dev/xvdc"
  volume_id = "${aws_ebs_volume.master-buffer.id}"
  instance_id = "${aws_instance.master-gateway-instance.id}"

Debug Output

Error: Provider produced inconsistent result after apply

When applying changes to
module.test_cluster.aws_storagegateway_upload_buffer.master-buffer, provider
"registry.terraform.io/-/aws" produced an unexpected new value for was
present, but now absent.

This is a bug in the provider, which should be reported in the provider's own
issue tracker.

Panic Output

Expected Behavior

Apply succeeded

Actual Behavior

Master buffer was successfully created, but terraform displayed the above error. The subsequent apply yielded another error, as the disk had indeed been successfully allocated:

Error: error adding Storage Gateway upload buffer: InvalidGatewayRequestException: The specified disk is already allocated.
{
Error_: {
ErrorCode: "DiskAlreadyAllocated"
},
Message_: "The specified disk is already allocated."
}

on ../modules/storage-gateway/main.tf line 72, in resource "aws_storagegateway_upload_buffer" "master-buffer":
72: resource "aws_storagegateway_upload_buffer" "master-buffer" {

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@ghost ghost added the service/storagegateway Issues and PRs that pertain to the storagegateway service. label Apr 16, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Apr 16, 2020
@ewbankkit
Copy link
Contributor

This looks like an "eventual-consistency" issue. The resource is created successfully but when Terraform turns around and reads the resource, the service API cannot yet find the resource.

@bflad bflad added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Aug 21, 2020
@DrFaust92
Copy link
Collaborator

I ran tests several times to try and recreate this and was not able to. i can add add a retry to read the resource right after creating before the resource Read function. its going to be a "dumb" check as there is not status attribute or anything else similar let users know the status of the resource

@bflad
Copy link
Contributor

bflad commented Mar 24, 2021

The error messaging was fixed in version 3.32.0, support for cached gateways in the resource (via a new disk_path argument) is pending here: #18313

@github-actions github-actions bot added this to the v3.34.0 milestone Mar 26, 2021
@ghost
Copy link

ghost commented Mar 26, 2021

This has been released in version 3.34.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Apr 25, 2021

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. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Apr 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/storagegateway Issues and PRs that pertain to the storagegateway service.
Projects
None yet
4 participants