You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding user to environment returns: "panic: runtime error"
Adding users by their AAD ID returns "panic: runtime error: index out of range [0] with length 0".
This errors occurs when there is no licenses available on the tenant to add the user.
Sample Terraform Code
If applicable, add terraform code to help explain your problem.
terraform {
required_providers {
powerplatform={
source ="microsoft/power-platform"
}
}
}
provider"powerplatform" {
use_cli=true
}
resource"powerplatform_environment""development" {
display_name="example_environment"description="example environment description"location="europe"azure_region="northeurope"environment_type="Sandbox"cadence="Moderate"dataverse={
language_code ="1033"
currency_code ="USD"
security_group_id ="00000000-0000-0000-0000-000000000000"
}
}
variable"pp_environment_users" {
description="Entra tenant users that will be added to the environment taking entra user object_id"type=map(string)
value={
"user1"="user1_object_id""user2"="user2_object_id"
}
}
#Add users to the Power Platform environmentresource"powerplatform_user""pp_add_users" {
for_each=var.pp_environment_usersenvironment_id=powerplatform_environment.development.idsecurity_roles="e0d2794e-82f3-e811-a951-000d3a1bcf17", // bot authoraad_id=each.valuedisable_delete=falsedepends_on=[time_sleep.wait_pp_environment]
}
Expected behavior
The error should tell the user that there is not licenses available to add the users or suggest to review if there are licenses available to add users.
Define the correct error to show should we change the current error: "panic: runtime error: index out of range [0] with length 0"
System Information
Provider Version: 3.3.0
OS & Version: Linux GitHub Runner
Additional context
Error:
##[debug] powerplatform_user.pp_add_users["user1"]: Still creating... [7m50s elapsed]
##[debug]
##[debug]Set output stderr = ╷
##[debug]│ Error: Plugin did not respond
##[debug]│
##[debug]│ The plugin encountered an error, and failed to respond to the
##[debug]│ plugin6.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
##[debug]│ contain more details.
##[debug]╵
##[debug]╷
##[debug]│ Error: Plugin did not respond
##[debug]│
##[debug]│ The plugin encountered an error, and failed to respond to the
##[debug]│ plugin6.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
##[debug]│ contain more details.
##[debug]╵
##[debug]╷
##[debug]│ Error: Plugin did not respond
##[debug]│
##[debug]│ The plugin encountered an error, and failed to respond to the
##[debug]│ plugin6.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
##[debug]│ contain more details.
##[debug]╵
##[debug]╷
##[debug]│ Error: Plugin did not respond
##[debug]│
##[debug]│ The plugin encountered an error, and failed to respond to the
##[debug]│ plugin6.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
##[debug]│ contain more details.
##[debug]╵
##[debug]╷
##[debug]│ Error: Plugin did not respond
##[debug]│
##[debug]│ The plugin encountered an error, and failed to respond to the
##[debug]│ plugin6.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
##[debug]│ contain more details.
##[debug]╵
##[debug]╷
##[debug]│ Error: Plugin did not respond
##[debug]│
##[debug]│ The plugin encountered an error, and failed to respond to the
##[debug]│ plugin6.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
##[debug]│ contain more details.
##[debug]╵
##[debug]
##[debug]Stack trace from the terraform-provider-power-platform_v3.3.0 plugin:
##[debug]
##[debug]panic: runtime error: index out of range [0] with length 0
##[debug]
Contribution
Do you plan to raise a PR to address this issue? YES.
The text was updated successfully, but these errors were encountered:
Adding user to environment returns: "panic: runtime error"
Adding users by their AAD ID returns "panic: runtime error: index out of range [0] with length 0".
This errors occurs when there is no licenses available on the tenant to add the user.
Sample Terraform Code
If applicable, add terraform code to help explain your problem.
Expected behavior
The error should tell the user that there is not licenses available to add the users or suggest to review if there are licenses available to add users.
Define the correct error to show should we change the current error: "panic: runtime error: index out of range [0] with length 0"
System Information
Additional context
Error:
##[debug] powerplatform_user.pp_add_users["user1"]: Still creating... [7m50s elapsed]
##[debug]
##[debug]Set output stderr = ╷
##[debug]│ Error: Plugin did not respond
##[debug]│
##[debug]│ The plugin encountered an error, and failed to respond to the
##[debug]│ plugin6.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
##[debug]│ contain more details.
##[debug]╵
##[debug]╷
##[debug]│ Error: Plugin did not respond
##[debug]│
##[debug]│ The plugin encountered an error, and failed to respond to the
##[debug]│ plugin6.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
##[debug]│ contain more details.
##[debug]╵
##[debug]╷
##[debug]│ Error: Plugin did not respond
##[debug]│
##[debug]│ The plugin encountered an error, and failed to respond to the
##[debug]│ plugin6.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
##[debug]│ contain more details.
##[debug]╵
##[debug]╷
##[debug]│ Error: Plugin did not respond
##[debug]│
##[debug]│ The plugin encountered an error, and failed to respond to the
##[debug]│ plugin6.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
##[debug]│ contain more details.
##[debug]╵
##[debug]╷
##[debug]│ Error: Plugin did not respond
##[debug]│
##[debug]│ The plugin encountered an error, and failed to respond to the
##[debug]│ plugin6.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
##[debug]│ contain more details.
##[debug]╵
##[debug]╷
##[debug]│ Error: Plugin did not respond
##[debug]│
##[debug]│ The plugin encountered an error, and failed to respond to the
##[debug]│ plugin6.(*GRPCProvider).ApplyResourceChange call. The plugin logs may
##[debug]│ contain more details.
##[debug]╵
##[debug]
##[debug]Stack trace from the terraform-provider-power-platform_v3.3.0 plugin:
##[debug]
##[debug]panic: runtime error: index out of range [0] with length 0
##[debug]
Contribution
Do you plan to raise a PR to address this issue? YES.
The text was updated successfully, but these errors were encountered: