Terraform crash for aws project

Terraform v0.13.0
The project provision was 8 months before. just updating the tags and got the error.
Terraform crash

Error: rpc error: code = Unavailable desc = connection error: desc = “transport: error while dialing: dial unix /tmp/plugin577458583: connect: connection refused”
Error: rpc error: code = Unavailable desc = connection error: desc = “transport: error while dialing: dial unix /tmp/plugin577458583: connect: connection refused”
Error: rpc error: code = Unavailable desc = connection error: desc = “transport: error while dialing: dial unix /tmp/plugin577458583: connect: connection refused”
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Unavailable desc = transport is closing
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Unavailable desc = connection error: desc = “transport: error while dialing: dial unix /tmp/plugin577458583: connect: connection refused”
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Unavailable desc = connection error: desc = “transport: error while dialing: dial unix /tmp/plugin577458583: connect: connection refused”
Error: rpc error: code = Unavailable desc = transport is closing
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Unavailable desc = transport is closing
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Unavailable desc = transport is closing
Error: rpc error: code = Unavailable desc = transport is closing
Error: rpc error: code = Unavailable desc = connection error: desc = “transport: error while dialing: dial unix /tmp/plugin577458583: connect: connection refused”
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Unavailable desc = transport is closing
Error: rpc error: code = Unavailable desc = connection error: desc = “transport: error while dialing: dial unix /tmp/plugin577458583: connect: connection refused”
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Unavailable desc = connection error: desc = “transport: error while dialing: dial unix /tmp/plugin577458583: connect: connection refused”
Error: rpc error: code = Unavailable desc = connection error: desc = “transport: error while dialing: dial unix /tmp/plugin577458583: connect: connection refused”
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Unavailable desc = connection error: desc = “transport: error while dialing: dial unix /tmp/plugin577458583: connect: connection refused”
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Unavailable desc = connection error: desc = “transport: error while dialing: dial unix /tmp/plugin577458583: connect: connection refused”
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Unavailable desc = transport is closing
Error: rpc error: code = Unavailable desc = transport is closing
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Unavailable desc = connection error: desc = “transport: error while dialing: dial unix /tmp/plugin577458583: connect: connection refused”
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Unavailable desc = connection error: desc = “transport: error while dialing: dial unix /tmp/plugin577458583: connect: connection refused”
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Canceled desc = context canceled
Error: rpc error: code = Unavailable desc = connection error: desc = “transport: error while dialing: dial unix /tmp/plugin577458583: connect: connection refused”
Error: rpc error: code = Unavailable desc = transport is closing
Error: rpc error: code = Unavailable desc = connection error: desc = “transport: error while dialing: dial unix /tmp/plugin577458583: connect: connection refused”
Error: rpc error: code = Unavailable desc = connection error: desc = “transport: error while dialing: dial unix /tmp/plugin577458583: connect: connection refused”
panic: Error reading level state: strconv.ParseInt: parsing “42757242880”: value out of range
2023-03-13T14:36:24.559Z [DEBUG] plugin.terraform-provider-aws_v4.58.0_x5:
2023-03-13T14:36:24.559Z [DEBUG] plugin.terraform-provider-aws_v4.58.0_x5: goroutine 408 [running]:
2023-03-13T14:36:24.559Z [DEBUG] plugin.terraform-provider-aws_v4.58.0_x5: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ResourceData).get(0x1fc9cfa0, {0x1fcd2300, 0x1, 0x1}, 0x8)
2023-03-13T14:36:24.559Z [DEBUG] plugin.terraform-provider-aws_v4.58.0_x5: github.com/hashicorp/terraform-plugin-sdk/v2@v2.25.0/helper/schema/resource_data.go:553 +0x279
2023-03-13T14:36:24.559Z [DEBUG] plugin.terraform-provider-aws_v4.58.0_x5: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ResourceData).State(0x1fc9cfa0)
2023-03-13T14:36:24.559Z [DEBUG] plugin.terraform-provider-aws_v4.58.0_x5: github.com/hashicorp/terraform-plugin-sdk/v2@v2.25.0/helper/schema/resource_data.go:351 +0x3a7
2023-03-13T14:36:24.559Z [DEBUG] plugin.terraform-provider-aws_v4.58.0_x5: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).ShimInstanceStateFromValue(0x1c939490, {{{0x147b3b40, 0x1fcb5718}}, {0x119b5dc0, 0x1e4c1d20}})
2023-03-13T14:36:24.559Z [DEBUG] plugin.terraform-provider-aws_v4.58.0_x5: github.com/hashicorp/terraform-plugin-sdk/v2@v2.25.0/helper/schema/resource.go:599 +0x1d9
2023-03-13T14:36:24.559Z [DEBUG] plugin.terraform-provider-aws_v4.58.0_x5: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0x1df88990, {0x147b32c0, 0x1fcc45a0}, 0x1e4c1580)
2023-03-13T14:36:24.559Z [DEBUG] plugin.terraform-provider-aws_v4.58.0_x5: github.com/hashicorp/terraform-plugin-sdk/v2@v2.25.0/helper/schema/grpc_provider.go:587 +0x23f
2023-03-13T14:36:24.559Z [DEBUG] plugin.terraform-provider-aws_v4.58.0_x5: github.com/hashicorp/terraform-plugin-mux/tf5muxserver.muxServer.ReadResource({0x1df9e360, 0x1df9e3a0, {0x1e8fdad0, 0x2, 0x2}, {0x0, 0x0, 0x0}, {0x0, 0x0, …}, …}, …)
2023-03-13T14:36:24.559Z [DEBUG] plugin.terraform-provider-aws_v4.58.0_x5: github.com/hashicorp/terraform-plugin-mux@v0.9.0/tf5muxserver/mux_server_ReadResource.go:26 +0x151
2023-03-13T14:36:24.559Z [DEBUG] plugin.terraform-provider-aws_v4.58.0_x5: github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadResource(0x1ec1b130, {0x147b32c0, 0x1fcc4228}, 0x1fc927b0)
2023-03-13T14:36:24.559Z [DEBUG] plugin.terraform-provider-aws_v4.58.0_x5: github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/tf5server/server.go:748 +0x4c5
2023-03-13T14:36:24.560Z [DEBUG] plugin.terraform-provider-aws_v4.58.0_x5: github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0x131f3620, 0x1ec1b130}, {0x147b32c0, 0x1fcc4228}, 0x1fc84740, 0x0)
2023-03-13T14:36:24.560Z [DEBUG] plugin.terraform-provider-aws_v4.58.0_x5: github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:349 +0x18a
2023-03-13T14:36:24.560Z [DEBUG] plugin.terraform-provider-aws_v4.58.0_x5: google.golang.org/grpc.(*Server).processUnaryRPC(0x1cbd9680, {0x147b8c10, 0x1c526360}, 0x1f8fa820, 0x1e176990, 0x1a9d82c8, 0x0)
2023-03-13T14:36:24.560Z [DEBUG] plugin.terraform-provider-aws_v4.58.0_x5: google.golang.org/grpc@v1.53.0/server.go:1336 +0xe22
2023-03-13T14:36:24.560Z [DEBUG] plugin.terraform-provider-aws_v4.58.0_x5: google.golang.org/grpc.(*Server).handleStream(0x1cbd9680, {0x147b8c10, 0x1c526360}, 0x1f8fa820, 0x0)
2023-03-13T14:36:24.560Z [DEBUG] plugin.terraform-provider-aws_v4.58.0_x5: google.golang.org/grpc@v1.53.0/server.go:1704 +0xa17
2023-03-13T14:36:24.560Z [DEBUG] plugin.terraform-provider-aws_v4.58.0_x5: google.golang.org/grpc.(*Server).serveStreams.func1.2()
2023-03-13T14:36:24.560Z [DEBUG] plugin.terraform-provider-aws_v4.58.0_x5: google.golang.org/grpc@v1.53.0/server.go:965 +0xb1
2023-03-13T14:36:24.560Z [DEBUG] plugin.terraform-provider-aws_v4.58.0_x5: created by google.golang.org/grpc.(*Server).serveStreams.func1
2023-03-13T14:36:24.560Z [DEBUG] plugin.terraform-provider-aws_v4.58.0_x5: google.golang.org/grpc@v1.53.0/server.go:963 +0x25f
2023/03/13 14:36:24 [ERROR] eval: *terraform.EvalRefresh, err: rpc error: code = Unavailable desc = transport is closing
2023/03/13 14:36:24 [ERROR] eval: *terraform.EvalSequence, err: rpc error: code = Unavailable desc = transport is closing
2023/03/13 14:36:24 [TRACE] [walkRefresh] Exiting eval tree:

