passbolt/passbolt_api · warning · NotFoundException

The resource does not exist.

Error message

The resource does not exist.

What it means

A 404 NotFoundException thrown when ResourcesTable::findView() (scoped to the requesting user's ID and the given resource UUID) returns no row. Either the resource does not exist or it exists but the user has no permission to view it — the API deliberately does not distinguish the two to avoid leaking resource existence.

Solutions

  1. Re-fetch the resource index to confirm whether the resource is still visible to you.
  2. Ask the resource owner to share the resource or restore your group membership.
  3. Purge stale client caches/links pointing at deleted resources.
  4. Double-check you are pointing at the intended passbolt instance/account.

Example fix

// before
const r = await api.get(`/resources/${id}.json`); // throws 404 unhandled
// after
try {
  const r = await api.get(`/resources/${id}.json`);
} catch (e) {
  if (e.status === 404) {
    await refreshResourceIndex(); // resource gone or no access
    return null;
  }
  throw e;
}
Defensive patterns

Strategy: try-catch

Try / catch

try { const r = await api.get(`/resources/${id}.json`); } catch (e) { if (e.status === 404) { refreshIndex(); return null; } throw e; } // 404 = gone or no access

Prevention

When it happens

Trigger: GET /resources/{uuid}.json where the UUID is valid but the resource was deleted (soft-deleted), never existed, or the user has no permission record (direct or group-inherited) granting access.

Common situations: Stale bookmarks/links to deleted resources, sharing revoked by an owner, group membership removed, client cache holding IDs from another account/server, typos in hand-copied UUIDs.

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/0e5eebd618347b05. Report an issue: GitHub.

Appendix: source

Thrown at src/Controller/Resources/ResourcesViewController.php:84

        }

        // Retrieve and sanity the query options.
        $whitelist = ['contain' => [
            'creator', 'favorite', 'modifier', 'secret', 'resource-type',
            'permission', 'permissions', 'permissions.user.profile', 'permissions.group',
        ]];

        if (Configure::read('passbolt.plugins.tags.enabled')) {
            $whitelist['contain'][] = 'tag';
        }

        $options = $this->QueryString->get($whitelist);

        // Retrieve the resource.
        /** @var \App\Model\Entity\Resource $resource */
        $resource = $this->Resources->findView($this->User->id(), $id, $options)->first();
        if (empty($resource)) {
            throw new NotFoundException(__('The resource does not exist.'));
        }
        $resource = FolderizableBehavior::unsetPersonalPropertyIfNull($resource->toArray());
        $resourceDto = MetadataResourceDto::fromArray($resource);
        $resource = (new MetadataResourcesRenderService())->renderResource($resource, $resourceDto->isV5());

        // Log secret access.
        $this->_logSecretAccesses($resource);

        $this->success(__('The operation was successful.'), $resource);
    }

    /**
     * Log secrets accesses in secretAccesses table.
     *
     * @param array $resource resource
     * @return void
     */
    protected function _logSecretAccesses(array $resource): void

View on GitHub (pinned to 31c1bbc10f)