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

[Bug]: #35268

Closed
BroMattMiller opened this issue Jan 12, 2024 · 3 comments
Closed

[Bug]: #35268

BroMattMiller opened this issue Jan 12, 2024 · 3 comments
Labels
bug Addresses a defect in current functionality. service/ecr Issues and PRs that pertain to the ecr service.

Comments

@BroMattMiller
Copy link

Terraform Core Version

1.6.6

AWS Provider Version

5.32.0

Affected Resource(s)

data "aws_ecr_image"

Expected Behavior

This .tf file:

`
terraform {
required_providers { aws = { source = "hashicorp/aws" } }
}

provider "aws" {
region = "us-east-1"
}

data "aws_ecr_repository" "main" {
name = "main"
}

data "aws_ecr_image" "latest" {
repository_name = data.aws_ecr_repository.main.name
most_recent = true
}
`

should result in an error-free "terraform plan" if the repositiory "main" has an image.

Actual Behavior

The plan will not generate.

Relevant Error/Panic Output Snippet

$ terraform plan -no-color
data.aws_ecr_repository.main: Reading...
data.aws_ecr_repository.main: Read complete after 0s [id=main]
data.aws_ecr_image.latest: Reading...

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


Error: reading ECR Images: ImageNotFoundException: The image with imageId {imageDigest:'null', imageTag:'latest'} does not exist within the repository with name 'main' in the registry with id '058043570872'

  with data.aws_ecr_image.latest,
  on main.tf line 13, in data "aws_ecr_image" "latest":
  13: data "aws_ecr_image" "latest" {

Terraform Configuration Files

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

provider "aws" {
region = "us-east-1"
}

data "aws_ecr_repository" "main" {
name = "main"
}

data "aws_ecr_image" "latest" {
repository_name = data.aws_ecr_repository.main.name
most_recent = true
}

Steps to Reproduce

Create an ECR repo called "main". Push any image to it with the tag "test".

Debug Output

$ TF_LOG=DEBUG terraform plan -no-color
2024-01-12T08:20:23.097-0700 [INFO] Terraform version: 1.6.6
2024-01-12T08:20:23.098-0700 [DEBUG] using github.com/hashicorp/go-tfe v1.36.0
2024-01-12T08:20:23.098-0700 [DEBUG] using github.com/hashicorp/hcl/v2 v2.19.1
2024-01-12T08:20:23.098-0700 [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.1
2024-01-12T08:20:23.098-0700 [DEBUG] using github.com/zclconf/go-cty v1.14.1
2024-01-12T08:20:23.098-0700 [INFO] Go runtime version: go1.21.5
2024-01-12T08:20:23.098-0700 [INFO] CLI args: []string{"terraform", "plan", "-no-color"}
2024-01-12T08:20:23.098-0700 [DEBUG] Attempting to open CLI config file: /home/mmiller/.terraformrc
2024-01-12T08:20:23.098-0700 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2024-01-12T08:20:23.098-0700 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2024-01-12T08:20:23.098-0700 [DEBUG] ignoring non-existing provider search directory /home/mmiller/.terraform.d/plugins
2024-01-12T08:20:23.098-0700 [DEBUG] ignoring non-existing provider search directory /home/mmiller/.local/share/terraform/plugins
2024-01-12T08:20:23.098-0700 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins
2024-01-12T08:20:23.098-0700 [DEBUG] ignoring non-existing provider search directory /usr/share/terraform/plugins
2024-01-12T08:20:23.098-0700 [INFO] CLI command args: []string{"plan", "-no-color"}
2024-01-12T08:20:23.099-0700 [DEBUG] New state was assigned lineage "57943018-f809-65a1-706d-b6c302375a3b"
2024-01-12T08:20:24.159-0700 [DEBUG] checking for provisioner in "."
2024-01-12T08:20:24.164-0700 [DEBUG] checking for provisioner in "/usr/bin"
2024-01-12T08:20:24.164-0700 [INFO] backend/local: starting Plan operation
2024-01-12T08:20:24.165-0700 [DEBUG] created provider logger: level=debug
2024-01-12T08:20:24.165-0700 [INFO] provider: configuring client automatic mTLS
2024-01-12T08:20:24.178-0700 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/aws/5.32.0/linux_amd64/terraform-provider-aws_v5.32.0_x5 args=[".terraform/providers/registry.terraform.io/hashicorp/aws/5.32.0/linux_amd64/terraform-provider-aws_v5.32.0_x5"]
2024-01-12T08:20:24.178-0700 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/aws/5.32.0/linux_amd64/terraform-provider-aws_v5.32.0_x5 pid=611050
2024-01-12T08:20:24.178-0700 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/aws/5.32.0/linux_amd64/terraform-provider-aws_v5.32.0_x5
2024-01-12T08:20:24.276-0700 [INFO] provider.terraform-provider-aws_v5.32.0_x5: configuring server automatic mTLS: timestamp=2024-01-12T08:20:24.276-0700
2024-01-12T08:20:24.300-0700 [DEBUG] provider.terraform-provider-aws_v5.32.0_x5: plugin address: address=/tmp/plugin3750376003 network=unix timestamp=2024-01-12T08:20:24.300-0700
2024-01-12T08:20:24.300-0700 [DEBUG] provider: using plugin: version=5
2024-01-12T08:20:25.129-0700 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2024-01-12T08:20:25.135-0700 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/aws/5.32.0/linux_amd64/terraform-provider-aws_v5.32.0_x5 pid=611050
2024-01-12T08:20:25.135-0700 [DEBUG] provider: plugin exited
2024-01-12T08:20:25.135-0700 [DEBUG] Building and walking validate graph
2024-01-12T08:20:25.136-0700 [DEBUG] ProviderTransformer: "data.aws_ecr_repository.main" (terraform.NodeValidatableResource) needs provider["registry.terraform.io/hashicorp/aws"]
2024-01-12T08:20:25.136-0700 [DEBUG] ProviderTransformer: "data.aws_ecr_image.latest" (terraform.NodeValidatableResource) needs provider["registry.terraform.io/hashicorp/aws"]
2024-01-12T08:20:25.136-0700 [DEBUG] ReferenceTransformer: "data.aws_ecr_repository.main" references: []
2024-01-12T08:20:25.136-0700 [DEBUG] ReferenceTransformer: "data.aws_ecr_image.latest" references: [data.aws_ecr_repository.main]
2024-01-12T08:20:25.136-0700 [DEBUG] ReferenceTransformer: "provider["registry.terraform.io/hashicorp/aws"]" references: []
2024-01-12T08:20:25.136-0700 [DEBUG] Starting graph walk: walkValidate
2024-01-12T08:20:25.136-0700 [DEBUG] created provider logger: level=debug
2024-01-12T08:20:25.136-0700 [INFO] provider: configuring client automatic mTLS
2024-01-12T08:20:25.142-0700 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/aws/5.32.0/linux_amd64/terraform-provider-aws_v5.32.0_x5 args=[".terraform/providers/registry.terraform.io/hashicorp/aws/5.32.0/linux_amd64/terraform-provider-aws_v5.32.0_x5"]
2024-01-12T08:20:25.142-0700 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/aws/5.32.0/linux_amd64/terraform-provider-aws_v5.32.0_x5 pid=611060
2024-01-12T08:20:25.142-0700 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/aws/5.32.0/linux_amd64/terraform-provider-aws_v5.32.0_x5
2024-01-12T08:20:25.238-0700 [INFO] provider.terraform-provider-aws_v5.32.0_x5: configuring server automatic mTLS: timestamp=2024-01-12T08:20:25.238-0700
2024-01-12T08:20:25.265-0700 [DEBUG] provider.terraform-provider-aws_v5.32.0_x5: plugin address: address=/tmp/plugin1205446773 network=unix timestamp=2024-01-12T08:20:25.265-0700
2024-01-12T08:20:25.265-0700 [DEBUG] provider: using plugin: version=5
2024-01-12T08:20:25.394-0700 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2024-01-12T08:20:25.400-0700 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/aws/5.32.0/linux_amd64/terraform-provider-aws_v5.32.0_x5 pid=611060
2024-01-12T08:20:25.400-0700 [DEBUG] provider: plugin exited
2024-01-12T08:20:25.400-0700 [INFO] backend/local: plan calling Plan
2024-01-12T08:20:25.400-0700 [DEBUG] Building and walking plan graph for NormalMode
2024-01-12T08:20:25.400-0700 [DEBUG] ProviderTransformer: "data.aws_ecr_repository.main (expand)" (terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/aws"]
2024-01-12T08:20:25.400-0700 [DEBUG] ProviderTransformer: "data.aws_ecr_image.latest (expand)" (terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/hashicorp/aws"]
2024-01-12T08:20:25.400-0700 [DEBUG] ReferenceTransformer: "data.aws_ecr_repository.main (expand)" references: []
2024-01-12T08:20:25.400-0700 [DEBUG] ReferenceTransformer: "data.aws_ecr_image.latest (expand)" references: [data.aws_ecr_repository.main (expand)]
2024-01-12T08:20:25.400-0700 [DEBUG] ReferenceTransformer: "provider["registry.terraform.io/hashicorp/aws"]" references: []
2024-01-12T08:20:25.401-0700 [DEBUG] Starting graph walk: walkPlan
2024-01-12T08:20:25.401-0700 [DEBUG] created provider logger: level=debug
2024-01-12T08:20:25.401-0700 [INFO] provider: configuring client automatic mTLS
2024-01-12T08:20:25.407-0700 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/hashicorp/aws/5.32.0/linux_amd64/terraform-provider-aws_v5.32.0_x5 args=[".terraform/providers/registry.terraform.io/hashicorp/aws/5.32.0/linux_amd64/terraform-provider-aws_v5.32.0_x5"]
2024-01-12T08:20:25.407-0700 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/hashicorp/aws/5.32.0/linux_amd64/terraform-provider-aws_v5.32.0_x5 pid=611069
2024-01-12T08:20:25.407-0700 [DEBUG] provider: waiting for RPC address: path=.terraform/providers/registry.terraform.io/hashicorp/aws/5.32.0/linux_amd64/terraform-provider-aws_v5.32.0_x5
2024-01-12T08:20:25.503-0700 [INFO] provider.terraform-provider-aws_v5.32.0_x5: configuring server automatic mTLS: timestamp=2024-01-12T08:20:25.503-0700
2024-01-12T08:20:25.524-0700 [DEBUG] provider.terraform-provider-aws_v5.32.0_x5: plugin address: network=unix address=/tmp/plugin3010348000 timestamp=2024-01-12T08:20:25.524-0700
2024-01-12T08:20:25.524-0700 [DEBUG] provider: using plugin: version=5
2024-01-12T08:20:25.645-0700 [DEBUG] provider.terraform-provider-aws_v5.32.0_x5: Configuring Terraform AWS Provider: @module=aws tf_req_id=e46a93f3-30b3-1a9c-4f5c-a0e0d0bbce51 tf_rpc=ConfigureProvider @caller=github.com/hashicorp/terraform-provider-aws/internal/conns/config.go:132 tf_mux_provider="schema.GRPCProviderServer" tf_provider_addr=registry.terraform.io/hashicorp/aws timestamp=2024-01-12T08:20:25.645-0700
2024-01-12T08:20:25.646-0700 [DEBUG] provider.terraform-provider-aws_v5.32.0_x5: Resolving credentials provider: @module=aws.aws-base tf_rpc=ConfigureProvider tf_provider_addr=registry.terraform.io/hashicorp/aws tf_req_id=e46a93f3-30b3-1a9c-4f5c-a0e0d0bbce51 @caller=github.com/hashicorp/aws-sdk-go-base/v2@v2.0.0-beta.46/logging/tf_logger.go:47 tf_mux_provider="schema.GRPCProviderServer" timestamp=2024-01-12T08:20:25.645-0700
2024-01-12T08:20:25.646-0700 [DEBUG] provider.terraform-provider-aws_v5.32.0_x5: Loading configuration: tf_mux_provider="schema.GRPCProviderServer" tf_rpc=ConfigureProvider @caller=github.com/hashicorp/aws-sdk-go-base/v2@v2.0.0-beta.46/logging/tf_logger.go:47 @module=aws.aws-base tf_provider_addr=registry.terraform.io/hashicorp/aws tf_req_id=e46a93f3-30b3-1a9c-4f5c-a0e0d0bbce51 timestamp=2024-01-12T08:20:25.646-0700
2024-01-12T08:20:25.646-0700 [DEBUG] provider.terraform-provider-aws_v5.32.0_x5: Retrieving credentials: @caller=github.com/hashicorp/aws-sdk-go-base/v2@v2.0.0-beta.46/logging/tf_logger.go:47 tf_mux_provider="schema.GRPCProviderServer" @module=aws.aws-base tf_provider_addr=registry.terraform.io/hashicorp/aws tf_req_id=e46a93f3-30b3-1a9c-4f5c-a0e0d0bbce51 tf_rpc=ConfigureProvider timestamp=2024-01-12T08:20:25.646-0700
2024-01-12T08:20:25.646-0700 [INFO] provider.terraform-provider-aws_v5.32.0_x5: Retrieved credentials: @caller=github.com/hashicorp/aws-sdk-go-base/v2@v2.0.0-beta.46/logging/tf_logger.go:39 tf_aws.credentials_source=EnvConfigCredentials tf_rpc=ConfigureProvider @module=aws.aws-base tf_mux_provider="schema.GRPCProviderServer" tf_provider_addr=registry.terraform.io/hashicorp/aws tf_req_id=e46a93f3-30b3-1a9c-4f5c-a0e0d0bbce51 timestamp=2024-01-12T08:20:25.646-0700
2024-01-12T08:20:25.646-0700 [DEBUG] provider.terraform-provider-aws_v5.32.0_x5: Loading configuration: @caller=github.com/hashicorp/aws-sdk-go-base/v2@v2.0.0-beta.46/logging/tf_logger.go:47 @module=aws.aws-base tf_mux_provider="schema.GRPCProviderServer" tf_req_id=e46a93f3-30b3-1a9c-4f5c-a0e0d0bbce51 tf_rpc=ConfigureProvider tf_provider_addr=registry.terraform.io/hashicorp/aws timestamp=2024-01-12T08:20:25.646-0700
2024-01-12T08:20:25.646-0700 [DEBUG] provider.terraform-provider-aws_v5.32.0_x5: Creating AWS SDK v1 session: @module=aws tf_provider_addr=registry.terraform.io/hashicorp/aws tf_req_id=e46a93f3-30b3-1a9c-4f5c-a0e0d0bbce51 tf_mux_provider="schema.GRPCProviderServer" tf_rpc=ConfigureProvider @caller=github.com/hashicorp/terraform-provider-aws/internal/conns/config.go:156 timestamp=2024-01-12T08:20:25.646-0700
2024-01-12T08:20:25.646-0700 [DEBUG] provider.terraform-provider-aws_v5.32.0_x5: Retrieving AWS account details: @module=aws tf_provider_addr=registry.terraform.io/hashicorp/aws tf_rpc=ConfigureProvider @caller=github.com/hashicorp/terraform-provider-aws/internal/conns/config.go:171 tf_mux_provider="schema.GRPCProviderServer" tf_req_id=e46a93f3-30b3-1a9c-4f5c-a0e0d0bbce51 timestamp=2024-01-12T08:20:25.646-0700
2024-01-12T08:20:25.646-0700 [DEBUG] provider.terraform-provider-aws_v5.32.0_x5: Retrieving caller identity from STS: @caller=github.com/hashicorp/aws-sdk-go-base/v2@v2.0.0-beta.46/logging/tf_logger.go:47 tf_mux_provider="schema.GRPCProviderServer" tf_provider_addr=registry.terraform.io/hashicorp/aws tf_req_id=e46a93f3-30b3-1a9c-4f5c-a0e0d0bbce51 @module=aws.aws-base tf_rpc=ConfigureProvider timestamp=2024-01-12T08:20:25.646-0700
2024-01-12T08:20:25.647-0700 [DEBUG] provider.terraform-provider-aws_v5.32.0_x5: HTTP Request Sent:
http.request.body=
| Action=GetCallerIdentity&Version=2011-06-15
http.request.header.authorization="AWS4-HMAC-SHA256 Credential=ASIA
3NJR/20240112/us-east-1/sts/aws4_request, SignedHeaders=amz-sdk-invocation-id;amz-sdk-request;content-length;content-type;host;x-amz-date;x-amz-security-token, Signature=" tf_req_id=e46a93f3-30b3-1a9c-4f5c-a0e0d0bbce51 http.request.header.amz_sdk_invocation_id=07ca095e-c1af-4595-b90a-27dfbb1304b1 http.user_agent="APN/1.0 HashiCorp/1.0 Terraform/1.6.6 (+https://www.terraform.io) terraform-provider-aws/5.32.0 (+https://registry.terraform.io/providers/hashicorp/aws) aws-sdk-go-v2/1.24.1 os/linux lang/go#1.20.12 md/GOOS#linux md/GOARCH#amd64 api/sts#1.26.7" rpc.method=GetCallerIdentity tf_aws.signing_region="" tf_provider_addr=registry.terraform.io/hashicorp/aws rpc.service=STS tf_aws.sdk=aws-sdk-go-v2 http.request.header.x_amz_security_token="" http.request_content_length=43 net.peer.name=sts.us-east-1.amazonaws.com @module=aws.aws-base http.request.header.amz_sdk_request="attempt=1; max=25" tf_rpc=ConfigureProvider aws.region=us-east-1 http.url=https://sts.us-east-1.amazonaws.com/ rpc.system=aws-api tf_mux_provider="schema.GRPCProviderServer" @caller=github.com/hashicorp/aws-sdk-go-base/v2@v2.0.0-beta.46/logging/tf_logger.go:47 http.method=POST http.request.header.content_type=application/x-www-form-urlencoded http.request.header.x_amz_date=20240112T152025Z timestamp=2024-01-12T08:20:25.647-0700
2024-01-12T08:20:26.066-0700 [DEBUG] provider.terraform-provider-aws_v5.32.0_x5: HTTP Response Received: tf_req_id=e46a93f3-30b3-1a9c-4f5c-a0e0d0bbce51 http.response.header.x_amzn_requestid=3cf6456a-e4a7-4deb-99a9-5b0f03f2e6f9 rpc.method=GetCallerIdentity tf_aws.sdk=aws-sdk-go-v2 tf_aws.signing_region="" http.duration=418 http.status_code=200 rpc.service=STS tf_mux_provider="schema.GRPCProviderServer" rpc.system=aws-api tf_provider_addr=registry.terraform.io/hashicorp/aws tf_rpc=ConfigureProvider @caller=github.com/hashicorp/aws-sdk-go-base/v2@v2.0.0-beta.46/logging/tf_logger.go:47
http.response.body=
|
|
| arn:aws:sts::058043570872:assumed-role/AWSReservedSSO_AdministratorAccess_99f6ed53552af910/matt
| AROA
YCTP:matt
| 058043570872
|
|
| 3cf6456a-e4a7-4deb-99a9-5b0f03f2e6f9
|
|
http.response_content_length=466 http.response.header.content_type=text/xml http.response.header.date="Fri, 12 Jan 2024 15:20:25 GMT" @module=aws.aws-base aws.region=us-east-1 timestamp=2024-01-12T08:20:26.066-0700
2024-01-12T08:20:26.066-0700 [INFO] provider.terraform-provider-aws_v5.32.0_x5: Retrieved caller identity from STS: @caller=github.com/hashicorp/aws-sdk-go-base/v2@v2.0.0-beta.46/logging/tf_logger.go:39 tf_mux_provider="schema.GRPCProviderServer" tf_rpc=ConfigureProvider @module=aws.aws-base tf_provider_addr=registry.terraform.io/hashicorp/aws tf_req_id=e46a93f3-30b3-1a9c-4f5c-a0e0d0bbce51 timestamp=2024-01-12T08:20:26.066-0700
2024-01-12T08:20:26.070-0700 [DEBUG] Resource instance state not found for node "data.aws_ecr_repository.main", instance data.aws_ecr_repository.main
2024-01-12T08:20:26.070-0700 [DEBUG] ReferenceTransformer: "data.aws_ecr_repository.main" references: []
data.aws_ecr_repository.main: Reading...
2024-01-12T08:20:26.086-0700 [DEBUG] provider.terraform-provider-aws_v5.32.0_x5: HTTP Request Sent: http.user_agent="APN/1.0 HashiCorp/1.0 Terraform/1.6.6 (+https://www.terraform.io) terraform-provider-aws/5.32.0 (+https://registry.terraform.io/providers/hashicorp/aws) aws-sdk-go/1.49.18 (go1.20.12; linux; amd64)" tf_data_source_type=aws_ecr_repository @module=aws rpc.service=ECR tf_aws.sdk=aws-sdk-go tf_req_id=76f954f4-6f6e-f787-f2f9-7cfa58b72a98 http.url=https://api.ecr.us-east-1.amazonaws.com/ tf_mux_provider="schema.GRPCProviderServer" http.request_content_length=28
http.request.body=
| {"repositoryNames":["main"]}
http.request.header.x_amz_security_token="" http.flavor=1.1 http.request.header.x_amz_target=AmazonEC2ContainerRegistry_V20150921.DescribeRepositories net.peer.name=api.ecr.us-east-1.amazonaws.com rpc.method=DescribeRepositories tf_provider_addr=registry.terraform.io/hashicorp/aws aws.region=us-east-1 http.request.header.authorization="AWS4-HMAC-SHA256 Credential=ASIA
3NJR/20240112/us-east-1/ecr/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date;x-amz-security-token;x-amz-target, Signature=" http.request.header.content_type=application/x-amz-json-1.1 tf_rpc=ReadDataSource http.method=POST http.request.header.x_amz_date=20240112T152026Z rpc.system=aws-api @caller=github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2@v2.0.0-beta.47/logger.go:109 timestamp=2024-01-12T08:20:26.085-0700
2024-01-12T08:20:26.483-0700 [DEBUG] provider.terraform-provider-aws_v5.32.0_x5: HTTP Response Received: @caller=github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2@v2.0.0-beta.47/logger.go:157 rpc.method=DescribeRepositories tf_rpc=ReadDataSource http.status_code=200 rpc.system=aws-api tf_provider_addr=registry.terraform.io/hashicorp/aws http.duration=396
http.response.body=
| {"repositories":[{"createdAt":1.705071987E9,"encryptionConfiguration":{"encryptionType":"AES256"},"imageScanningConfiguration":{"scanOnPush":false},"imageTagMutability":"MUTABLE","registryId":"058043570872","repositoryArn":"arn:aws:ecr:us-east-1:058043570872:repository/main","repositoryName":"main","repositoryUri":"058043570872.dkr.ecr.us-east-1.amazonaws.com/main"}]}
http.response.header.connection=keep-alive tf_aws.sdk=aws-sdk-go tf_mux_provider="*schema.GRPCProviderServer" @module=aws http.response.header.content_type=application/x-amz-json-1.1 http.response.header.date="Fri, 12 Jan 2024 15:20:26 GMT" http.response.header.x_amzn_requestid=a9e65c48-6131-4338-8fd9-b39e28199edf http.response_content_length=370 aws.region=us-east-1 rpc.service=ECR tf_data_source_type=aws_ecr_repository tf_req_id=76f954f4-6f6e-f787-f2f9-7cfa58b72a98 timestamp=2024-01-12T08:20:26.482-0700
2024-01-12T08:20:26.484-0700 [DEBUG] provider.terraform-provider-aws_v5.32.0_x5: HTTP Request Sent: http.request_content_length=68 http.user_agent="APN/1.0 HashiCorp/1.0 Terraform/1.6.6 (+https://www.terraform.io) terraform-provider-aws/5.32.0 (+https://registry.terraform.io/providers/hashicorp/aws) aws-sdk-go/1.49.18 (go1.20.12; linux; amd64)" http.request.header.x_amz_target=AmazonEC2ContainerRegistry_V20150921.ListTagsForResource net.peer.name=api.ecr.us-east-1.amazonaws.com tf_rpc=ReadDataSource http.flavor=1.1 http.url=https://api.ecr.us-east-1.amazonaws.com/ rpc.method=ListTagsForResource tf_req_id=76f954f4-6f6e-f787-f2f9-7cfa58b72a98 @module=aws tf_mux_provider="*schema.GRPCProviderServer" @caller=github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2@v2.0.0-beta.47/logger.go:109 aws.region=us-east-1
http.request.body=
| {"resourceArn":"arn:aws:ecr:us-east-1:058043570872:repository/main"}
http.request.header.content_type=application/x-amz-json-1.1 http.method=POST tf_aws.sdk=aws-sdk-go http.request.header.x_amz_date=20240112T152026Z http.request.header.x_amz_security_token="
" rpc.system=aws-api tf_provider_addr=registry.terraform.io/hashicorp/aws http.request.header.authorization="AWS4-HMAC-SHA256 Credential=ASIA
3NJR/20240112/us-east-1/ecr/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date;x-amz-security-token;x-amz-target, Signature=" rpc.service=ECR tf_data_source_type=aws_ecr_repository timestamp=2024-01-12T08:20:26.484-0700
2024-01-12T08:20:26.599-0700 [DEBUG] provider.terraform-provider-aws_v5.32.0_x5: HTTP Response Received: aws.region=us-east-1 http.response.header.connection=keep-alive @caller=github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2@v2.0.0-beta.47/logger.go:157 http.response.header.x_amzn_requestid=432983b5-d4a1-4353-a7e7-cf428c6e070f rpc.method=ListTagsForResource tf_data_source_type=aws_ecr_repository tf_provider_addr=registry.terraform.io/hashicorp/aws tf_req_id=76f954f4-6f6e-f787-f2f9-7cfa58b72a98 http.duration=114 http.response.header.date="Fri, 12 Jan 2024 15:20:26 GMT" http.response.header.content_type=application/x-amz-json-1.1 http.response_content_length=11 http.status_code=200 rpc.service=ECR rpc.system=aws-api tf_aws.sdk=aws-sdk-go @module=aws
http.response.body=
| {"tags":[]}
tf_rpc=ReadDataSource tf_mux_provider="*schema.GRPCProviderServer" timestamp=2024-01-12T08:20:26.598-0700
2024-01-12T08:20:26.600-0700 [DEBUG] provider.terraform-provider-aws_v5.32.0_x5: HTTP Request Sent: http.request.header.x_amz_date=20240112T152026Z http.request.header.x_amz_security_token="
" http.request.header.x_amz_target=AmazonEC2ContainerRegistry_V20150921.DescribeImages tf_rpc=ReadDataSource @caller=github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2@v2.0.0-beta.47/logger.go:109 net.peer.name=api.ecr.us-east-1.amazonaws.com tf_data_source_type=aws_ecr_repository tf_provider_addr=registry.terraform.io/hashicorp/aws
http.request.body=
| {"registryId":"058043570872","repositoryName":"main"}
http.request.header.authorization="AWS4-HMAC-SHA256 Credential=ASIA
3NJR/20240112/us-east-1/ecr/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date;x-amz-security-token;x-amz-target, Signature=" aws.region=us-east-1 rpc.system=aws-api tf_mux_provider="schema.GRPCProviderServer" http.method=POST http.request.header.content_type=application/x-amz-json-1.1 http.request_content_length=53 http.user_agent="APN/1.0 HashiCorp/1.0 Terraform/1.6.6 (+https://www.terraform.io) terraform-provider-aws/5.32.0 (+https://registry.terraform.io/providers/hashicorp/aws) aws-sdk-go/1.49.18 (go1.20.12; linux; amd64)" rpc.method=DescribeImages http.flavor=1.1 http.url=https://api.ecr.us-east-1.amazonaws.com/ tf_aws.sdk=aws-sdk-go tf_req_id=76f954f4-6f6e-f787-f2f9-7cfa58b72a98 @module=aws rpc.service=ECR timestamp=2024-01-12T08:20:26.599-0700
2024-01-12T08:20:26.714-0700 [DEBUG] provider.terraform-provider-aws_v5.32.0_x5: HTTP Response Received: @module=aws
http.response.body=
| {"imageDetails":[{"artifactMediaType":"application/vnd.docker.container.image.v1+json","imageDigest":"sha256:d1fbb74d3e14bce3a324a08c0e89ba99285c28a6886c295871d86f853e1821fc","imageManifestMediaType":"application/vnd.docker.distribution.manifest.v2+json","imagePushedAt":1.705072146E9,"imageScanFindingsSummary":{"findingSeverityCounts":{"HIGH":1,"MEDIUM":4,"INFORMATIONAL":24,"LOW":2,"CRITICAL":1,"UNDEFINED":1},"imageScanCompletedAt":1.705072154E9,"vulnerabilitySourceUpdatedAt":1.705054464E9},"imageScanStatus":{"description":"The scan was completed successfully.","status":"COMPLETE"},"imageSizeInBytes":49562953,"imageTags":["test"],"registryId":"058043570872","repositoryName":"main"}]}
http.response.header.x_amzn_requestid=887906ff-5b68-4b02-91bc-cc1caf399277 rpc.system=aws-api tf_aws.sdk=aws-sdk-go tf_provider_addr=registry.terraform.io/hashicorp/aws aws.region=us-east-1 http.duration=114 http.response.header.content_type=application/x-amz-json-1.1 http.response_content_length=692 rpc.service=ECR tf_req_id=76f954f4-6f6e-f787-f2f9-7cfa58b72a98 http.response.header.date="Fri, 12 Jan 2024 15:20:26 GMT" tf_mux_provider="schema.GRPCProviderServer" tf_rpc=ReadDataSource @caller=github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2@v2.0.0-beta.47/logger.go:157 http.response.header.connection=keep-alive http.status_code=200 rpc.method=DescribeImages tf_data_source_type=aws_ecr_repository timestamp=2024-01-12T08:20:26.714-0700
data.aws_ecr_repository.main: Read complete after 1s [id=main]
2024-01-12T08:20:26.717-0700 [DEBUG] Resource instance state not found for node "data.aws_ecr_image.latest", instance data.aws_ecr_image.latest
2024-01-12T08:20:26.717-0700 [DEBUG] ReferenceTransformer: "data.aws_ecr_image.latest" references: []
data.aws_ecr_image.latest: Reading...
2024-01-12T08:20:26.723-0700 [DEBUG] provider.terraform-provider-aws_v5.32.0_x5: HTTP Request Sent: @caller=github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2@v2.0.0-beta.47/logger.go:109 http.url=https://api.ecr.us-east-1.amazonaws.com/ rpc.service=ECR aws.region=us-east-1 http.request.header.authorization="AWS4-HMAC-SHA256 Credential=ASIA
3NJR/20240112/us-east-1/ecr/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date;x-amz-security-token;x-amz-target, Signature=" http.request.header.x_amz_target=AmazonEC2ContainerRegistry_V20150921.DescribeImages tf_req_id=da7b138c-22b0-543c-dc8b-351a211bfbfb http.flavor=1.1 rpc.method=DescribeImages tf_rpc=ReadDataSource tf_mux_provider="*schema.GRPCProviderServer" @module=aws http.request.header.content_type=application/x-amz-json-1.1 http.request_content_length=60 http.user_agent="APN/1.0 HashiCorp/1.0 Terraform/1.6.6 (+https://www.terraform.io) terraform-provider-aws/5.32.0 (+https://registry.terraform.io/providers/hashicorp/aws) aws-sdk-go/1.49.18 (go1.20.12; linux; amd64)" net.peer.name=api.ecr.us-east-1.amazonaws.com rpc.system=aws-api tf_provider_addr=registry.terraform.io/hashicorp/aws http.request.header.x_amz_security_token="****" tf_aws.sdk=aws-sdk-go http.method=POST
http.request.body=
| {"imageIds":[{"imageTag":"latest"}],"repositoryName":"main"}
http.request.header.x_amz_date=20240112T152026Z tf_data_source_type=aws_ecr_image timestamp=2024-01-12T08:20:26.723-0700
2024-01-12T08:20:26.822-0700 [DEBUG] provider.terraform-provider-aws_v5.32.0_x5: HTTP Response Received: http.response.header.content_type=application/x-amz-json-1.1 http.response.header.x_amzn_requestid=fa35b3d7-7331-4bdd-af7e-186d54097114 http.duration=98 rpc.service=ECR tf_aws.sdk=aws-sdk-go tf_mux_provider="*schema.GRPCProviderServer" tf_rpc=ReadDataSource http.response.header.date="Fri, 12 Jan 2024 15:20:26 GMT" http.response_content_length=203 http.status_code=400 rpc.system=aws-api tf_data_source_type=aws_ecr_image tf_req_id=da7b138c-22b0-543c-dc8b-351a211bfbfb rpc.method=DescribeImages tf_provider_addr=registry.terraform.io/hashicorp/aws @caller=github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2@v2.0.0-beta.47/logger.go:157 @module=aws aws.region=us-east-1
http.response.body=
| {"__type":"ImageNotFoundException","message":"The image with imageId {imageDigest:'null', imageTag:'latest'} does not exist within the repository with name 'main' in the registry with id '058043570872'"}
http.response.header.connection=keep-alive timestamp=2024-01-12T08:20:26.822-0700
2024-01-12T08:20:26.822-0700 [ERROR] provider.terraform-provider-aws_v5.32.0_x5: Response contains error diagnostic: diagnostic_summary="reading ECR Images: ImageNotFoundException: The image with imageId {imageDigest:'null', imageTag:'latest'} does not exist within the repository with name 'main' in the registry with id '058043570872'" tf_data_source_type=aws_ecr_image tf_proto_version=5.4 @caller=github.com/hashicorp/terraform-plugin-go@v0.20.0/tfprotov5/internal/diag/diagnostics.go:62 diagnostic_severity=ERROR tf_provider_addr=registry.terraform.io/hashicorp/aws tf_rpc=ReadDataSource diagnostic_detail="" @module=sdk.proto tf_req_id=da7b138c-22b0-543c-dc8b-351a211bfbfb timestamp=2024-01-12T08:20:26.822-0700
2024-01-12T08:20:26.823-0700 [ERROR] vertex "data.aws_ecr_image.latest" error: reading ECR Images: ImageNotFoundException: The image with imageId {imageDigest:'null', imageTag:'latest'} does not exist within the repository with name 'main' in the registry with id '058043570872'
2024-01-12T08:20:26.823-0700 [ERROR] vertex "data.aws_ecr_image.latest (expand)" error: reading ECR Images: ImageNotFoundException: The image with imageId {imageDigest:'null', imageTag:'latest'} does not exist within the repository with name 'main' in the registry with id '058043570872'
2024-01-12T08:20:26.824-0700 [INFO] backend/local: plan operation completed

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

Error: reading ECR Images: ImageNotFoundException: The image with imageId {imageDigest:'null', imageTag:'latest'} does not exist within the repository with name 'main' in the registry with id '058043570872'

with data.aws_ecr_image.latest,
on main.tf line 13, in data "aws_ecr_image" "latest":
13: data "aws_ecr_image" "latest" {

2024-01-12T08:20:26.959-0700 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2024-01-12T08:20:26.965-0700 [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/hashicorp/aws/5.32.0/linux_amd64/terraform-provider-aws_v5.32.0_x5 pid=611069
2024-01-12T08:20:26.965-0700 [DEBUG] provider: plugin exited

Panic Output

No response

Important Factoids

No response

References

I noticed issue #24526 was closed with this update.

Would you like to implement a fix?

None

@BroMattMiller BroMattMiller added the bug Addresses a defect in current functionality. label Jan 12, 2024
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • 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.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/ecr Issues and PRs that pertain to the ecr service. label Jan 12, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 12, 2024
@justinretzolk
Copy link
Member

Hey @BroMattMiller 👋 Thanks for taking the time to submit this issue. It looks like this is a duplicate of #35263. We like to try to keep discussions consolidated, so we’re going to close this new issue in favor of that one.

Duplicate of #35263

@justinretzolk justinretzolk closed this as not planned Won't fix, can't repro, duplicate, stale Jan 12, 2024
@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label Jan 12, 2024
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 12, 2024
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. service/ecr Issues and PRs that pertain to the ecr service.
Projects
None yet
Development

No branches or pull requests

2 participants