!!! TERRAFORM CRASH !!!
Terraform crashed! This is always indicative of a bug within Terraform.
A crash log has been placed at “crash.log” relative to your current
working directory. It would be immensely helpful if you could please
report the crash with Terraform[1] so that we can fix this.
When reporting bugs, please include your terraform version. That
information is available on the first line of crash.log. You can also
get it by running ‘terraform --version’ on the command line.
SECURITY WARNING: the “crash.log” file that was created may contain
sensitive information that must be redacted before it is safe to share
on the issue tracker.
[1]: Issues · hashicorp/terraform · GitHub
!!! TERRAFORM CRASH !!!
Cleaning up file based variables
00:00
ERROR: Job failed: exit status 1

I think it’s suggesting that your Terraform state file contains the value 42757242880 from a previous apply, and something has changed in terraform-provider-aws (I notice you’re running a version published 4 days ago, so must have updated it since 8 months ago) and the new version of the provider is crashing when trying to read that data.

I’d start by trying to roll back the version of terraform-provider-aws to whatever you used before, whilst also having a look in the state to see in what context 42757242880 appears.

@prodipto03ei38, I can’t recall if any changes in core were mode to help work around large integer problems like this, but that is a very old version of Terraform which could be involved. If you can’t upgrade soon, at the very least you should be running the latest patch release, which was v0.13.7.

