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] Error on elastistack_elasticsearch_security_user on TF apply after upgrading to v8 Elastic #101

Closed
RyanHealey1307 opened this issue Apr 26, 2022 · 1 comment · Fixed by #106
Labels
bug Something isn't working Elasticsearch Elasticsearch related APIs

Comments

@RyanHealey1307
Copy link

Describe the bug
After upgrading from Elastic v7.17.3 > v8.1.1, when running an apply on a custom module which uses the Elasticstack provider, the resource elastistack_elasticsearch_security_user generates the following error message: Error : Unable to find a user in the cluster..
For context, the user existed when we were on V7.17.3, and it was lost as part of the upgrade. We had not seen this error before.

Remediation
In order to resolve the issue, we had to manually re-create the security user in the Elastic console, then when I subsequently ran a plan and apply, Terraform was able to see the user and the apply was successful.
I would expect Terraform to be able to see the drift in state and real-world, such that the user had been deleted as part of the V8.1.1 upgrade, and subsequently force a replacement. Instead of giving us the error message above.

Debug output

Error : Unable to find a user in the cluster. 
…in resource "elastistack_elasticsearch_security_user" "user":
  1: resource  "elastistack_elasticsearch_security_user" "user" {
Unable to get user: 'user-XXX' from the cluster.

Versions:

  • Terraform Version 1.0.8
  • Provider version 0.3.3
  • Elasticsearch Version 8.1.1

If you require further information, please @ me in the comments. Thanks

@RyanHealey1307 RyanHealey1307 added the bug Something isn't working label Apr 26, 2022
@olksdr olksdr added the Elasticsearch Elasticsearch related APIs label May 4, 2022
@RyanHealey1307
Copy link
Author

Still seeing this behaviour. One of our environments had to be rebuilt, upon applying the terraform after rebuild (where the user had been lost), it errored with "Unable to find a user in the cluster." rather than detecting the user does not exist / has been deleted and therefore creating a new one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Elasticsearch Elasticsearch related APIs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants