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]: │ This is a bug in the provider, which should be reported in the provider's own issue tracker. #38461

Closed
chrisolido opened this issue Jul 22, 2024 · 11 comments · Fixed by #38471
Assignees
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/ecs Issues and PRs that pertain to the ecs service.
Milestone

Comments

@chrisolido
Copy link

Terraform Core Version

0.9.1

AWS Provider Version

5.59.0

Affected Resource(s)

Circle CI

Expected Behavior

Should run the release smoothly

Actual Behavior


│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

Exited with code exit status 1

Relevant Error/Panic Output Snippet

│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.


│ Error: Provider produced inconsistent final plan

│ When expanding the plan for module.crs.aws_ecs_task_definition.taskDefinition to include new values learned so far during apply

Terraform Configuration Files


│ This is a bug in the provider, which should be reported in the provider's own issue tracker.


│ Error: Provider produced inconsistent final plan

│ When expanding the plan for module.crs.aws_ecs_task_definition.taskDefinition to include new values learned so far during apply

Steps to Reproduce


│ This is a bug in the provider, which should be reported in the provider's own issue tracker.


│ Error: Provider produced inconsistent final plan

│ When expanding the plan for module.crs.aws_ecs_task_definition.taskDefinition to include new values learned so far during apply

Debug Output


│ This is a bug in the provider, which should be reported in the provider's own issue tracker.


│ Error: Provider produced inconsistent final plan

│ When expanding the plan for module.crs.aws_ecs_task_definition.taskDefinition to include new values learned so far during apply

Panic Output


│ This is a bug in the provider, which should be reported in the provider's own issue tracker.


│ Error: Provider produced inconsistent final plan

│ When expanding the plan for module.crs.aws_ecs_task_definition.taskDefinition to include new values learned so far during apply

Important Factoids


│ This is a bug in the provider, which should be reported in the provider's own issue tracker.


│ Error: Provider produced inconsistent final plan

│ When expanding the plan for module.crs.aws_ecs_task_definition.taskDefinition to include new values learned so far during apply

References


│ This is a bug in the provider, which should be reported in the provider's own issue tracker.


│ Error: Provider produced inconsistent final plan

│ When expanding the plan for module.crs.aws_ecs_task_definition.taskDefinition to include new values learned so far during apply

Would you like to implement a fix?

None

@chrisolido chrisolido added the bug Addresses a defect in current functionality. label Jul 22, 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.

@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label Jul 22, 2024
@jared-rowe
Copy link

Same issue here with aws_ecs_task_definition

Terraform Core Version
1.9.2

AWS Provider Version
5.59.0

Error:

Error: Provider produced inconsistent final plan
When expanding the plan for aws_ecs_task_definition.<the_task> to include new
values learned so far during apply, provider
"registry.terraform.io/hashicorp/aws" produced an invalid new value for
.container_definitions: inconsistent values for sensitive attribute.
This is a bug in the provider, which should be reported in the provider's own
issue tracker.

Resolved by pinning AWS provider to 5.58.0

@ewbankkit ewbankkit added regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/ecs Issues and PRs that pertain to the ecs service. and removed needs-triage Waiting for first response or review from a maintainer. labels Jul 22, 2024
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Jul 22, 2024
@ewbankkit
Copy link
Contributor

Relates #38016.

@ewbankkit
Copy link
Contributor

@chrisolido @jared-rowe Thanks for reporting this issue 👏.
A couple of questions to help with a quick resolution:

  • Are you seeing these errors when creating completely new task definitions or when planning/applying updates to existing (pre-v5.59.0) resources?
  • Can you share the container_definitions configuration (as much as possible) that is causing the problem?

@ewbankkit ewbankkit added the waiting-response Maintainers are waiting on response from community or contributor. label Jul 22, 2024
@cdsre
Copy link

cdsre commented Jul 22, 2024

@ewbankkit We are seeing it on new deployments. during the apply it doesnt show a container task definition in the resource

  # module.container_ui[0].aws_ecs_task_definition.this will be created
  + resource "aws_ecs_task_definition" "this" {
      + arn                      = (known after apply)
      + arn_without_revision     = (known after apply)
      + cpu                      = "256"
      + execution_role_arn       = (known after apply)
      + family                   = "example"
      + id                       = (known after apply)
      + memory                   = "512"
      + network_mode             = "awsvpc"
      + requires_compatibilities = [
          + "FARGATE",
        ]
      + revision                 = (known after apply)
      + skip_destroy             = false
      + tags                     = {
          + "Name" = "example"
        }
      + tags_all                 = {
          + "Environment"     = "development"
          + "EnvironmentName" = "DW037"
          + "Name"            = "example"
          + "Owner"           = "example"
          + "Pipeline"        = "https://example.com/devops-terraform-modules/example/-/pipelines/130717"
          + "Terraform"       = "true"
        }
      + task_role_arn            = (known after apply)
      + track_latest             = false
    }

