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

"azuread_users" for huge group (~30K) stops after 20 minutes #1174

Open
AlexeyKTS opened this issue Aug 21, 2023 · 0 comments
Open

"azuread_users" for huge group (~30K) stops after 20 minutes #1174

AlexeyKTS opened this issue Aug 21, 2023 · 0 comments

Comments

@AlexeyKTS
Copy link

AlexeyKTS commented Aug 21, 2023

Community Note

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

Terraform (and AzureAD Provider) Version

Terraform 1.5.5
azuread v2.41.0

Affected Resource(s)

azuread_users

Terraform Configuration Files

#Read users from the AAD source group
data "azuread_users" "users" {
  ignore_missing = true
  object_ids = data.azuread_group.source_group.members
  
  timeouts {
    read = "3h"
  }
}

Debug Output

UUID removed:

2023-08-21T21:07:23.1370968Z 2023-08-21T21:07:23.135Z [INFO]  provider.terraform-provider-azuread_v2.41.0_x5: 2023/08/21 21:07:23 [DEBUG] AzureAD Response: 200 OK for <...> (GET https://graph.microsoft.com/beta/users/<userID>): timestamp=2023-08-21T21:07:23.135Z
2023-08-21T21:07:23.1375118Z 2023-08-21T21:07:23.135Z [ERROR] provider.terraform-provider-azuread_v2.41.0_x5: Response contains error diagnostic: diagnostic_summary="Retrieving user with object ID: "<userID>"" tf_data_source_type=azuread_users tf_req_id=<...> @module=sdk.proto diagnostic_severity=ERROR tf_provider_addr=provider tf_rpc=ReadDataSource @caller=github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/internal/diag/diagnostics.go:55 diagnostic_detail="UsersClient.BaseClient.Get(): could not read response body: context deadline exceeded" tf_proto_version=5.3 timestamp=2023-08-21T21:07:23.135Z
2023-08-21T21:07:23.1377514Z 2023-08-21T21:07:23.136Z [ERROR] vertex "data.azuread_users.users" error: Retrieving user with object ID: "<userID>"
2023-08-21T21:07:23.1378931Z 2023-08-21T21:07:23.136Z [ERROR] vertex "data.azuread_users.users (expand)" error: Retrieving user with object ID: "<userID>"
2023-08-21T21:07:23.1380514Z 2023-08-21T21:07:23.136Z [DEBUG] created provider logger: level=debug

Panic Output

Expected Behavior

There is a group about 30K users. Expected behavior is to read all of them.

Actual Behavior

After 20mins pipeline stops and shows next error:

2023-08-21T21:07:23.5394882Z �[31m│�[0m �[0m�[0m  with data.azuread_users.users,
2023-08-21T21:07:23.5395517Z �[31m│�[0m �[0m  on main.tf line 13, in data "azuread_users" "users":
2023-08-21T21:07:23.5395952Z �[31m│�[0m �[0m  13: data "azuread_users" "users" �[4m{�[0m�[0m
2023-08-21T21:07:23.5396303Z �[31m│�[0m �[0m
2023-08-21T21:07:23.5396725Z �[31m│�[0m �[0mUsersClient.BaseClient.Get(): could not read response body: context
2023-08-21T21:07:23.5397164Z �[31m│�[0m �[0mdeadline exceeded

Steps to Reproduce

  1. Create AAD group with 19K users and more
  2. Use azuread_users
  3. terraform plan

Important Factoids

  • Huge AAD group of users (~30k).
  • Always 20 mins and stops.
  • Number of read users always different, but between 18-19k.
  • If ignore_missing = false then error a bit different:
    2023-08-21T19:53:12.8209316Z 2023-08-21T19:53:12.819Z [ERROR] provider.terraform-provider-azuread_v2.41.0_x5: Response contains error diagnostic: tf_proto_version=5.3 tf_req_id=<...> tf_rpc=ReadDataSource @caller=github.com/hashicorp/terraform-plugin-go@v0.14.3/tfprotov5/internal/diag/diagnostics.go:55 @module=sdk.proto diagnostic_detail="UsersClient.BaseClient.Get(): Get "https://graph.microsoft.com/beta/users/<userID>": http: RoundTripper implementation (*retryablehttp.RoundTripper) returned a nil *Response with a nil error" diagnostic_severity=ERROR diagnostic_summary="Retrieving user with object ID: "<userID>"" tf_data_source_type=azuread_users tf_provider_addr=provider timestamp=2023-08-21T19:53:12.819Z
    2023-08-21T19:53:12.8215756Z 2023-08-21T19:53:12.819Z [ERROR] vertex "data.azuread_users.users" error: Retrieving user with object ID: "<userID>"
    2023-08-21T19:53:12.8217218Z 2023-08-21T19:53:12.820Z [ERROR] vertex "data.azuread_users.users (expand)" error: Retrieving user with object ID: "<userID>"
    
  • azuread_users does not react on any value in "timeouts" 5 min or 3 hours always giving 20 mins for run.

References

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

No branches or pull requests

2 participants