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

oci_identity_user_group_membership destroy failed, returning 500 #2283

Open
jose-pablo-camacho opened this issue Jan 22, 2025 · 2 comments
Open
Labels

Comments

@jose-pablo-camacho
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version and Provider Version

Terraform v1.5.7
+ provider registry.terraform.io/oracle/oci v6.21.0

Affected Resource(s)

oci_identity_user_group_membership

Terraform Configuration Files

N/A

Debug Output

module.module.oci_identity_user_group_membership.user_to_group: Still destroying... [id=<id>, 2m0s elapsed]
╷
│ Error: Error returned by Identity Service. Http Status Code: 500. Error Code: InternalServerError. Opc request id: <request_id>. Message: Internal Service Error, please try again
│ Operation Name: GetUserGroupMembership
│ Timestamp: 2025-01-22 16:25:53 +0000 GMT
│ Client Version: Oracle-GoSDK/65.81.1
│ Request Endpoint: GET https://identity.ap-sydney-1.oci.oraclecloud.com/20160918/userGroupMemberships/ocid1.groupmembership.oc1..aaaaaaaag6b73qhi5itwhwrf2vwswiahfk7lfz6hrm4ylkyv7yi3aksm3gda
│ Troubleshooting Tips: See https://docs.oracle.com/iaas/Content/API/References/apierrors.htm#apierrors_500__500_internalservererror for more information about resolving this error.
│ Also see https://docs.oracle.com/iaas/api/#/en/identity/20160918/UserGroupMembership/GetUserGroupMembership for details on this operation's requirements.
│ To get more info on the failing request, you can set OCI_GO_SDK_DEBUG env var to info or higher level to log the request/response details.
│ If you are unable to resolve this Identity issue, please contact Oracle support and provide them this full error message.

Panic Output

N/A

Expected Behavior

The oci_identity_user_group_membership resource should have been successfully deleted. Basically when running the terraform destroy the resource keeps in the Sill destroying state:

module.module.oci_identity_user_group_membership.user_to_group: Still destroying... [id=ocid1.groupmembership.oc1..aaaaaaaag6b7...rf2vwswiahfk7lfz6hrm4ylkyv7yi3aksm3gda, 1m50s elapsed]

After this, a 500 error is returned by the API. This looks just fine because within the OCI console I can see that the user and group are no longer related which looks like the actual destroy happened

Actual Behavior

However I can see the oci_identity_user_group_membership resource is kept within the state file. Leading this to a 500 every time I try to destroy this. Since the oci_identity_user_group_membership resource is already gone, I expect this to be removed from the statefile too.

Steps to Reproduce

resource "oci_identity_group" "test_group" {
name = "TestGroup"
description = "Test Group"
compartment_id = "tenancy"
}

resource "oci_identity_user" "test_user" {
name = "TestUser"
description = "Test User"
compartment_id = "tenancy"
email = "email"
}

resource "oci_identity_user_group_membership" "user_to_group" {
user_id = oci_identity_user.test_user.id
group_id = oci_identity_group.test_group.id
}

  1. terraform apply
  2. terraform destroy

Important Factoids

It's happening for different regions, I have tested us-sanjose-1 and ap-sydney-1 confirming same behavior.

References

@atillaqb
Copy link

I also have similar problem.

Error: 500-InternalError, Internal Service Error, please try again
│ Suggestion: The service for this resource encountered an error. Please contact support for help with service: Identity User Group Membership
│ Documentation: https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/identity_user_group_membership 
│ API Reference: https://docs.oracle.com/iaas/api/#/en/identity/20160918/UserGroupMembership/GetUserGroupMembership 
│ Request Target: GET https://identity.eu-frankfurt-1.oci.oraclecloud.com/20160918/userGroupMemberships/ocid1.groupmembership.oc1..aaaaaaaaqmbtrwqj42fps6fzmsmtkexlfn4ly4pjh7mqiowwvwb5t334rgxq 
│ Provider version: 6.11.0, released on 2024-09-24. This provider is 17 Update(s) behind to current. 
│ Service: Identity User Group Membership 
│ Operation Name: GetUserGroupMembership 
│ OPC request ID: 

@jose-pablo-camacho
Copy link
Author

Is there any update on this? Or is there any workaround? I don't think using a terraform state rm command is the best approach.

This is currently blocking some automated tests.

Thanks in advance!

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

No branches or pull requests

2 participants