happy-fall-9027
08/06/2025, 8:34 AMtall-airline-16756
08/06/2025, 8:34 AMtall-airline-16756
08/06/2025, 8:35 AMEGRESS_FAILED
state, which cannot be stopped. This typically happens if the egress session has already failed or completed before the stop request was made.
To resolve this:
• Use the ListEgress
method to check the current status of the egress session.
• Ensure the egress is in an active state (e.g., EGRESS_STARTING
, EGRESS_ACTIVE
) before calling StopEgress
.
If the egress session has failed, you may need to investigate the failure reason and ensure your setup is correctly configured to avoid such issues in the future. Let me know if you need further assistance with this!
Sources: pkg/service/egress.gohappy-fall-9027
08/06/2025, 8:40 AMtall-airline-16756
08/06/2025, 8:40 AMListEgress
and StopEgress
methods in your code:
ListEgress
Purpose: This method helps you see all the active or recent egress sessions.
Example Usage:
• JavaScript:
const res = await egressClient.listEgress({
roomName: "my-room", // You can filter by room name if you want
active: true, // Or just show active egresses
});
• Go:
req := &livekit.ListEgressRequest{
RoomName: "my-room", // Optional, but handy
Active: true, // Optional as well
}
resp, err := egressClient.ListEgress(context.Background(), req)
if err != nil {
// Oops, handle the error here
}
egresses := resp.Items
• Python:
list_req = ListEgressRequest(
room_name="my-room", # Optional, just to narrow things down
active=True # Optional, to show active ones only
)
resp = egress_service.list_egress(list_req)
egresses = resp.items
StopEgress
Purpose: Use this to stop an active egress session when you need to.
Example Usage:
• JavaScript:
const info = await egressClient.stopEgress("egress-id");
• Go:
req := &livekit.StopEgressRequest{
EgressId: "egress-id",
}
resp, err := egressClient.StopEgress(context.Background(), req)
if err != nil {
// Handle any issues here
}
• Python:
stop_req = StopEgressRequest(egress_id="egress-id")
resp = egress_service.stop_egress(stop_req)
Just a quick reminder: both methods need you to be properly authenticated and authorized. Make sure your permissions are all set up for managing egress. If you hit any bumps or want to chat more about this, I’m here to help!
Sources: livekit/livekit_egress.pb.go | livekit-api/src/services/egress.rs | cmd/lk/egress.go | src/main/kotlin/io/livekit/server/EgressService.kt