Quick question - is there a known limit on role pe...
# general
s
Quick question - is there a known limit on role permissions for API updates? We're getting 500 errors when updating a role with 44 permissions via Terraform provider v0.0.22. Creating it works fine, manual UI updates work fine, but API updates fail consistently. Any known workarounds or is this something that needs a fix?
p
Hey, thanks for reaching out ! It seems our team is a little busy right now, a human will be with you within the next hour or so. In the meantime, can I help you ?
o
1. There is no known limit. 2. Terraform and the UI use the same API 3. Does it work with the API directly? 4. might be a bug in the Terraform provider 5. Please share workspace/project/env 6. Please share logs 7. Please share the terraform script you're running 8. Please future questions in #C02RTML2WNN
s
Thanks for the quick response! Here are the details: Workspace/Project/Environment: - Organization ID: 05740287397a4c198e1d888fa407a265 - Project ID: 4284f24fd7954e54927f4fb39e5aa15a - Environment ID: 409481da318449a48afc96788ddde791 - Resource: keyholdergroup (ID: 5471be35f55d4c94a7898013dafbe2f2) - Role: locksmith (ID: 41939f5323ec4179a32e8a5aa3cf597e) Terraform Configuration: - Provider:
permitio/permit-io
(declared ~> 0.0.1, installed v0.0.22) - Terraform version: 1.8.5 - Provider timeout: 600s The role definition: - Resource key: "keyholdergroup" - Role key: "locksmith" - Permissions: 39 actions (each action maps to multiple roles) - Total role grants: ~44 permissions Error message: Error: Unable to update role with module.keyholdergroup.permitio_role.main["locksmith"], on .terraform\modules\keyholdergroup\permitio\permission_resource\main.tf line 20 unable to update role: ErrorCode: UnexpectedError, ErrorType: general_error, Message: 500 Internal Server Error What we've tested:
terraform plan
- succeeds every time Creating role fresh with
-replace
flag - works Manual updates via UI - works fine Other smaller roles via Terraform - update successfully Updating locksmith role via Terraform apply - fails with 500 Terraform script snippet: ```hcl # From the module: permission_resource/main.tf resource "permitio_role" "main" { for_each = local.resource_roles key = each.value.key name = each.value.name permissions = each.value.permissions resource = permitio_resource.main.key }
e
Hey @Sani Daba, Thanks for the detailed report, we were able to reproduce the issue on our end. This turned out to be a bug in our backend API. The PATCH endpoint for resource-scoped roles returns 500 when updating a large permission set. We already have a PR to fix it on the backend, which will be deployed next week. In the meantime, we've also pushed a workaround in the Terraform provider that avoids hitting this bug entirely. I'll let you know here once the new provider version is released, should be in the next few minutes. Thanks for flagging this!
Hey @Sani Daba, we've just released v0.0.23 of the Terraform provider with the fix. Please upgrade and let us know if it resolves the issue on your end.
❤️ 1
s
Hey @Eli Moshkovich , Upgraded to v0.0.23 and can confirm it fixes the issue! Tested both adding and removing permissions from the locksmith role works perfectly now via Terraform. Thanks for the incredibly fast response and fix!
💜 2
t
@Sani Daba it's our pleasure! Also, a quick note: in the future, please post these issues in your private channel (preferred) or #C02RTML2WNN
✅ 1