{"record":{"id":"a8ec1ca241996ce4","repo":"immich-app/immich","slug":"asset-not-found-or-metadata-not-yet-ready-for-stre","errorCode":null,"errorMessage":"Asset not found or metadata not yet ready for streaming","messagePattern":"Asset not found or metadata not yet ready for streaming","errorType":"http","errorClass":"NotFoundException","httpStatus":404,"severity":"error","filePath":"server/src/services/hls.service.ts","lineNumber":74,"sourceCode":"      throw new NotFoundException('Asset metadata is not yet ready for streaming');\n    }\n\n    // Sharing the sessionId allows only one microservices worker to successfully insert to the session table.\n    // The microservices worker that creates a session owns the transcoding lifecycle for it.\n    const sessionId = this.cryptoRepository.randomUUID();\n    this.websocketRepository.serverSend('HlsSessionRequest', { sessionId, assetId, ownerId: auth.user.id });\n    await this.pendingSessions.wait(sessionId);\n    this.trackSession(sessionId);\n\n    return this.generateMainPlaylist(sessionId, ffmpeg, asset);\n  }\n\n  async getMediaPlaylist(auth: AuthDto, assetId: string, sessionId: string, variantIndex: number, position?: number) {\n    await this.requireAccess({ auth, permission: Permission.AssetView, ids: [assetId] });\n\n    const asset = await this.videoStreamRepository.getForMediaPlaylist(assetId, sessionId);\n    if (!asset) {\n      throw new NotFoundException('Asset not found or metadata not yet ready for streaming');\n    }\n\n    const segmentation = this.getSegmentation(asset);\n    const hintedSegment = position === undefined ? undefined : this.positionToSegmentIndex(segmentation, position);\n    this.prewarmVariant(assetId, sessionId, variantIndex, hintedSegment);\n\n    return this.generateMediaPlaylist(asset, segmentation);\n  }\n\n  async getSegment(\n    auth: AuthDto,\n    assetId: string,\n    sessionId: string,\n    variantIndex: number,\n    filename: string,\n    initSegment?: number,\n  ) {\n    await this.requireAccess({ auth, permission: Permission.AssetView, ids: [assetId] });","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/immich-app/immich/blob/e55ac299a4ec7cb372e35dbf2c6c05ee9ce77f6c/server/src/services/hls.service.ts#L56-L92","documentation":"Guard when opening an HLS stream: the asset's transcode metadata (video stream info, segmentation) has not been generated yet by the background metadata pipeline, or the asset id does not exist, so playback cannot start. Raised in getMediaPlaylist as a 404 before requesting a transcode session from the microservices worker. Fires for brand-new uploads whose metadata is still processing or stale/deleted asset ids.","triggerScenarios":"Thrown at server/src/services/hls.service.ts:74 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Poll/retry after a short delay until asset metadata extraction completes","Verify the assetId exists before requesting the playlist","Show the user a 'video is still processing' state instead of the player","Check that the metadata/transcode worker service is running and healthy"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e55ac299a4ec7cb372e35dbf2c6c05ee9ce77f6c","analyzedAt":"2026-09-15T07:20:19.675Z","contentChangedAt":"2026-09-15T07:20:19.675Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}