Hi, while recording call with egress, i am getting...
# ask-ai
b
Hi, while recording call with egress, i am getting the below error;
Copy code
{"nodeID": "NE_covsMANvq7zS", "clusterID": "", "egressID": "EG_KUNk68CGLVWk"}
2025-12-12T08:44:25.864Z        DEBUG   egress.psrpc.IOInfo.UpdateEgress        rpc/logging.go:68       client response {"nodeID": "NE_covsMANvq7zS", "clusterID": "", "topic": [], "request": {"egressId": "EG_KUNk68CGLVWk", "roomId": "RM_iB7nwopspUDs", "roomName": "call-1765529046", "sourceType": "EGRESS_SOURCE_TYPE_WEB", "status": "EGRESS_ABORTED", "startedAt": 1765529050386979932, "endedAt": 1765529065858947790, "updatedAt": 1765529065858947790, "details": "End reason: Source closed", "error": "Start signal not received", "errorCode": 412, "roomComposite": {"roomName": "call-1765529046", "audioOnly": true, "audioMixing": "DEFAULT_MIXING", "preset": "H264_720P_30", "fileOutputs": [{"fileType": "OGG", "filepath": "/2025-12-12/call-1765529046", "s3": {"accessKey": "<redacted>", "secret": "<redacted>", "sessionToken": "<redacted>", "assumeRoleArn": "<redacted>", "region": "us-east-1", "bucket": "livekit_bucket", "forcePathStyle": true}}]}, "file": {"filename": "/2025-12-12/call-1765529046.ogg", "startedAt": 1765529065814486336, "endedAt": 1765529065814486336}, "fileResults": [{"filename": "/2025-12-12/call-1765529046.ogg", "startedAt": 1765529065814486336, "endedAt": 1765529065814486336}]}, "response": {}, "duration": "2.673872ms"}
my egress is running on ec2, whereas the dispatch call is taking places via a service on eks. i am using the below approach for recording the conversation:
Copy code
req = api.RoomCompositeEgressRequest(
                room_name=room_name,
                audio_only=True,
                file_outputs=[
                    api.EncodedFileOutput(
                        file_type=api.EncodedFileType.OGG,
                        filepath=file_path,
                        s3=api.S3Upload(
                            bucket=self.s3_bucket,
                            region=self.s3_region,
                            force_path_style=True
                        )
                    )
                ]
            )

