{"record":{"id":"09cf684fbbc5b65f","repo":"HeyPuter/puter","slug":"subject-does-not-exist","errorCode":"subject_does_not_exist","errorMessage":"Entry not found: uid=${uid}","messagePattern":"Entry not found: uid=(.+?)","errorType":"http","errorClass":"HttpError","httpStatus":404,"severity":"error","filePath":"src/backend/controllers/fs/LegacyFSController.ts","lineNumber":1075,"sourceCode":"            throw new HttpError(400, 'Missing `uid`', {\n                legacyCode: 'bad_request',\n            });\n        if (!thumbnail)\n            throw new HttpError(400, 'Missing `thumbnail`', {\n                legacyCode: 'bad_request',\n            });\n        // Only inline image data. Clients generate the thumbnail themselves\n        // and the thumbnails extension is what turns it into a storage\n        // pointer; accepting a pointer here would let a caller name an object\n        // the server would then sign reads of, and delete, on their behalf.\n        if (!thumbnail.startsWith('data:'))\n            throw new HttpError(400, '`thumbnail` must be a data: URL', {\n                legacyCode: 'bad_request',\n            });\n\n        const entry = await this.stores.fsEntry.getEntryByUuid(uid);\n        if (!entry || !entry.path)\n            throw new HttpError(404, `Entry not found: uid=${uid}`, {\n                legacyCode: 'subject_does_not_exist',\n            });\n        await assertAccess(\n            this.services.acl,\n            this.services.fs,\n            actor,\n            entry.path,\n            'write',\n        );\n\n        // emitAndWait is required: the thumbnails extension rewrites\n        // `event.url` from a data URL to an `s3://` pointer, and the DB\n        // write below needs to see that rewrite.\n        const event = { url: thumbnail };\n        await this.clients.event.emitAndWait('thumbnail.created', event, {});\n\n        await this.clients.db.write(\n            'UPDATE `fsentries` SET `thumbnail` = ? WHERE `uuid` = ?',","sourceCodeStart":1057,"sourceCodeEnd":1093,"githubUrl":"https://github.com/HeyPuter/puter/blob/908ec23eda38526170322c3edf71ba45ecb1ca95/src/backend/controllers/fs/LegacyFSController.ts#L1057-L1093","documentation":"Thrown (HTTP 404) by LegacyFSController.updateFsentryThumbnail when no fs entry exists for the supplied uid, or the entry has no path. The lookup uses stores.fsEntry.getEntryByUuid(uid); a missing/null entry or one without a path is reported as subject_does_not_exist.","triggerScenarios":"Passing a uid that was never created, was deleted, belongs to another user (when lookup is scoped), or a uid typo. Also an entry row that exists but has a null path.","commonSituations":"Using a stale uid cached after the file was deleted; passing the entry's id (numeric DB id) instead of its uuid; uid copy/paste errors.","solutions":["Re-fetch the entry to confirm it exists and obtain its current uuid before calling.","Ensure you pass the entry's uuid (string) field, not its numeric id or name.","Handle 404 gracefully in the UI (e.g. offer to retry or discard the stale reference)."],"exampleFix":"// before\nupdateFsentryThumbnail({ uid: 'maybe-old-id', thumbnail: dataUrl });\n\n// after\nconst entry = await getEntry(path);\nupdateFsentryThumbnail({ uid: entry.uuid, thumbnail: dataUrl });","handlingStrategy":"try-catch","validationCode":"const entry = await store.getEntryByUuid(uid);\nif (!entry || !entry.path) throw new Error('Entry not found for uid');","typeGuard":"null","tryCatchPattern":"try {\n  await updateFsentryThumbnail({ uid, thumbnail });\n} catch (e) {\n  if (e.code === 'subject_does_not_exist' || e.status === 404) {\n    // refresh or discard the stale uid reference\n  } else throw e;\n}","preventionTips":["Pass the entry uuid, not the numeric id or name.","Re-resolve entries cached across sessions before use.","Treat 404 as a signal to refresh the file list."],"tags":["fs","legacy","thumbnail","not-found","http-404"],"backgroundTag":null,"analyzedSha":"908ec23eda38526170322c3edf71ba45ecb1ca95","analyzedAt":"2026-08-12T20:53:15.911Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}