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

Upgrade from 3.22 to 3.28 results in an error #17679

Closed
vladimirtiukhtin opened this issue Feb 18, 2021 · 6 comments · Fixed by #17702
Closed

Upgrade from 3.22 to 3.28 results in an error #17679

vladimirtiukhtin opened this issue Feb 18, 2021 · 6 comments · Fixed by #17702
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/glue Issues and PRs that pertain to the glue service.
Milestone

Comments

@vladimirtiukhtin
Copy link

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 CLI and Terraform AWS Provider Version

Affected Resource(s)

Not clear

Expected Behavior

Provider version upgrade should not result in an error

Actual Behavior

Upgrading provider from version 3.22 to version 3.28 results in an error

Error: error setting storage_descriptor: Invalid address to set: []string{"storage_descriptor", "0", "schema_reference"}

Steps to Reproduce

Not clear, but rolling provider back to 3.22 solves the problem

@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Feb 18, 2021
@vladimirtiukhtin
Copy link
Author

Few last line of debug output if it helps

-----------------------------------------------------: timestamp=2021-02-18T10:25:24.500Z
2021-02-18T10:25:24.501Z [INFO]  plugin.terraform-provider-aws_v3.28.0_x5: 2021/02/18 10:25:24 [DEBUG] [aws-sdk-go] <DescribeAlarmsResponse xmlns="http://monitoring.amazonaws.com/doc/2010-08-01/">
<DescribeAlarmsResult>
<CompositeAlarms/>
<MetricAlarms>
<member>
<MetricName>CPUUtilization</MetricName>
<TreatMissingData>missing</TreatMissingData>
<AlarmConfigurationUpdatedTimestamp>2021-02-18T01:15:06.402Z</AlarmConfigurationUpdatedTimestamp>
<StateValue>OK</StateValue>
<Threshold>75.0</Threshold>
<StateReason>Threshold Crossed: 1 datapoint [23.611474990844727 (18/02/21 01:16:00)] was not greater than or equal to the threshold (75.0).</StateReason>
<InsufficientDataActions/>
<AlarmActions>
<member>arn:aws:autoscaling:eu-central-1:***:scalingPolicy:85e5dfff-e53e-45f6-88b5-64a01cfa6330:resource/ecs/service/***/***:policyName/api_scale_up</member>
</AlarmActions>
<StateUpdatedTimestamp>2021-02-18T01:18:16.028Z</StateUpdatedTimestamp>
<Period>60</Period>
<Statistic>Average</Statistic>
<ComparisonOperator>GreaterThanOrEqualToThreshold</ComparisonOperator>
<AlarmName>***</AlarmName>
<EvaluationPeriods>1</EvaluationPeriods>

