passbolt/passbolt_api · error · Cake\Http\Exception\NotFoundException

The folder does not exist.

Error message

The folder does not exist.

What it means

A NotFoundException from FoldersUpdateService::getFolder, thrown when no permission row can be found linking the given folder id to the acting user. Although the message says 'The folder does not exist.', the actual check is on the user's highest permission for the folder: from the acting user's point of view the folder is invisible/nonexistent. This keeps folder existence hidden from unauthorized users.

Solutions

  1. Verify the folder id is a valid, existing folder visible to the acting user (GET /folders).
  2. Have an owner share the folder with the user first; then retry the update.
  3. Check you are authenticated as the intended user (UAC) and not a different/admin-less account.
  4. If the folder was deleted, recreate it or use a different target folder.
Defensive patterns

Strategy: validation

Validate before calling

// Confirm the folder is visible to the current user before updating
const folders = await api.get('/folders', { params: { 'filter[search]': folderId } });
if (!folders.some(f => f.id === folderId)) {
  throw new Error(`Folder ${folderId} not found or not accessible for this user`);
}

Try / catch

try {
  await foldersApi.update(folderId, data);
} catch (e) {
  if (e.response?.status === 404) {
    // folder missing or hidden from this user: verify id and sharing
  }
  throw e;
}

Prevention

When it happens

Trigger: PUT /folders/{folderId} (FoldersUpdateService::update) with a folder id the user has no permission row for — folder does not exist, is deleted, or belongs to other users who never shared it with the caller; also invalid/unknown folder UUIDs.

Common situations: Typos or stale ids in scripts after a folder was deleted; a user attempts to rename a folder shared only with a teammate; integration tests reusing folder ids from another account's fixture data.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of passbolt/passbolt_api@31c1bbc10f (2026-09-17). Data as JSON: /api/errors/a1a683a348394b41. Report an issue: GitHub.

Appendix: source

Thrown at plugins/PassboltCe/Folders/src/Service/Folders/FoldersUpdateService.php:105

    }

    /**
     * Retrieve the folder.
     *
     * @param \App\Utility\UserAccessControl $uac UserAccessControl updating the resource
     * @param string $folderId The folder identifier to retrieve.
     * @return \Passbolt\Folders\Model\Entity\Folder
     * @throws \Cake\Http\Exception\NotFoundException If the folder does not exist.
     */
    private function getFolder(UserAccessControl $uac, string $folderId): Folder
    {
        /** @var \App\Model\Entity\Permission|null $permission */
        $permission = $this->permissionsTable
            ->findHighestByAcoAndAro(PermissionsTable::FOLDER_ACO, $folderId, $uac->getId())
            ->first();

        if (empty($permission)) {
            throw new NotFoundException(__('The folder does not exist.'));
        } elseif ($permission->type < Permission::UPDATE) {
            throw new ForbiddenException(__('You are not allowed to update this folder.'));
        }

        return $this->foldersTable->get($folderId);
    }

    /**
     * Update folder meta.
     *
     * @param \App\Utility\UserAccessControl $uac The current user
     * @param \Passbolt\Folders\Model\Entity\Folder $folder The folder to update.
     * @param \Passbolt\Metadata\Model\Dto\MetadataFolderDto $folderDto The folder dto.
     * @return \Cake\Datasource\EntityInterface|\Passbolt\Folders\Model\Entity\Folder
     */
    private function updateFolderMeta(
        UserAccessControl $uac,
        Folder $folder,

View on GitHub (pinned to 31c1bbc10f)