{"record":{"id":"0e5eebd618347b05","repo":"passbolt/passbolt_api","slug":"the-resource-does-not-exist-resourcesviewcontroller","errorCode":null,"errorMessage":"The resource does not exist.","messagePattern":"The resource does not exist\\.","errorType":"exception","errorClass":"NotFoundException","httpStatus":404,"severity":"warning","filePath":"src/Controller/Resources/ResourcesViewController.php","lineNumber":84,"sourceCode":"        }\n\n        // Retrieve and sanity the query options.\n        $whitelist = ['contain' => [\n            'creator', 'favorite', 'modifier', 'secret', 'resource-type',\n            'permission', 'permissions', 'permissions.user.profile', 'permissions.group',\n        ]];\n\n        if (Configure::read('passbolt.plugins.tags.enabled')) {\n            $whitelist['contain'][] = 'tag';\n        }\n\n        $options = $this->QueryString->get($whitelist);\n\n        // Retrieve the resource.\n        /** @var \\App\\Model\\Entity\\Resource $resource */\n        $resource = $this->Resources->findView($this->User->id(), $id, $options)->first();\n        if (empty($resource)) {\n            throw new NotFoundException(__('The resource does not exist.'));\n        }\n        $resource = FolderizableBehavior::unsetPersonalPropertyIfNull($resource->toArray());\n        $resourceDto = MetadataResourceDto::fromArray($resource);\n        $resource = (new MetadataResourcesRenderService())->renderResource($resource, $resourceDto->isV5());\n\n        // Log secret access.\n        $this->_logSecretAccesses($resource);\n\n        $this->success(__('The operation was successful.'), $resource);\n    }\n\n    /**\n     * Log secrets accesses in secretAccesses table.\n     *\n     * @param array $resource resource\n     * @return void\n     */\n    protected function _logSecretAccesses(array $resource): void","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/passbolt/passbolt_api/blob/31c1bbc10f32808a607fa9bd81891e898779c0bc/src/Controller/Resources/ResourcesViewController.php#L66-L102","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Re-fetch the resource index to confirm whether the resource is still visible to you.","Ask the resource owner to share the resource or restore your group membership.","Purge stale client caches/links pointing at deleted resources.","Double-check you are pointing at the intended passbolt instance/account."],"exampleFix":"// before\nconst r = await api.get(`/resources/${id}.json`); // throws 404 unhandled\n// after\ntry {\n  const r = await api.get(`/resources/${id}.json`);\n} catch (e) {\n  if (e.status === 404) {\n    await refreshResourceIndex(); // resource gone or no access\n    return null;\n  }\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"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","preventionTips":["Treat 404 on view as 'gone or no access' — never retry with the same ID","Refresh the resource index to confirm current visibility","Re-sync client state after sharing/group membership changes","Verify the passbolt instance and account before assuming data loss"],"tags":["http-404","permissions","resources","not-found"],"backgroundTag":"resource-not-found","analyzedSha":"31c1bbc10f32808a607fa9bd81891e898779c0bc","analyzedAt":"2026-09-17T00:04:38.960Z","contentChangedAt":"2026-09-17T00:04:38.960Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}