# Start recording
await ctx.api.egress.start_room_composite_egress(req)
t
Thanks for reaching out, Utkarsh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m looking into the “Start signal not received” error you pasted (RoomComposite egress aborting with "End reason: Source closed", errorCode 412). That error means the headless browser used by the egress worker never logged
START_RECORDING
, so the compositor page never completed its handshake and recording never started. To narrow this down I need a few quick details from you: 1. How is the egress worker deployed on EC2? (Docker image, systemd binary, or something else) 2. Can the EC2 instance reach your LiveKit server’s WebSocket/HTTPS endpoint? Can you run: ◦
curl -v https://<your-livekit-host>
and ◦
google-chrome --headless --no-sandbox --dump-dom https://example.com
(or equivalent inside the container)? 1. Which LiveKit API key/secret does the egress use, and does that key have the
roomRecord
grant enabled? 2. Are you using any custom templates or a custom_base_url for compositing? 3. Is the room active (has participants) when you call
start_room_composite_egress
? While you gather that, try these quick checks (likely fixes): • Ensure EC2 can reach the LiveKit host (outbound port 443/WS allowed, DNS resolves). • Verify the egress process can launch Chrome (use official
livekit/egress
Docker image and run with
--cap-add=SYS_ADMIN
). • Confirm the API key used by egress includes
roomRecord
. • Start egress after the room exists and at least one participant is or will be present. Send the answers to 1–5 and any logs from the egress worker showing Chrome startup or template fetch failures — I’ll suggest the next targeted steps. Sources: Custom recording templates | LiveKit docs | Egress API | LiveKit docs | Universal Egress | Self-hosting the Egress Service | LiveKit docs
b
025-12-12T091009.460Z DEBUG egress source/web.go:349 chrome initialized {"nodeID": "NE_TrC2rLR37rU8", "handlerID": "EGH_WkRWw2MhfuUK", "clusterID": "", "egressID": "EG_gvJ5KKKwzewg"} 2025-12-12T091009.547Z DEBUG egress gstreamer/bin.go:71 adding src audio to pipeline {"nodeID": "NE_TrC2rLR37rU8", "handlerID": "EGH_WkRWw2MhfuUK", "clusterID": "", "egressID": "EG_gvJ5KKKwzewg"} 2025-12-12T091009.548Z DEBUG egress gstreamer/bin.go:77 adding sink file to pipeline {"nodeID": "NE_TrC2rLR37rU8", "handlerID": "EGH_WkRWw2MhfuUK", "clusterID": "", "egressID": "EG_gvJ5KKKwzewg"} 2025-12-12T091009.549Z DEBUG egress gstreamer/state.go:75 pipeline state building -> starting {"nodeID": "NE_TrC2rLR37rU8", "handlerID": "EGH_WkRWw2MhfuUK", "clusterID": "", "egressID": "EG_gvJ5KKKwzewg"} 2025-12-12T091009.549Z DEBUG egress pipeline/controller.go:220 waiting for start signal {"nodeID": "NE_TrC2rLR37rU8", "handlerID": "EGH_WkRWw2MhfuUK", "clusterID": "", "egressID": "EG_gvJ5KKKwzewg"} 2025-12-12T091024.573Z INFO egress source/web.go:328 chrome: END_RECORDING {"nodeID": "NE_TrC2rLR37rU8", "handlerID": "EGH_WkRWw2MhfuUK", "clusterID": "", "egressID": "EG_gvJ5KKKwzewg"} 2025-12-12T091024.573Z DEBUG egress pipeline/controller.go:416 stopping pipeline {"nodeID": "NE_TrC2rLR37rU8", "handlerID": "EGH_WkRWw2MhfuUK", "clusterID": "", "egressID": "EG_gvJ5KKKwzewg", "reason": "Source closed"} 2025-12-12T091024.573Z DEBUG egress gstreamer/pipeline.go:146 stopping pipeline {"nodeID": "NE_TrC2rLR37rU8", "handlerID": "EGH_WkRWw2MhfuUK", "clusterID": "", "egressID": "EG_gvJ5KKKwzewg"} 2025-12-12T091024.573Z DEBUG egress gstreamer/state.go:75 pipeline state starting -> stopping {"nodeID": "NE_TrC2rLR37rU8", "handlerID": "EGH_WkRWw2MhfuUK", "clusterID": "", "egressID": "EG_gvJ5KKKwzewg"} 2025-12-12T091024.573Z DEBUG egress source/web.go:123 closing chrome {"nodeID": "NE_TrC2rLR37rU8", "handlerID": "EGH_WkRWw2MhfuUK", "clusterID": "", "egressID": "EG_gvJ5KKKwzewg"} 2025-12-12T091024.573Z DEBUG egress gstreamer/state.go:75 pipeline state stopping -> finished {"nodeID": "NE_TrC2rLR37rU8", "handlerID": "EGH_WkRWw2MhfuUK", "clusterID": "", "egressID": "EG_gvJ5KKKwzewg"} 2025-12-12T091024.610Z DEBUG egress source/web.go:128 closing X display {"nodeID": "NE_TrC2rLR37rU8", "handlerID": "EGH_WkRWw2MhfuUK", "clusterID": "", "egressID": "EG_gvJ5KKKwzewg"} 2025-12-12T091024.613Z DEBUG egress source/web.go:134 unloading pulse module {"nodeID": "NE_TrC2rLR37rU8", "handlerID": "EGH_WkRWw2MhfuUK", "clusterID": "", "egressID": "EG_gvJ5KKKwzewg"} 2025-12-12T091024.622Z DEBUG egress server/server_ipc.go:55 handler finished {"nodeID": "NE_TrC2rLR37rU8", "clusterID": "", "egressID": "EG_gvJ5KKKwzewg"}
t
Thanks — the new logs are helpful. They show Chrome initialized and the gstreamer pipeline built, then the compositor sent an END_RECORDING and the pipeline stopped with reason "Source closed". That confirms the headless browser started but closed before emitting the required START_RECORDING handshake. Given that, focus on these likely causes and checks (quick, prioritized): 1. Compositor page failed to load or errored after load • Check the egress worker logs for browser console output around chrome initialization — any JS errors or network fetch failures? • If you run the egress container/binary locally, capture console logs from the compositor page to see why it closed. 1. Egress could not join the room or lacked permissions • Verify the egress-joined hidden participant successfully connected to the room (room must exist and accept the connection). • Confirm the API key the egress uses has the
roomRecord
grant. 1. Chrome sandbox or resource problems causing early exit • Ensure you run with
--cap-add=SYS_ADMIN
(or proper flags) if using Docker, and that Chrome starts cleanly in that environment. • Check container/system resource usage (CPU/memory) at start. 1. Custom template or
custom_base_url
issues • If you use custom templates, ensure the base URL is reachable from the egress host. An unreachable template often causes the page to close. If not using custom templates, ensure the egress service can serve its default templates on localhost (port 7980). 1. Timing: room not active when compositor attempts join • Start egress after the room exists and has at least one participant, or confirm your flow allows the compositor to wait long enough for participants to join. Next diagnostic steps I recommend you run and share results for targeted help: • Paste the egress worker’s browser console logs around the chrome init (look for JS errors, fetch 4xx/5xx, or explicit console messages). • Confirm whether the egress host can connect to the LiveKit WS endpoint (curl/wscat) and whether the API key has
roomRecord
. • Tell me how the egress is deployed (Docker or binary) and if you use custom templates. Give those outputs and I’ll propose exact fixes (Chrome flags, network rules, or template fixes) you can apply.
b
Copy code
api_key: key
api_secret: secret
ws_url: ws://localhost:7880

