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

resource/aws_kinesis_firehose_delivery_stream: Fix crash in processing_configuration #1738

Merged
merged 2 commits into from
Sep 27, 2017

Conversation

stack72
Copy link
Contributor

@stack72 stack72 commented Sep 23, 2017

Fixes: #1657

Before this patch:

2017-09-12T11:56:41.138-0600 [DEBUG] plugin.terraform-provider-aws_v0.1.4_x4: panic: runtime error: index out of range
2017-09-12T11:56:41.138-0600 [DEBUG] plugin.terraform-provider-aws_v0.1.4_x4:
2017-09-12T11:56:41.138-0600 [DEBUG] plugin.terraform-provider-aws_v0.1.4_x4: goroutine 2687 [running]:
2017-09-12T11:56:41.138-0600 [DEBUG] plugin.terraform-provider-aws_v0.1.4_x4: github.com/terraform-providers/terraform-provider-aws/aws.extractProcessingConfiguration(0xc420c8f650, 0xc42080b710)
2017-09-12T11:56:41.138-0600 [DEBUG] plugin.terraform-provider-aws_v0.1.4_x4:   /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_kinesis_firehose_delivery_stream.go:541 +0x2ad
2017-09-12T11:56:41.138-0600 [DEBUG] plugin.terraform-provider-aws_v0.1.4_x4: github.com/terraform-providers/terraform-provider-aws/aws.createExtendedS3Config(0xc4203ecc40, 0xb)
2017-09-12T11:56:41.138-0600 [DEBUG] plugin.terraform-provider-aws_v0.1.4_x4:   /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_kinesis_firehose_delivery_stream.go:483 +0x479
2017-09-12T11:56:41.138-0600 [DEBUG] plugin.terraform-provider-aws_v0.1.4_x4: github.com/terraform-providers/terraform-provider-aws/aws.resourceAwsKinesisFirehoseDeliveryStreamCreate(0xc4203ecc40, 0x29c5ec0, 0xc421689a00, 0x24, 0x40555c0)
2017-09-12T11:56:41.138-0600 [DEBUG] plugin.terraform-provider-aws_v0.1.4_x4:   /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_kinesis_firehose_delivery_stream.go:808 +0xbc5
2017-09-12T11:56:41.138-0600 [DEBUG] plugin.terraform-provider-aws_v0.1.4_x4: github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*Resource).Apply(0xc421937ec0, 0xc420c4a820, 0xc420816140, 0x29c5ec0, 0xc421689a00, 0x1
, 0x28, 0xc420c8edb0)

After this patch:

terraform-testing % terraform apply
aws_s3_bucket.bucket: Refreshing state... (ID: tf-test-bucket-72)
aws_iam_role.firehose: Refreshing state... (ID: tf_acctest_firehose_delivery_role_72)
aws_kinesis_firehose_delivery_stream.broken_tracking_autocomplete_stream: Creating...
  arn:                                                      "" => "<computed>"
  destination:                                              "" => "extended_s3"
  destination_id:                                           "" => "<computed>"
  extended_s3_configuration.#:                              "" => "1"
  extended_s3_configuration.0.bucket_arn:                   "" => "arn:aws:s3:::tf-test-bucket-72"
  extended_s3_configuration.0.buffer_interval:              "" => "300"
  extended_s3_configuration.0.buffer_size:                  "" => "5"
  extended_s3_configuration.0.cloudwatch_logging_options.#: "" => "<computed>"
  extended_s3_configuration.0.compression_format:           "" => "GZIP"
  extended_s3_configuration.0.prefix:                       "" => "tracking/autocomplete_stream/"
  extended_s3_configuration.0.role_arn:                     "" => "arn:aws:iam::187416307283:role/tf_acctest_firehose_delivery_role_72"
  name:                                                     "" => "tracking_autocomplete_stream"
  version_id:                                               "" => "<computed>"
aws_kinesis_firehose_delivery_stream.broken_tracking_autocomplete_stream: Still creating... (10s elapsed)
aws_kinesis_firehose_delivery_stream.broken_tracking_autocomplete_stream: Still creating... (2m0s elapsed)
aws_kinesis_firehose_delivery_stream.broken_tracking_autocomplete_stream: Still creating... (3m30s elapsed)
aws_kinesis_firehose_delivery_stream.broken_tracking_autocomplete_stream: Creation complete after 3m38s (ID: arn:aws:firehose:us-west-2:187416307283...erystream/tracking_autocomplete_stream)

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

Test Output:

terraform-provider-aws [b-aws-kfhd-crash-1657●] % acctests aws TestAccAWSKinesisFirehoseDeliveryStream_
=== RUN   TestAccAWSKinesisFirehoseDeliveryStream_s3basic
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_s3basic (142.95s)
=== RUN   TestAccAWSKinesisFirehoseDeliveryStream_s3WithCloudwatchLogging
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_s3WithCloudwatchLogging (153.92s)
=== RUN   TestAccAWSKinesisFirehoseDeliveryStream_s3ConfigUpdates
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_s3ConfigUpdates (266.77s)
=== RUN   TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3basic
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3basic (282.11s)
=== RUN   TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3InvalidProcessorType
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3InvalidProcessorType (2.86s)
=== RUN   TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3InvalidParameterName
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3InvalidParameterName (2.49s)
=== RUN   TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3Updates
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3Updates (182.25s)
=== RUN   TestAccAWSKinesisFirehoseDeliveryStream_RedshiftConfigUpdates
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_RedshiftConfigUpdates (902.22s)
=== RUN   TestAccAWSKinesisFirehoseDeliveryStream_ElasticsearchConfigUpdates
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_ElasticsearchConfigUpdates (1236.74s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	3172.372s

…g_configuration

Fixes: hashicorp#1657

Before this patch:

```
2017-09-12T11:56:41.138-0600 [DEBUG] plugin.terraform-provider-aws_v0.1.4_x4: panic: runtime error: index out of range
2017-09-12T11:56:41.138-0600 [DEBUG] plugin.terraform-provider-aws_v0.1.4_x4:
2017-09-12T11:56:41.138-0600 [DEBUG] plugin.terraform-provider-aws_v0.1.4_x4: goroutine 2687 [running]:
2017-09-12T11:56:41.138-0600 [DEBUG] plugin.terraform-provider-aws_v0.1.4_x4: github.com/terraform-providers/terraform-provider-aws/aws.extractProcessingConfiguration(0xc420c8f650, 0xc42080b710)
2017-09-12T11:56:41.138-0600 [DEBUG] plugin.terraform-provider-aws_v0.1.4_x4:   /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_kinesis_firehose_delivery_stream.go:541 +0x2ad
2017-09-12T11:56:41.138-0600 [DEBUG] plugin.terraform-provider-aws_v0.1.4_x4: github.com/terraform-providers/terraform-provider-aws/aws.createExtendedS3Config(0xc4203ecc40, 0xb)
2017-09-12T11:56:41.138-0600 [DEBUG] plugin.terraform-provider-aws_v0.1.4_x4:   /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_kinesis_firehose_delivery_stream.go:483 +0x479
2017-09-12T11:56:41.138-0600 [DEBUG] plugin.terraform-provider-aws_v0.1.4_x4: github.com/terraform-providers/terraform-provider-aws/aws.resourceAwsKinesisFirehoseDeliveryStreamCreate(0xc4203ecc40, 0x29c5ec0, 0xc421689a00, 0x24, 0x40555c0)
2017-09-12T11:56:41.138-0600 [DEBUG] plugin.terraform-provider-aws_v0.1.4_x4:   /opt/teamcity-agent/work/222ea50a1b4f75f4/src/github.com/terraform-providers/terraform-provider-aws/aws/resource_aws_kinesis_firehose_delivery_stream.go:808 +0xbc5
2017-09-12T11:56:41.138-0600 [DEBUG] plugin.terraform-provider-aws_v0.1.4_x4: github.com/terraform-providers/terraform-provider-aws/vendor/github.com/hashicorp/terraform/helper/schema.(*Resource).Apply(0xc421937ec0, 0xc420c4a820, 0xc420816140, 0x29c5ec0, 0xc421689a00, 0x1
, 0x28, 0xc420c8edb0)
```

After this patch:

```
terraform-testing % terraform apply
aws_s3_bucket.bucket: Refreshing state... (ID: tf-test-bucket-72)
aws_iam_role.firehose: Refreshing state... (ID: tf_acctest_firehose_delivery_role_72)
aws_kinesis_firehose_delivery_stream.broken_tracking_autocomplete_stream: Creating...
  arn:                                                      "" => "<computed>"
  destination:                                              "" => "extended_s3"
  destination_id:                                           "" => "<computed>"
  extended_s3_configuration.#:                              "" => "1"
  extended_s3_configuration.0.bucket_arn:                   "" => "arn:aws:s3:::tf-test-bucket-72"
  extended_s3_configuration.0.buffer_interval:              "" => "300"
  extended_s3_configuration.0.buffer_size:                  "" => "5"
  extended_s3_configuration.0.cloudwatch_logging_options.#: "" => "<computed>"
  extended_s3_configuration.0.compression_format:           "" => "GZIP"
  extended_s3_configuration.0.prefix:                       "" => "tracking/autocomplete_stream/"
  extended_s3_configuration.0.role_arn:                     "" => "arn:aws:iam::187416307283:role/tf_acctest_firehose_delivery_role_72"
  name:                                                     "" => "tracking_autocomplete_stream"
  version_id:                                               "" => "<computed>"
aws_kinesis_firehose_delivery_stream.broken_tracking_autocomplete_stream: Still creating... (10s elapsed)
aws_kinesis_firehose_delivery_stream.broken_tracking_autocomplete_stream: Still creating... (2m0s elapsed)
aws_kinesis_firehose_delivery_stream.broken_tracking_autocomplete_stream: Still creating... (3m30s elapsed)
aws_kinesis_firehose_delivery_stream.broken_tracking_autocomplete_stream: Creation complete after 3m38s (ID: arn:aws:firehose:us-west-2:187416307283...erystream/tracking_autocomplete_stream)

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
```

Test Output:

```
terraform-provider-aws [b-aws-kfhd-crash-1657●] % acctests aws TestAccAWSKinesisFirehoseDeliveryStream_
=== RUN   TestAccAWSKinesisFirehoseDeliveryStream_s3basic
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_s3basic (142.95s)
=== RUN   TestAccAWSKinesisFirehoseDeliveryStream_s3WithCloudwatchLogging
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_s3WithCloudwatchLogging (153.92s)
=== RUN   TestAccAWSKinesisFirehoseDeliveryStream_s3ConfigUpdates
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_s3ConfigUpdates (266.77s)
=== RUN   TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3basic
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3basic (282.11s)
=== RUN   TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3InvalidProcessorType
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3InvalidProcessorType (2.86s)
=== RUN   TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3InvalidParameterName
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3InvalidParameterName (2.49s)
=== RUN   TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3Updates
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3Updates (182.25s)
=== RUN   TestAccAWSKinesisFirehoseDeliveryStream_RedshiftConfigUpdates
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_RedshiftConfigUpdates (902.22s)
=== RUN   TestAccAWSKinesisFirehoseDeliveryStream_ElasticsearchConfigUpdates
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_ElasticsearchConfigUpdates (1236.74s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	3172.372s
```
@radeksimko radeksimko added bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic. labels Sep 27, 2017
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix. I just added an acceptance test to cover it. 👍

@radeksimko radeksimko merged commit 42cf3ed into hashicorp:master Sep 27, 2017
@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
bug Addresses a defect in current functionality. crash Results from or addresses a Terraform crash or kernel panic.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash Report aws_kinesis_firehose_delivery_stream
2 participants