This is the value of elasticfilesystem in bytes, I checked in the tfstate file.
{
“value”: 42757242880,
“value_in_ia”: 0,
“value_in_standard”: 42757242880
}

I have a similar issue with the google provider complaining it can’t parseInt a large number. When I build my project in gitlab there is no issue parsing the state file and the plan states there is nothing to do as expected. But when I run terraform on my laptop it complains about the value. Anyone face/fix this issue?

$ terraform -v
Terraform v1.6.5
on windows_386

fernandf@ITS-CSG-47FS3G ~/gcp-datastreams
$ terraform init

Initializing the backend...

Successfully configured the backend "gcs"! Terraform will automatically
use this backend unless the backend configuration changes.
Initializing modules...
- datastreams in modules\datastreams

Initializing provider plugins...
- Finding latest version of hashicorp/google...
- Installing hashicorp/google v5.7.0...
- Installed hashicorp/google v5.7.0 (signed by HashiCorp)

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

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.

fernandf@ITS-CSG-47FS3G ~/gcp-datastreams
$ terraform plan
module.datastreams.google_datastream_connection_profile.bigquery_dest_resource: Refreshing state... [id=projects/ucr-data-warehouse-sand/locations/us-west1/connectionProfiles/bigquery-dest]
module.datastreams.google_datastream_connection_profile.kuali_sponsored_resource: Refreshing state... [id=projects/ucr-data-warehouse-sand/locations/us-west1/connectionProfiles/kuali-sponsor
ed-programs-prod]
module.datastreams.google_bigquery_dataset.kuali_dataset_resource: Refreshing state... [id=projects/ucr-data-warehouse-sand/datasets/kuali_sponsored_programs]

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: Plugin did not respond
│
│   with module.datastreams.google_datastream_connection_profile.kuali_sponsored_resource,
│   on modules\datastreams\streams.tf line 1, in resource "google_datastream_connection_profile" "kuali_sponsored_resource":
│    1: resource "google_datastream_connection_profile" "kuali_sponsored_resource" {
│
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ReadResource call. The plugin logs may contain more details.
╵
╷
│ Error: Plugin did not respond
│
│   with module.datastreams.google_datastream_connection_profile.bigquery_dest_resource,
│   on modules\datastreams\streams.tf line 15, in resource "google_datastream_connection_profile" "bigquery_dest_resource":
│   15: resource "google_datastream_connection_profile" "bigquery_dest_resource" {
│
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ReadResource call. The plugin logs may contain more details.
╵
╷
│ Error: Plugin did not respond
│
│   with module.datastreams.google_bigquery_dataset.kuali_dataset_resource,
│   on modules\datastreams\streams.tf line 24, in resource "google_bigquery_dataset" "kuali_dataset_resource":
│   24: resource "google_bigquery_dataset" "kuali_dataset_resource" {
│
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ReadResource call. The plugin logs may contain more details.
╵
Releasing state lock. This may take a few moments...

Stack trace from the terraform-provider-google_v5.7.0_x5.exe plugin:

panic: Error reading level state: strconv.ParseInt: parsing "1682518063838": value out of range

goroutine 252 [running]:
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ResourceData).get(0x17189090, {0x176a7ce0, 0x1, 0x1}, 0x8)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.24.0/helper/schema/resource_data.go:553 +0x279
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*ResourceData).State(0x17189090)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.24.0/helper/schema/resource_data.go:351 +0x3a7
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).ShimInstanceStateFromValue(0x173193b0, {{{0x4384a00, 0x176a7640}}, {0x371c720, 0x1783a220}})
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.24.0/helper/schema/resource.go:599 +0x1d9
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0x16e0af50, {0x4384280, 0x1781e540}, 0x1782f2e0)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.24.0/helper/schema/grpc_provider.go:587 +0x23f
github.com/hashicorp/terraform-plugin-mux/tf5muxserver.muxServer.ReadResource({0x17506260, 0x175062a0, {0x179954d0, 0x2, 0x2}, {0x0, 0x0, 0x0}, {0x0, 0x0, ...}, ...}, ...)
        github.com/hashicorp/terraform-plugin-mux@v0.8.0/tf5muxserver/mux_server_ReadResource.go:26 +0x151
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadResource(0x16d99040, {0x4384280, 0x17997d88}, 0x1764c0f0)
        github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/tf5server/server.go:748 +0x4c5
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadResource_Handler({0x3c0ef40, 0x16d99040}, {0x4384280, 0x17997d88}, 0x18405d00, 0x0)
        github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:349 +0x18a