t;,&quot;period&quot;:60,&quot;recentDatapoints&quot;:[23.611474990844727],&quot;threshold&quot;:75.0}</StateReasonData>
<ActionsEnabled>true</ActionsEnabled>
<Namespace>AWS/ECS</Namespace>
<CreationId>0382e395-88fc-42eb-945a-cddf625954eb/1613610906359</CreationId>
<OKActions/>
<AlarmArn>arn:aws:cloudwatch:eu-central-1:***:alarm:***</AlarmArn>
<Dimensions>
<member>
<Name>ClusterName</Name>
<Value>***</Value>
</member>
<member>
<Name>ServiceName</Name>
<Value>api</Value>
</member>
</Dimensions>
</member>
</MetricAlarms>
</DescribeAlarmsResult>
<ResponseMetadata>
<RequestId>0c63b6ec-de4f-4a24-97af-c6d24adc0b41</RequestId>
</ResponseMetadata>
</DescribeAlarmsResponse>: timestamp=2021-02-18T10:25:24.500Z
2021-02-18T10:25:24.501Z [INFO]  plugin.terraform-provider-aws_v3.28.0_x5: 2021/02/18 10:25:24 [DEBUG] Reading CloudWatch Metric Alarm: ***: timestamp=2021-02-18T10:25:24.500Z
2021-02-18T10:25:24.501Z [INFO]  plugin.terraform-provider-aws_v3.28.0_x5: 2021/02/18 10:25:24 [DEBUG] [aws-sdk-go] DEBUG: Request monitoring/ListTagsForResource Details:
---[ REQUEST POST-SIGN ]-----------------------------
POST / HTTP/1.1
Host: monitoring.eu-central-1.amazonaws.com
User-Agent: aws-sdk-go/1.37.4 (go1.15.5; linux; amd64) APN/1.0 HashiCorp/1.0 Terraform/0.14.6 (+https://www.terraform.io) terraform-provider-aws/dev (+https://registry.terraform.io/providers/hashicorp/aws)
Content-Length: 169
Authorization: AWS4-HMAC-SHA256 Credential=***/20210218/eu-central-1/monitoring/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date, Signature=d08a686f8abc15fff9ee4ddaf0b4a3c4b601b988454a04e56c4870ea6e300dbc
Content-Type: application/x-www-form-urlencoded; charset=utf-8
X-Amz-Date: 20210218T102524Z
Accept-Encoding: gzip

Action=ListTagsForResource&ResourceARN=arn%3Aaws%3Acloudwatch%3Aeu-central-1%3A***%3Aalarm%3***&Version=2010-08-01
-----------------------------------------------------: timestamp=2021-02-18T10:25:24.501Z
2021-02-18T10:25:24.658Z [INFO]  plugin.terraform-provider-aws_v3.28.0_x5: 2021/02/18 10:25:24 [DEBUG] [aws-sdk-go] DEBUG: Response monitoring/ListTagsForResource Details:
---[ RESPONSE ]--------------------------------------
HTTP/1.1 200 OK
Connection: close
Content-Length: 297
Content-Type: text/xml
Date: Thu, 18 Feb 2021 10:25:22 GMT
X-Amzn-Requestid: c413825b-2dfc-408f-8a24-107b61341481


-----------------------------------------------------: timestamp=2021-02-18T10:25:24.657Z
2021-02-18T10:25:24.658Z [INFO]  plugin.terraform-provider-aws_v3.28.0_x5: 2021/02/18 10:25:24 [DEBUG] [aws-sdk-go] <ListTagsForResourceResponse xmlns="http://monitoring.amazonaws.com/doc/2010-08-01/">
<ListTagsForResourceResult>
<Tags/>
</ListTagsForResourceResult>
<ResponseMetadata>
<RequestId>c413825b-2dfc-408f-8a24-107b61341481</RequestId>
</ResponseMetadata>
</ListTagsForResourceResponse>: timestamp=2021-02-18T10:25:24.657Z
2021-02-18T10:25:24.661Z [INFO]  plugin.terraform-provider-aws_v3.28.0_x5: 2021/02/18 10:25:24 [WARN] Truncating attribute path of 0 diagnostics for TypeSet: timestamp=2021-02-18T10:25:24.661Z
2021-02-18T10:25:24.691Z [INFO]  plugin.terraform-provider-aws_v3.28.0_x5: 2021/02/18 10:25:24 [DEBUG] [aws-sdk-go] DEBUG: Response monitoring/ListTagsForResource Details:
Error: error setting storage_descriptor: Invalid address to set: []string{"storage_descriptor", "0", "schema_reference"}
---[ RESPONSE ]--------------------------------------
HTTP/1.1 200 OK
Connection: close
Content-Length: 297
Content-Type: text/xml
Date: Thu, 18 Feb 2021 10:25:22 GMT
X-Amzn-Requestid: 79217b24-5e83-41b3-bf92-382d99b80edc


-----------------------------------------------------: timestamp=2021-02-18T10:25:24.691Z
2021-02-18T10:25:24.691Z [INFO]  plugin.terraform-provider-aws_v3.28.0_x5: 2021/02/18 10:25:24 [DEBUG] [aws-sdk-go] <ListTagsForResourceResponse xmlns="http://monitoring.amazonaws.com/doc/2010-08-01/">
<ListTagsForResourceResult>
<Tags/>
</ListTagsForResourceResult>
<ResponseMetadata>
<RequestId>79217b24-5e83-41b3-bf92-382d99b80edc</RequestId>
</ResponseMetadata>
</ListTagsForResourceResponse>: timestamp=2021-02-18T10:25:24.691Z
2021-02-18T10:25:24.694Z [INFO]  plugin.terraform-provider-aws_v3.28.0_x5: 2021/02/18 10:25:24 [WARN] Truncating attribute path of 0 diagnostics for TypeSet: timestamp=2021-02-18T10:25:24.694Z

2021-02-18T10:25:24.702Z [WARN]  plugin.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = transport is closing"
2021-02-18T10:25:24.709Z [DEBUG] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/aws/3.28.0/linux_amd64/terraform-provider-aws_v3.28.0_x5 pid=1187722
2021-02-18T10:25:24.709Z [DEBUG] plugin: plugin exited


Error: error setting storage_descriptor: Invalid address to set: []string{"storage_descriptor", "0", "schema_reference"}

@ewbankkit ewbankkit added the service/glue Issues and PRs that pertain to the glue service. label Feb 18, 2021
@ewbankkit
Copy link
Contributor

aws_glue_catalog_table resource added schema_reference to the storage_descriptor block in #17335 (Terraform AWS Provider v3.27.0).

@vladimirtiukhtin Thanks for raising this issue.
Could you please add the configuration that is causing this?

@ewbankkit ewbankkit added waiting-response Maintainers are waiting on response from community or contributor. and removed needs-triage Waiting for first response or review from a maintainer. labels Feb 18, 2021
@vladimirtiukhtin
Copy link
Author

Thanks for the prompt response @ewbankkit. Please find an example below

resource "aws_glue_catalog_database" "xxx" {
  name = lower(replace("xxx", "/[-]/", "_"))
}

resource "aws_glue_catalog_table" "xxx" {
  name          = "xxx"
  table_type    = "EXTERNAL_TABLE"
  database_name = aws_glue_catalog_database.xxx.name
  parameters = {
    "EXTERNAL"              = "TRUE"
    "parquet.compression"   = "SNAPPY"
    "transient_lastDdlTime" = "1607072581"
  }

  storage_descriptor {
    location      = "s3://${aws_s3_bucket.xxx.id}/"
    input_format  = "org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat"
    output_format = "org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat"

    ser_de_info {
      serialization_library = "org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe"
      parameters = {
        "serialization.format" = "1"
      }
    }

    columns {
      name = "x1"
      type = "int"
    }

    columns {
      name = "x2"
      type = "array<float>"
    }

    columns {
      name = "x3"
      type = "array<float>"
    }
  }

  partition_keys {
    name = "version"
    type = "int"
  }
}

resource "aws_glue_partition" "xxx" {
  database_name    = aws_glue_catalog_database.xxx.name
  table_name       = aws_glue_catalog_table.xxx.name
  partition_values = [
    "1"
  ]

  storage_descriptor {
    location      = "s3://${aws_s3_bucket.xxx.id}/version=1"
    input_format  = "org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat"
    output_format = "org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat"

    ser_de_info {
      serialization_library = "org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe"
      parameters = {
        "serialization.format" = "1"
      }
    }

    columns {
      name = "x1"
      type = "int"
    }

    columns {
      name = "x2"
      type = "array<float>"
    }

    columns {
      name = "x3"
      type = "array<float>"
    }
  }
}

@ghost ghost removed waiting-response Maintainers are waiting on response from community or contributor. labels Feb 18, 2021
@DrFaust92 DrFaust92 added the regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. label Feb 18, 2021
@DrFaust92
Copy link
Collaborator

Issue is with using flattenGlueStorageDescriptor in aws_glue_partiton which does not support schema_reference

@ewbankkit ewbankkit added the bug Addresses a defect in current functionality. label Feb 18, 2021
@github-actions github-actions bot added this to the v3.29.0 milestone Feb 19, 2021
@ghost
Copy link

ghost commented Feb 19, 2021

This has been released in version 3.29.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 Mar 21, 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 Mar 21, 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. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/glue Issues and PRs that pertain to the glue service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants