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

Error when importing AWS alb #1885

Open
renzowit opened this issue Jun 11, 2024 · 11 comments
Open

Error when importing AWS alb #1885

renzowit opened this issue Jun 11, 2024 · 11 comments

Comments

@renzowit
Copy link

Command: terraformer import aws --resources=alb --regions=eu-west-1

output:
2024/06/11 16:36:22 aws importing region eu-west-1
2024/06/11 16:36:23 aws importing... alb
2024/06/11 16:36:23 aws done importing alb
2024/06/11 16:36:23 Number of resources for service alb: 3
2024/06/11 16:36:23 Refreshing state... aws_lb_target_group.tfer--test
2024/06/11 16:36:23 Refreshing state... aws_lb.tfer--test
2024/06/11 16:36:23 Refreshing state... aws_lb_listener.tfer--arn-003A-aws-003A-elasticloadbalancing-003A-eu-west-1-003A-591217560485-003A-listener-002F-app-002F-test-002F-dcab94c91c4f6e4d-002F-5b4e04fe42683b14
2024-06-11T16:36:24.002+0200 [ERROR] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/aws/5.53.0/darwin_amd64/terraform-provider-aws_v5.53.0_x5 pid=10049 error="exit status 2"
2024/06/11 16:36:24 rpc error: code = Unavailable desc = error reading from server: EOF
2024/06/11 16:36:24 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:24 rpc error: code = Unavailable desc = error reading from server: EOF
2024/06/11 16:36:24 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:24 rpc error: code = Unavailable desc = error reading from server: EOF
2024/06/11 16:36:24 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:24 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:24 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:24 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:24 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:24 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:24 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:24 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:24 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:24 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:24 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:24 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:24 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:24 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:24 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:24 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:24 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:24 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:24 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:25 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:25 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:25 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:25 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:25 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:25 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/11 16:36:25 Fail read resource from provider, trying import command
2024/06/11 16:36:25 Fail read resource from provider, trying import command
2024/06/11 16:36:25 Fail read resource from provider, trying import command
2024/06/11 16:36:25 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:25 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:25 rpc error: code = Canceled desc = context canceled
2024/06/11 16:36:25 ERROR: Unable to refresh resource tfer--test
2024/06/11 16:36:25 ERROR: Unable to refresh resource tfer--arn-003A-aws-003A-elasticloadbalancing-003A-eu-west-1-003A-591217560485-003A-listener-002F-app-002F-test-002F-dcab94c91c4f6e4d-002F-5b4e04fe42683b14
2024/06/11 16:36:25 ERROR: Unable to refresh resource tfer--test
2024/06/11 16:36:25 Filtered number of resources for service alb: 0
2024/06/11 16:36:25 aws Connecting....
2024/06/11 16:36:25 aws save alb
2024/06/11 16:36:25 aws save tfstate for alb

@Rishikeshpal
Copy link

I faced the same issue while abstracting alb through terraformer.
Below are th eversions i am using:
terraformer: version v0.8.24
terraform: v1.6.0
go: go1.16.4 darwin/amd64

