{"record":{"id":"1cfd13b823a4af21","repo":"immich-app/immich","slug":"asset-media-not-found","errorCode":null,"errorMessage":"Asset media not found","messagePattern":"Asset media not found","errorType":"http","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"server/src/services/asset-media.service.ts","lineNumber":285,"sourceCode":"    const { originalPath, originalFileName, path } = await this.assetRepository.getForThumbnail(\n      id,\n      size,\n      dto.edited ?? false,\n    );\n\n    if (size === AssetFileType.FullSize && mimeTypes.isWebSupportedImage(originalPath) && !dto.edited) {\n      // use original file for web supported images\n      return { targetSize: 'original' };\n    }\n\n    if (dto.size === AssetMediaSize.FULLSIZE && !path) {\n      // downgrade to preview if fullsize is not available.\n      // e.g. disabled or not yet (re)generated\n      return { targetSize: AssetMediaSize.PREVIEW };\n    }\n\n    if (!path) {\n      throw new NotFoundException('Asset media not found');\n    }\n\n    const fileNameBase =\n      auth.sharedLink && !auth.sharedLink.showExif ? id : getFileNameWithoutExtension(originalFileName);\n    const fileName = `${fileNameBase}_${size}${getFilenameExtension(path)}`;\n\n    return new ImmichFileResponse({\n      fileName,\n      path,\n      contentType: mimeTypes.lookup(path),\n      cacheControl: CacheControl.PrivateWithCache,\n    });\n  }\n\n  async playbackVideo(auth: AuthDto, id: string): Promise<ImmichFileResponse> {\n    await this.requireAccess({ auth, permission: Permission.AssetView, ids: [id] });\n\n    const asset = await this.assetRepository.getForVideo(id);","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/immich-app/immich/blob/199723261c6ffa897fec8ccdaea6359e39c37cc3/server/src/services/asset-media.service.ts#L267-L303","documentation":"Thrown by AssetMediaService when resolving a thumbnail/preview path: after all downgrades (original-for-web-images, fullsize→preview fallback) the resolved `path` is still empty, so no rendition exists to serve. NotFoundException (HTTP 404). Typically the asset exists and the caller has access, but the preview/thumbnail generation job has not produced output (or was disabled).","triggerScenarios":"GET /assets/:id/thumbnail or preview for an asset whose preview JPEG was never generated — job queue stalled, preview generation disabled in system config, or the asset is brand new and jobs haven't run yet.","commonSituations":"Freshly uploaded assets queried before the thumbnail/preview jobs complete; storage failures during generation; machine-learning/storage job workers offline; preview config toggled off after ingest.","solutions":["Wait for / retry after the preview and thumbnail generation jobs finish for the asset","Confirm the job queue (newsletter/thumbnail/preview workers) is running and not backed up","Check System Settings → Image/Job configuration to ensure preview/thumbnail generation is enabled","Trigger regeneration for the asset if jobs are stuck"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Check job status / wait for renditions before requesting thumbnails\n// (No direct 'has preview' API — retry with backoff is the practical pattern.)","typeGuard":null,"tryCatchPattern":"async function getThumbnail(id, attempt = 0) {\n  try {\n    return await sdk.viewThumbnail(id, { size: 'preview' });\n  } catch (e) {\n    if (e instanceof HttpError && e.status === 404 && attempt < 5) {\n      await new Promise(r => setTimeout(r, 1000 * 2 ** attempt)); // backoff\n      return getThumbnail(id, attempt + 1);\n    }\n    throw e;\n  }\n}","preventionTips":["Ensure the thumbnail and preview generation jobs are enabled and running","For freshly uploaded assets, wait for job completion before requesting renditions","Monitor the job queue for backlogs that delay preview generation"],"tags":["asset","thumbnail","preview","job-queue","not-found","nestjs"],"backgroundTag":null,"analyzedSha":"199723261c6ffa897fec8ccdaea6359e39c37cc3","analyzedAt":"2026-08-12T04:54:27.085Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}