google.golang.org/grpc.(*Server).processUnaryRPC(0x179026c0, {0x4388ebc, 0x17aa8000}, 0x17914500, 0x17a52258, 0x5b9e888, 0x0)
        google.golang.org/grpc@v1.58.3/server.go:1374 +0xed2
google.golang.org/grpc.(*Server).handleStream(0x179026c0, {0x4388ebc, 0x17aa8000}, 0x17914500, 0x0)
        google.golang.org/grpc@v1.58.3/server.go:1751 +0xa17
google.golang.org/grpc.(*Server).serveStreams.func1.1()
        google.golang.org/grpc@v1.58.3/server.go:986 +0xe3
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/grpc@v1.58.3/server.go:997 +0x16b

Error: The terraform-provider-google_v5.7.0_x5.exe plugin crashed!

This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.

The value the plan is complaining about is the creation time of one of the resources in the state file:

...
            "creation_time": 1682518063838,
            "dataset_id": "kuali_sponsored_programs",
            "default_collation": "",
            "default_encryption_configuration": [],
            "default_partition_expiration_ms": 0,
            "default_table_expiration_ms": 0,
            "delete_contents_on_destroy": false,
            "description": "",
            "effective_labels": {},
            "etag": "LeRKUBHq87o9bqybBEc3/w==",
            "friendly_name": "",
            "id": "projects/ucr-data-warehouse-sand/datasets/kuali_sponsored_programs",
            "is_case_insensitive": false,
            "labels": {},
            "last_modified_time": 1682518073417,
            "location": "US",
            "max_time_travel_hours": "",
            "project": "ucr-data-warehouse-sand",
...