livekit/livekit · error

could not find track

Error message

could not find track

What it means

Returned by UpdateAudioTrack when the referenced track SID is neither a pending track (checked under pendingTracksLock) nor an already published track on the participant, so the update has no target to apply to. The server notifies the client via a RequestResponse with NOT_FOUND before returning this error.

Source

Thrown at pkg/rtc/participant.go:4238

				}

				p.pubLogger.Debugw("updated pending track", "trackID", ti.Sid, "trackInfo", logger.Proto(ti))
			}
		}
	}
	p.pendingTracksLock.RUnlock()
	if isPending {
		return nil
	}

	p.pubLogger.Debugw("could not locate track", "trackID", update.TrackSid)
	p.sendRequestResponse(&livekit.RequestResponse{
		Reason: livekit.RequestResponse_NOT_FOUND,
		Request: &livekit.RequestResponse_UpdateAudioTrack{
			UpdateAudioTrack: utils.CloneProto(update),
		},
	})
	return errors.New("could not find track")
}

func (p *ParticipantImpl) UpdateVideoTrack(update *livekit.UpdateLocalVideoTrack) error {
	if track := p.UpTrackManager.UpdatePublishedVideoTrack(update); track != nil {
		return nil
	}

	isPending := false
	p.pendingTracksLock.RLock()
	for _, pti := range p.pendingTracks {
		for _, ti := range pti.trackInfos {
			if ti.Sid == update.TrackSid {
				isPending = true

				ti.Width = update.Width
				ti.Height = update.Height
			}
		}

View on GitHub (pinned to ee45c3f0b1)

Solutions

  1. Verify the track SID in the UpdateLocalAudioTrack request matches a track previously published by this participant
  2. Ensure the track has finished publishing (is no longer pending) before sending audio track updates
  3. Check for races where the track was unpublished or replaced concurrently with the update request
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/rtc/participant.go:4238 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of livekit/livekit@ee45c3f0b1 (2026-09-02). Data as JSON: /api/errors/ee0cda48a2d76d4a. Report an issue: GitHub.