If we replay this CI job, then it does go ahead and redeploy the resources successfully and the apply shows the container_defs on the second run

# module.container_ui[0].aws_ecs_task_definition.this will be created
  + resource "aws_ecs_task_definition" "this" {
      + arn                      = (known after apply)
      + arn_without_revision     = (known after apply)
      + container_definitions    = jsonencode(
            [
              + {
                  + Command                = null
                  + Cpu                    = 0
                  + CredentialSpecs        = null
                  + DependsOn              = null
                  + DisableNetworking      = null
...
...
...
                 + VolumesFrom            = null
                  + WorkingDirectory       = null
                },
            ]
        )
      + cpu                      = "256"
...

In our case the error was

╷
│ Error: Provider produced inconsistent final plan
│ 
│ When expanding the plan for
│ module.container_ui[0].aws_ecs_task_definition.this to include new values
│ learned so far during apply, provider "registry.terraform.io/hashicorp/aws"
│ produced an invalid new value for .container_definitions: was
│ cty.StringVal(""), but now
│ cty.StringVal("[{\"Command\":null,\"Cpu\":0,\"CredentialSpecs\":null,\"DependsOn\":null,\"DisableNetworking\":null,\"DnsSearchDomains\":null,\"DnsServers\":null,\"DockerLabels\":null,\"DockerSecurityOptions\":null,\"EntryPoint\":null
...
...
\"StopTimeout\":null,\"SystemControls\":null,\"Ulimits\":null,\"User\":null,\"VolumesFrom\":null,\"WorkingDirectory\":null}]").
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.
╵

@jared-rowe
Copy link

jared-rowe commented Jul 22, 2024

Hi

@chrisolido @jared-rowe Thanks for reporting this issue 👏. A couple of questions to help with a quick resolution:

  • Are you seeing these errors when creating completely new task definitions or when planning/applying updates to existing (pre-v5.59.0) resources?
  • Can you share the container_definitions configuration (as much as possible) that is causing the problem?

Hi @ewbankkit - thanks for jumping on this quickly.

Errors are occurring with new deployments creating new task definitions with v5.59.0.
Task definition with container definition (resource names, env vars, etc. have been generalised) looks like:

resource "aws_ecs_task_definition" "this" {
  family                   = "example-family"
  network_mode             = "awsvpc"
  requires_compatibilities = ["FARGATE"]
  cpu                      = 1024
  memory                   = 4096
  execution_role_arn       = aws_iam_role.task_execution.arn

  container_definitions = jsonencode([
    {
      name  = local.container_name
      image = local.image
      portMappings = [
        {
          containerPort = 1234,
          hostPort      = 1234
        }
      ]
      environment = [
        {
          name  = "example1"
          value = "123"
        },
        {
          name  = "example2"
          value = "456"
        },
        {
          name  = "example3"
          value = "789"
        }
      ]
      secrets = [
        {
          name      = "example4"
          valueFrom = aws_ssm_parameter.secret_launch_code.arn
        }
      ]
      logConfiguration = {
        logDriver = "awslogs"
        options = {
          "awslogs-group"         = aws_cloudwatch_log_group.task_logs.name
          "awslogs-region"        = data.aws_region.current.name
          "awslogs-stream-prefix" = "ecs"
        }
      }
    }
  ])
}

@aldenbe
Copy link

aldenbe commented Jul 23, 2024

@chrisolido @jared-rowe Thanks for reporting this issue 👏. A couple of questions to help with a quick resolution:

  • Are you seeing these errors when creating completely new task definitions or when planning/applying updates to existing (pre-v5.59.0) resources?
  • Can you share the container_definitions configuration (as much as possible) that is causing the problem?

See #38482 which I closed as duplicate, this issue was introduced in version v5.59.0 downgrading to v5.58.0 works as expected.

@thomaszlow
Copy link

@aldenbe You made my week! Downgrading to v5.58.0 also worked for my new task deployments.

I did a lot of debugging the last days to find out what is causing the issue but couldn't find anything.
My first thought was that a line break in the healthCheck is the problem because it is marked in the Actions log as an error but removing all healtChecks didn't solve it.

image

@ewbankkit
Copy link
Contributor

ewbankkit commented Jul 23, 2024

@jared-rowe Thanks for your example configuration -- we can reproduce the issue with it.

@ewbankkit ewbankkit self-assigned this Jul 23, 2024
Copy link

Warning

This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

@github-actions github-actions bot added this to the v5.60.0 milestone Jul 23, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Jul 25, 2024
Copy link

This functionality has been released in v5.60.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. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/ecs Issues and PRs that pertain to the ecs service.
Projects
None yet
6 participants