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

Upgraded to 0.10.0, plan fails previously created config/statefile. #1365

Closed
hashibot opened this issue Aug 7, 2017 · 7 comments
Closed
Labels
crash Results from or addresses a Terraform crash or kernel panic.

Comments

@hashibot
Copy link

hashibot commented Aug 7, 2017

This issue was originally opened by @jgrossmac as hashicorp/terraform#15754. It was migrated here as a result of the provider split. The original body of the issue is below.


Upgraded to terraform 0.10.0, ran a terraform init, then a plan and got a whole bunch of errors back on a previously known good configuration.

Terraform Version

Terraform v0.10.0

Terraform Configuration Files

resource "aws_s3_bucket" "unprocessed" {
  bucket = "${var.random}-unprocessed"
  acl    = "private"

   lifecycle_rule {
    prefix  = "/"
    enabled = true

    expiration {
      days = 180
    }
  }

  policy = <<EOF
{
    "Version": "2008-10-17",
    "Statement": [
        {
            "Sid": "Stmt1429136633762",
            "Effect": "Allow",
            "Principal": {
                 "AWS": "*"
            },
            "Action": "s3:PutObject",
            "Resource": [
              "arn:aws:s3:::${var.random}-unprocessed",
              "arn:aws:s3:::${var.random}-unprocessed/*"
            ]
        }
    ]
}
EOF

  tags {
    Name            = "${var.random}"
    BusinessUnit    = "${var.b_tag}"
    Environment     = "${var.branch}"
    Service         = "${var.s_tag}"
    ManagedBy       = "${var.m_tag}"
  }
}

resource "aws_s3_bucket" "processed" {
  bucket = "${var.random}-processed"
  acl    = "private"

   lifecycle_rule {
    prefix  = "/"
    enabled = true

    transition {
      days          = 1
      storage_class = "GLACIER"
    }
  }

  policy = <<EOF
{
    "Version": "2008-10-17",
    "Statement": [
        {
            "Sid": "Stmt1429136633762",
            "Effect": "Allow",
            "Principal": {
                 "AWS": "*"
            },
            "Action": "s3:PutObject",
            "Resource": [
              "arn:aws:s3:::${var.random}-processed",
              "arn:aws:s3:::${var.random}-processed/*"
            ]
        }
    ]
}
EOF

  tags {
    Name            = "${var.random}"
    BusinessUnit    = "${var.b_tag}"
    Environment     = "${var.branch}"
    Service         = "${var.s_tag}"
    ManagedBy       = "${var.m_tag}"
  }
}

Panic Output

https://gist.github.com/jgrossmac/c52fee4dd53a95dbbaf5881f16704097

Expected Behavior

Should have a detailed build plan based on an existing statefile.

Actual Behavior

Lots of "unexpected EOF" and "connection is shut down" errors.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform init in the root directory of my configs.
terraform init -upgrade=true
Upgrading modules...
Get: file:///Users/jgross/GitHub/bb-coo-reports-devops/stack/network (update)
Get: file:///Users/jgross/GitHub/bb-coo-reports-devops/stack/security (update)
Get: file:///Users/jgross/GitHub/bb-coo-reports-devops/stack/data (update)
Get: file:///Users/jgross/GitHub/bb-coo-reports-devops/stack/compute (update)
Get: file:///Users/jgross/GitHub/bb-coo-reports-devops/stack/logs (update)

Initializing provider plugins...
- Downloading plugin for provider "aws"...
- Downloading plugin for provider "template"...
- Downloading plugin for provider "random"...

The following providers do not have any version constraints in configuration,
so the latest version was installed.

To prevent automatic upgrades to new major versions that may contain breaking
changes, it is recommended to add version = "..." constraints to the
corresponding provider blocks in configuration, with the constraint strings
suggested below.

* provider.aws: version = "~> 0.1"
* provider.random: version = "~> 0.1"
* provider.template: version = "~> 0.1"

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
  1. terraform plan -var-file=../envs/qa3/env.tfvars -state=../envs/qa3/terraform.tfstate
@hashibot hashibot added the crash Results from or addresses a Terraform crash or kernel panic. label Aug 7, 2017
@handlerbot
Copy link
Contributor

I'm also seeing this, only on S3 buckets with lifecycle configurations set.

@handlerbot
Copy link
Contributor

OIC, this is already fixed at HEAD in #1316 cc @jgrossmac

@jgrossmac
Copy link

Thanks for the link, hopefully this gets released soon :D

@apparentlymart
Copy link
Contributor

Sorry for the regression here, everyone.

As @handlerbot noted, it does seem like this was already fixed in #1316, so will be included in the next release. I'm going to close this to reflect that, and we'll look at getting a release out soon since there's this and a bunch of stuff queued up for 0.1.4.

@handlerbot
Copy link
Contributor

handlerbot commented Aug 8, 2017

@apparentlymart Could there be a 0.1.3a ASAP with just this fix? Breaking any Terraform state that has an S3 bucket that has a lifecycle on it is pretty severe.

@jgrossmac
Copy link

@handlerbot 0.1.4 was released 2 hrs ago 😄 . Gotta love the new provider breakout.

@ghost
Copy link

ghost commented Apr 11, 2020

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 and limited conversation to collaborators Apr 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
crash Results from or addresses a Terraform crash or kernel panic.
Projects
None yet
Development

No branches or pull requests

4 participants