redis:
  address: localhost:6379
  username: "" # Use password field below
  password: ""
  db: 0
enable_chrome: false
enable_chrome_sandbox: false

logging:
  level: error
# Storage - local file output
file_output_path: /etc/livekit/recordings

# Optional: template settings
template_port: 7980
this is my egress config
t
Thanks — this config explains the problem. Your egress has Chrome disabled: •
enable_chrome: false
RoomComposite/Web egress requires a headless Chrome instance to load the compositor page and emit
START_RECORDING
. With Chrome disabled the compositor never runs, so the source closes and recording aborts. What to change (minimum steps): 1. Enable Chrome in the egress config: ◦ set
enable_chrome: true
1. If running in Docker, run the container with Chrome sandbox support: ◦ add
--cap-add=SYS_ADMIN
to
docker run
, or enable sandboxing per your environment. ◦ alternatively, if you must disable sandbox, ensure Chrome is launched with
--no-sandbox
(not recommended for production). 1. Ensure the egress host can launch Chrome: ◦ use the official
livekit/egress
image (bundles Chrome) or install Chrome on the host. ◦ allocate sufficient CPU/memory (4 CPU / 4GB recommended). 1. Keep
template_port: 7980
reachable locally (egress serves default templates on that port). After changing, restart the egress worker and re-run the recording. If you still see early END_RECORDING, paste the browser console logs from the egress worker (the logs around chrome init and any JS/network errors) and I’ll help debug further.
b
but the same setup was working when everything eas hosted on ec2
t
You’re right to note it used to work on EC2 — that helps narrow this down. The config you shared shows two key differences that explain why it fails now: 1) Chrome is disabled •
enable_chrome: false
— RoomComposite/Web egress requires a headless Chrome to load the compositor and emit
START_RECORDING
. On your old all-EC2 setup Chrome was likely enabled or available; with it disabled now the compositor never runs and the source closes. 2) Localhost WS URL may be unreachable from the egress host •
ws_url: ws://localhost:7880
works only if the egress worker and LiveKit server are on the same host/network. When part of your system moved to EKS, the dispatch/service on EKS may be resolving differently and the EC2 egress cannot reach the LiveKit WS at localhost. What to do next (minimal changes to test quickly) 1. Enable Chrome in the egress config: ◦ set
enable_chrome: true
and restart the egress worker. 1. Ensure Chrome can run in your environment: ◦ if using Docker, run the container with
--cap-add=SYS_ADMIN
or use the official image that bundles Chrome. 1. Update
ws_url
so the egress can reach LiveKit: ◦ use the actual LiveKit domain/IP reachable from EC2 (eg.
wss://your-livekit-host:7880
or the cluster’s external endpoint), not
localhost
. 1. Restart egress and retry recording. If it still fails, please provide: • The egress deployment on EC2 (Docker or binary) and the exact ws_url you switch to. • Any new egress logs around chrome init and browser console output after enabling Chrome. I’ll help with the next steps once you share those.