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

Terraform Elastic Beanstalk Application: Provider produced inconsistent result after apply #21012

Closed
bolanlesd opened this issue Sep 23, 2021 · 10 comments
Labels
bug Addresses a defect in current functionality. question A question about existing functionality; most questions are re-routed to discuss.hashicorp.com. service/elasticbeanstalk Issues and PRs that pertain to the elasticbeanstalk service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.

Comments

@bolanlesd
Copy link

bolanlesd commented Sep 23, 2021

I get this error when i try to use the resource "aws_elastic_beanstalk_application"

│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to aws_elastic_beanstalk_application.default,
│ provider "provider[\"registry.terraform.io/hashicorp/aws\"]" produced an
│ unexpected new value: Root resource was present, but now absent.
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.
╵

Can I get help with this please?

To Reproduce:

resource "aws_elastic_beanstalk_application" "tftest" {
  name        = "tf-test-name"
  description = "tf-test-desc"

  appversion_lifecycle {
    service_role          = aws_iam_role.beanstalk_service.arn
    max_count             = 128
    delete_source_from_s3 = true
  }
}
@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. bug Addresses a defect in current functionality. service/elasticbeanstalk Issues and PRs that pertain to the elasticbeanstalk service. labels Sep 23, 2021
@anGie44 anGie44 added question A question about existing functionality; most questions are re-routed to discuss.hashicorp.com. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 23, 2021
@anGie44
Copy link
Contributor

anGie44 commented Sep 23, 2021

Hi @bolanlesd , thank you for raising this issue. To further investigate, do you mind providing more details regarding which provider version you are working with, as well as the complete configuration?

@anGie44 anGie44 added the waiting-response Maintainers are waiting on response from community or contributor. label Sep 23, 2021
@github-actions github-actions bot removed the waiting-response Maintainers are waiting on response from community or contributor. label Sep 23, 2021
@bolanlesd
Copy link
Author

bolanlesd commented Sep 24, 2021

Hello @anGie44 , thank you for your response:

registry.terraform.io/hashicorp/aws, i used v3.57.0 and v3.59.0

As for the complete configuration, let me break it down, perhaps this is what you mean? (But i only have just that one resource)

main.tf:

resource "aws_elastic_beanstalk_application" "default" {
name = "test1"
description = "tf-test-desc"

appversion_lifecycle {
service_role = "arn:aws:iam::XXXXXXXX:role/aws-elasticbeanstalk-service-role"
max_count = 128
delete_source_from_s3 = true
}
}

I am using Terragrunt configuration on my terraform.

If this info is not what you need, please let me know. Or do you want me to attach the TF_LOG file during my apply?

@bolanlesd
Copy link
Author

bolanlesd commented Sep 28, 2021

Hello,

Is there any update that can help with this issue please? I have not been able to resolve it yet.

Also please see attached a TF_Log file. I hope it helps.

Regards
log-for-review.txt

@anGie44
Copy link
Contributor

anGie44 commented Sep 29, 2021

Hi @bolanlesd , no updates from me atm :/ I'm not able to reproduce this on my end but I do see the error in the text file attached in your previous comment; terraform successfully creates the resource but when it goes to find the application via an API request DescribeApplications to the AWS service it's not found for some reason. Are you able to share the IAM service role configuration as well?

@bolanlesd
Copy link
Author

Thanks for the prompt response @anGie44 !
Please see the JSON policies attached to the service role used for the deployment.

AWSElasticBeanstalkEnhancedHealth.txt
AWSElasticBeanstalkManagedUpdatesCustomerRolePolicy.txt

@vrajendra
Copy link

I can reproduce the error, this happens when apply however plan is successfull.

aws_elastic_beanstalk_application.default: Creating...
aws_elastic_beanstalk_application.default: Still creating... [10s elapsed]
aws_elastic_beanstalk_application.default: Still creating... [20s elapsed]
aws_elastic_beanstalk_application.default: Still creating... [30s elapsed]

│ Error: Provider produced inconsistent result after apply

│ When applying changes to aws_elastic_beanstalk_application.default,
│ provider "provider["registry.terraform.io/hashicorp/aws"]" produced an
│ unexpected new value: Root resource was present, but now absent.

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

Releasing state lock. This may take a few moments...
ERRO[0043] Hit multiple errors:
Hit multiple errors:
exit status 1

@vrajendra
Copy link

Hi @anGie44
I have further checked the aws console and the application still gets creating while the terraform errors out. it creates after some time. So what I have found is the provider is exiting in 30 secs while the application is still creating . can this be resolved by putting a loop in the code till the application gets created. I found a similar issue and fix here

@HariSankaranarayanan
Copy link

HariSankaranarayanan commented Oct 5, 2021

Hi All,
Even I am facing the exact issue as @bolanlesd , I can see for similar issues in other AWS services, for which there was a bug-fix released in upcoming release. Is there any plan or resolution for this issue?

@github-actions
Copy link

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Sep 25, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 26, 2023
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 Nov 26, 2023
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. question A question about existing functionality; most questions are re-routed to discuss.hashicorp.com. service/elasticbeanstalk Issues and PRs that pertain to the elasticbeanstalk service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.
Projects
None yet
Development

No branches or pull requests

4 participants