issue: terraformer import aws --resources=alb --regions=eu-west-1 --profile=""
returns:
2024/06/20 11:15:15 aws importing region eu-west-1
2024/06/20 11:15:16 aws importing... alb
2024/06/20 11:15:16 aws done importing alb
2024/06/20 11:15:16 Number of resources for service alb: 5
2024/06/20 11:15:16 Refreshing state... aws_lb_target_group_attachment.tfer--arn-003A-aws-003A-elasticloadbalancing-003A-eu-west-1-003A-xxxxx-003A-targetgroup-002F-xxx-target-group-002F-e0e8284dbded8b75-172-002E-31-002E-39-002E-5
2024/06/20 11:15:16 Refreshing state... aws_lb_target_group_attachment.tfer--arn-003A-aws-003A-elasticloadbalancing-003A-eu-west-1-003A-xxxxx-003A-targetgroup-002F-xxx-target-group-002F-e0e8284dbded8b75-172-002E-31-002E-35-002E-9
2024/06/20 11:15:16 Refreshing state... aws_lb.tfer--xxx-nlb
2024/06/20 11:15:16 Refreshing state... aws_lb_listener.tfer--arn-003A-aws-003A-elasticloadbalancing-003A-eu-west-1-003A-xxxx-003A-listener-002F-net-002F-dev-pofp-nlb-002F-6bc98b94efb85469-002F-183812bd6791087e
2024/06/20 11:15:16 Refreshing state... aws_lb_target_group.tfer--xxx-target-group
2024/06/20 11:15:16 ERROR: Read resource response is null for resource aws_lb_target_group_attachment.tfer--arn-003A-aws-003A-elasticloadbalancing-003A-eu-west-1-003A-xxxxx-003A-targetgroup-002F-xxx-target-group-002F-e0e8284dbded8b75-172-002E-31-002E-35-002E-9
2024/06/20 11:15:16 ERROR: Read resource response is null for resource aws_lb_target_group_attachment.tfer--arn-003A-aws-003A-elasticloadbalancing-003A-eu-west-1-003A-xxxxx-003A-targetgroup-002F-xxx-target-group-002F-e0e8284dbded8b75-172-002E-31-002E-39-002E-5
2024/06/20 11:15:16 rpc error: code = Unavailable desc = error reading from server: EOF
2024/06/20 11:15:16 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:16 rpc error: code = Unavailable desc = error reading from server: EOF
2024-06-20T11:15:16.708+0100 [ERROR] plugin: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/aws/5.54.1/darwin_arm64/terraform-provider-aws_v5.54.1_x5 pid=12679 error="exit status 2"
2024/06/20 11:15:16 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:16 rpc error: code = Unavailable desc = error reading from server: EOF
2024/06/20 11:15:16 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:17 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:17 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:17 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:17 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:17 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:17 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:17 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:17 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:17 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:17 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:17 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:17 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:17 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:17 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:17 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:17 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:17 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:17 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:17 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:17 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:17 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:17 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:17 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:17 WARN: Fail read resource from provider, wait 300ms before retry
2024/06/20 11:15:18 Fail read resource from provider, trying import command
2024/06/20 11:15:18 Fail read resource from provider, trying import command
2024/06/20 11:15:18 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:18 Fail read resource from provider, trying import command
2024/06/20 11:15:18 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:18 rpc error: code = Canceled desc = context canceled
2024/06/20 11:15:18 ERROR: Unable to refresh resource tfer--arn-003A-aws-003A-elasticloadbalancing-003A-eu-west-1-003A-xxxxx-003A-targetgroup-002F-xxxp-target-group-002F-e0e8284dbded8b75-172-002E-31-002E-39-002E-5
2024/06/20 11:15:18 ERROR: Unable to refresh resource tfer--arn-003A-aws-003A-elasticloadbalancing-003A-eu-west-1-003A-xxxxxx-003A-targetgroup-002F-xxx-target-group-002F-e0e8284dbded8b75-172-002E-31-002E-35-002E-9
2024/06/20 11:15:18 ERROR: Unable to refresh resource tfer--dev-pofp-nlb
2024/06/20 11:15:18 ERROR: Unable to refresh resource tfer--arn-003A-aws-003A-elasticloadbalancing-003A-eu-west-1-003A-xxxxxx-003A-listener-002F-net-002F-xxxp-nlb-002F-6bc98b94efb85469-002F-183812bd6791087e
2024/06/20 11:15:18 ERROR: Unable to refresh resource tfer--xxxp-target-group
2024/06/20 11:15:18 Filtered number of resources for service alb: 0
2024/06/20 11:15:18 aws Connecting....
2024/06/20 11:15:18 aws save alb
2024/06/20 11:15:18 aws save tfstate for alb

@ThiagoRGoveia
Copy link

Downgrading the provider to 4.* is a temporary fix

@jamiejackson
Copy link

@ThiagoRGoveia , please give an exact version of 4 that works for you. I tried 4.2.1, for instance, which was not an improvement.

@ThiagoRGoveia
Copy link

@jamiejackson version the aws provider version 4.67.0 worked for me

@fogers777
Copy link

having same issue. with provider 4.67.0 it doesnt work for me..

@Hifounder
Copy link

aws provider 4.67.0 and use terraform-aws-alb v8.7.0 tag

@sudo-palash
Copy link

having same issue. I tried with v4.67.0 and still same error.

@samveen
Copy link
Contributor

samveen commented Aug 24, 2024

For me, this error triggers if any rule in the target group is missing a Name tag. Updating all the rules with a Name tag removed the error for me.

Provider:

terraform {
  required_providers {
    aws = {
      source = "hashicorp/aws"
      version = "~> 5.63.1"
    }
  }
}

Terraformer version v0.8.24-35-gf3e9ae76 (locally built from HEAD on master branch).

@samveen
Copy link
Contributor

samveen commented Aug 30, 2024

Fixed completely by hashicorp/terraform-provider-aws#39039 ( v5.65.0 of the Terraform AWS Provider.)

@beethika10
Copy link

Tried with multiple plugin versions 4.* 5.* nothing worked.
Any ETA on fix.

@okpranavbansal
Copy link

okpranavbansal commented Oct 28, 2024

@beethika10 use terraform 5.73 , there is a problem with the versions ; updated version doesn't have this problem!

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "5.73.0"
    }
  }
}

provider "aws" {
  region = "ap-south-1"
}

like this i think this would solve all the errors !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants