[Fix] 020-twilio-media-streams — install ffmpeg when missing from CI runner#47
[Fix] 020-twilio-media-streams — install ffmpeg when missing from CI runner#47github-actions[bot] wants to merge 1 commit intomainfrom
Conversation
…runner
The ubuntu-24.04 GitHub Actions runner image (20260323.65) no longer
ships ffmpeg pre-installed. The test crashed with
"Cannot read properties of null (reading 'toString')" because
spawnSync returns { stderr: null, status: null } when the binary is
not found (ENOENT), and the error handler assumed stderr was always
a Buffer.
- Add ensureFfmpeg() that installs ffmpeg via apt-get if not present
- Guard against null result.error before checking result.status
- Guard against null result.stderr in the error message
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Code ReviewOverall: APPROVED Integration genuinenessPass — existing integration with Twilio and Deepgram is unchanged. Both SDKs imported, real API calls made, Code quality
Documentation
Tests
✓ All checks pass. Marking review passed. Review by Lead on 2026-03-29 |
Code ReviewOverall: APPROVED Integration genuinenessPass — existing example imports both Twilio SDK ( Code quality
DocumentationN/A — no documentation changes (fix PR only) Tests
✓ All checks pass. Marking review passed. Review by Lead on 2026-03-29 |
Code ReviewOverall: CHANGES REQUESTED Integration genuineness✓ Pass — this is a fix to example 020-twilio-media-streams-node, which genuinely integrates both the Deepgram SDK and the Twilio SDK. Code quality
DocumentationN/A — fix PR, no README changes needed. Tests
Additional notePR #56 supersedes this PR with a cleaner version of the same fix (better error messages, fully removes the stale comment). Recommend closing this PR in favour of #56. Please address the items above. The fix agent will pick this up automatically. Review by Lead on 2026-03-30 |
Closing in favour of #56Root cause: This PR and #56 both fix the same issue (missing ffmpeg on ubuntu-24.04 runners). PR #56 has a slightly cleaner implementation (better error messages, properly removes the stale "pre-installed" comment) and has already passed review. Closing this PR as superseded. Fix triage by Lead on 2026-03-30 |
|
Superseded by #56 |
…r crash (#56) ## Summary - Add `ensureFfmpeg()` helper that auto-installs ffmpeg via apt-get when missing from CI runner - Guard against null `result.error` / `result.stderr` from `spawnSync` when binary is not found - Remove stale comment claiming ffmpeg is pre-installed on all runners ## Root cause The `ubuntu-24.04` GitHub Actions runner image (`20260323.65`) no longer ships `ffmpeg` pre-installed. `spawnSync('ffmpeg', ...)` returns `{ status: null, stderr: null, error: ENOENT }` when the binary is missing, and the test's error handler did `result.stderr.toString()` without a null check — crashing with `Cannot read properties of null (reading 'toString')`. ## Test plan - [ ] CI test passes: ffmpeg is installed on-demand if not present - [ ] CI test passes: POST /voice returns TwiML with `<Stream>` element - [ ] CI test passes: WebSocket pipeline streams mulaw audio → Deepgram and receives transcript Supersedes #47 (same fix, yesterday's branch had no CI runs). 🤖 Generated with [Claude Code](https://claude.ai/code) --------- Co-authored-by: examples-bot <noreply@deepgram.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Luke Oliff <luke@lukeoliff.com>
Summary
ensureFfmpeg()helper that auto-installs ffmpeg via apt-get when it's missing from the CI runner imageresult.error/result.stderrfromspawnSyncwhen the binary doesn't existRoot cause
The
ubuntu-24.04GitHub Actions runner image (20260323.65) no longer shipsffmpegpre-installed.spawnSync('ffmpeg', ...)returns{ status: null, stderr: null, error: ENOENT }when the binary is missing, and the test's error handler didresult.stderr.toString()without a null check — crashing withCannot read properties of null (reading 'toString').Test plan
<Stream>element🤖 Generated with Claude Code