The 1.0.2 release notes tell administrators of upgraded servers to add the new permissions (sysEncryption*, sysExternalPublicKey*, sysSmimeTrustAnchor*, taskExternalPublicKeyMaintenance) to the System Administrator role with x:Role/set, called as admin:PASSWORD. On our upgraded server, no account with the System Administrator role can do this. Only the fallback admin (STALWART_RECOVERY_ADMIN) can. Update to v1.0.2 (in Questions) reports the same problem. This report adds two points not covered there: the WebUI picker, and a stale permission cache.
Expected Behavior
The procedure in the release notes works for the server administrator. Better: the upgrade adds new permissions to the default System Administrator role itself. Docs: Roles | Stalwart
Actual Behavior
x:Role/set as the admin account fails with forbidden. This happens with the API key and with the account password.
In the WebUI (Management → Directory → Roles → System Administrator), the Enabled Permissions picker does not offer the new permissions. A search for “encryption” finds nothing.
Only the fallback admin succeeds. The release notes write admin:PASSWORD, which is correct only because our fallback admin has the login name admin. The admin account signs in with its email address. With the account password, the login admin fails with Fallback admin authentication failed.
After the change, the node that processed x:Role/set kept the API key’s old permissions, and x:Encryption/get with that key returned forbidden there. The other two nodes returned the settings at once. x:Action/set with InvalidateCaches on that node fixed it. The roles docs say a Role change needs no action when a coordinator is configured.
Reproduction Steps
Upgrade a 1.0.1 server to 1.0.2.
Find the admin role with x:Authentication/get. It is the id in defaultAdminRoleIds that is not User.
Sign in as an account with the User + System Administrator roles, and send the x:Role/set from the release notes.
Send the same call as the fallback admin. It succeeds.
On the node that processed step 4, call x:Encryption/get with an API key of the admin account. It returns forbidden until InvalidateCaches runs on that node.
Relevant Log Output
“notUpdated”: {“e”: {“type”: “forbidden”, “description”: “You are not authorized to grant permissions: taskExternalPublicKeyMaintenance, sysSmimeTrustAnchorQuery, sysSmimeTrustAnchorDestroy, sysSmimeTrustAnchorUpdate, sysSmimeTrustAnchorCreate and 8 more”}}
[“x:Encryption/get”, {“type”:“forbidden”,“description”:“You are not authorized to perform this action”}] (node that ran x:Role/set, before InvalidateCaches)
Stalwart Version
v1.x
Installation Method
Binary (Linux)
Database Backend
FoundationDB
Blob Storage
S3-compatible
Search Engine
Meilisearch
Directory Backend
Internal
Additional Context
3 nodes, NATS coordinator, Redis Cluster as the in-memory store. The role change went to one node over HTTPS through Caddy. Mail clients are not involved.
I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.
on
I have searched this support forum (open and closed topics) and confirm this is not a duplicate.
on
I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.
The forbidden result is the documented anti-escalation rule, not something specific to your setup. The WebUI picker and the stale cache aren’t covered in the docs I found.
Why only the fallback admin succeeds. Any change to an account, and as far as I can tell to a role, requires the caller to hold every permission it is granting. The docs say the rule “has no exception for superusers”. On an upgraded server the System Administrator role doesn’t yet contain sysEncryption*, sysExternalPublicKey*, sysSmimeTrustAnchor* or taskExternalPublicKeyMaintenance. An account with that role therefore can’t grant them to the role, and the 13 missing permissions in your error match this. The fallback admin (STALWART_RECOVERY_ADMIN) isn’t bound by the role’s contents, so it can make the change. That matches what you saw. The rule is described here: Permissions | Stalwart
The admin:PASSWORD login problem follows from the same split. The fallback admin authenticates under its own login name, while your directory admin account signs in with its email address. I read this as a gap in the release note’s wording, not something you did wrong.
WebUI picker. I couldn’t confirm from the docs why the picker doesn’t list the new permissions. It may be the same restriction, with the picker only offering permissions the signed-in account holds. That is a guess, not something I verified.
Stale cache. I found nothing in the roles docs about cache invalidation. The roles page doesn’t mention the coordinator behaviour you quote. Your x:Action/set with InvalidateCaches workaround is therefore not something I can confirm or explain.
Workaround. Run the release-note x:Role/set as the fallback admin, with its actual login name and password. Then run InvalidateCaches on the node that processed the change if its permissions look stale.
Whether the upgrade should add these permissions to the default role itself is a question for a human to follow up on.
This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.
The stale permissions on that one node were a bug. Your admin account gets its roles through the default admin role set (roles: Admin), not through a direct link to the role, and the cache invalidation after a Role change only reached accounts linked to the role. So every node kept the access token it had already built for that account; the other two just hadn’t cached one yet. A change to any default role, or to a role nested inside one, now drops the cached tokens on every node. The fix ships in the next weekly Stalwart release, and until then InvalidateCaches on the node is the right workaround.
The forbidden from x:Role/set comes from the grant rule: an account can only give out permissions it holds itself (Granting permissions to other accounts). After the upgrade no regular account holds the 13 new permissions, so only the recovery admin, which isn’t bound by that rule, can add them to the System Administrator role. The admin:PASSWORD in the release notes meant the recovery admin’s credentials, and the notes should have said so. The WebUI picker follows the same rule and lists only the permissions the signed-in account holds, which is why searching for “encryption” found nothing.
For future upgrades, the next release adds an environment variable, STALWART_UPDATE_ROLE_PERMISSIONS. Set it to true on one node and restart that node once. At startup the server adds to each default role the permissions introduced since 1.0.0 that a fresh install would give it, skipping anything in the role’s disabledPermissions. Remove the variable afterwards, because while it’s set every start re-adds a permission you took out on purpose. Your roles already have the new permissions, so you won’t need it this time.