passbolt/passbolt_api · error · Cake\Http\Exception\NotFoundException
The resource does not exist.
Error message
The resource does not exist.
What it means
ResourcesAfterAccessRevokedService.getResource fetches the resource with the folderizable finder for the affected user; a RecordNotFoundException is converted into NotFoundException 'The resource does not exist.' It is raised while removing the resource from users' personal folder trees after access is revoked. Same shape as error 61 but on the revoke path.
Solutions
- Verify the resource id still exists before revoking access; refresh share data in the client.
- Treat this as benign in event-replay contexts: if the resource is gone, the tree entry is already gone — skip rather than retry.
- Check for concurrent delete/revoke races in the client workflow and serialize them.
- If it persists for an existing resource, inspect the user's permissions and FolderizableBehavior finder conditions.
Defensive patterns
Strategy: try-catch
Validate before calling
const exists = resources.some(r => r.id === resourceId); if (!exists) return; // already gone, nothing to revoke
Try / catch
try { await revokeAccess(resourceId, aros); } catch (e) { if (e.response?.status === 404) return; // idempotent no-op
throw e; } Prevention
- Treat revoke-of-deleted-resource as an idempotent success in clients and jobs.
- Serialize delete and share/revoke operations to avoid races.
- In background event replay, check resource existence before processing.
- Keep UI permission lists in sync after deletions.
When it happens
Trigger: Revoking user/group access to a resource when the resource was deleted before the revoke event is processed, the id in the event is stale, or the folderizable finder excludes the resource for that user.
Common situations: Deleting a resource while a share-revoke is in flight; bulk group-permission changes referencing resources removed earlier; background jobs replaying old permission-change events.
Understand the failure class
Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.
Related errors
- The folder does not exist.
- The resource does not exist.
- The resource does not exist.
- The resource does not exist.
- Could not validate move data.
AI-assisted analysis of passbolt/passbolt_api@31c1bbc10f (2026-09-17).
Data as JSON: /api/errors/7891028c23d81144.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/PassboltCe/Folders/src/Service/Resources/ResourcesAfterAccessRevokedService.php:104
/**
* Retrieve the resource.
*
* @param \App\Utility\UserAccessControl $uac UserAccessControl updating the resource
* @param string $resourceId The resource identifier to retrieve.
* @return \App\Model\Entity\Resource
* @throws \Cake\Http\Exception\NotFoundException If the resource does not exist.
*/
private function getResource(UserAccessControl $uac, string $resourceId): Resource
{
try {
return $this->Resources->get(
$resourceId,
finder: FolderizableBehavior::FINDER_NAME,
user_id: $uac->getId()
);
} catch (RecordNotFoundException $e) {
throw new NotFoundException(__('The resource does not exist.'));
}
}
/**
* Remove a resource from a group of users trees.
*
* @param \App\Model\Entity\Resource $resource The target resource
* @param string $groupId The target group
* @return void
* @throws \Exception
*/
private function removeResourceFromGroupUsersTrees(Resource $resource, string $groupId): void
{
$grousUsersIds = $this->GroupsUsers->findByGroupId($groupId)
->all()
->extract('user_id')
->toArray();
foreach ($grousUsersIds as $groupUserId) {View on GitHub (pinned to 31c1bbc10f)