Skip to content

fix(docker): clone ffmpeg from the github mirror and pin to n8.1.2 - #4025

Merged
j0sh merged 3 commits into
masterfrom
fix/ffmpeg-pin-and-mirror
Aug 14, 2026
Merged

fix(docker): clone ffmpeg from the github mirror and pin to n8.1.2#4025
j0sh merged 3 commits into
masterfrom
fix/ffmpeg-pin-and-mirror

Conversation

@rickstaa

@rickstaa rickstaa commented Aug 12, 2026

Copy link
Copy Markdown
Member

Combines #4024 and #4022 into one PR, as requested in review. Both were approved separately. Kept as two commits so each half stays reviewable and revertable.

1. Clone from the GitHub mirror (#4024)

git.ffmpeg.org intermittently returns HTTP 502, failing the clone with exit code: 128:

4.430  Cloning into '/ffmpeg'...
7.337  fatal: unable to access 'https://git.ffmpeg.org/ffmpeg.git/': The requested URL returned error: 502

It broke the v0.9.1 build three times from GitHub hosted runners and once from a self hosted runner, while cloning fine from a local workstation in between. Details in #4023.

The server side cause is unconfirmed and github.com/FFmpeg/FFmpeg is not an officially endorsed mirror; see #4023 and #4024 for the full caveats. Note the build already clones from github.com three times, including twice from install_ffmpeg.sh via lpms, so this does not add a dependency that is not already load bearing.

2. Pin ffmpeg to n8.1.2 (#4022)

The FFMPEG_SHA pin never took effect. VAR=value command is a POSIX prefix assignment, so the variable only entered git clone's environment. Both later commands expanded it to an empty string: git fetch took the default branch, and bare git checkout exited 0. That silent success is why it went unnoticed since #3353 (Feb 2025), during which every builder image compiled upstream master as of build time.

git clone accepts tags but not commit SHAs, which is why the original needed the clone-then-fetch dance. Pinning a tag removes the variable, and therefore the whole bug class.

n8.1.2 over n9.0.1 for maturity: eight weeks in the field versus a tag cut hours before. All of n9.0.1, n9.0 and n8.1.2 were verified to configure and build in a replica of the builder environment (ubuntu 20.04, libx264 0.155, libfdk-aac 0.1.6, gcc 9, nasm 3.01) with the exact flags from this file. n8.1.2 contains the HEVC-in-FLV commit the original pin was chosen for.

Verification

The builder job skips its build step on PRs (gated on github.ref_name matching main|master|vX.Y.Z), so a green check here does not exercise this layer. On #4024 the guard was temporarily disabled to test it for real, then removed:

https://github.com/livepeer/go-livepeer/actions/runs/31608535985

Job Runner Result
go-livepeer builder docker image generation GitHub hosted ubuntu-24.04 success, 26m04s
Docker image generation self hosted success
14:50:57  #15 [build 6/14] RUN ... git clone --depth 1 https://github.com/FFmpeg/FFmpeg.git /ffmpeg ...
14:50:57  #15 0.059  Cloning into '/ffmpeg'...
14:56:08  #15 DONE 310.8s

That run cold built the ffmpeg layer from the mirror on a hosted runner, which is where the 502s occurred. It did not include the n8.1.2 pin, which was verified locally instead.

Behaviour change

Because the pin never worked, images since Feb 2025 shipped whatever master was at build time. This is the first build to honour a pin, so the shipped ffmpeg/ffprobe and the libs under /usr/local/lib move to n8.1.2. The CGO link target is unaffected: that comes from install_ffmpeg.sh via lpms and is pinned separately.

Supersedes #4022 and #4024. Closes #4021. Closes #4023.

rickstaa and others added 2 commits August 12, 2026 17:17
git.ffmpeg.org intermittently returns HTTP 502 on clone, which fails the
builder image with exit 128. It has failed from both GitHub hosted and
self hosted runners while succeeding from a local machine minutes later.

The cause on the server side is unconfirmed. All ffmpeg.org hostnames
resolve to a single address with no failover, which is consistent with a
proxy returning 502 under clone load, but we cannot verify that.

github.com/FFmpeg/FFmpeg is not an official FFmpeg endorsed mirror; it
self describes as a mirror and is current. This build already depends on
github.com for grpc_health_probe and tasmodel.pb.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The FFMPEG_SHA pin never took effect. VAR=value command is a POSIX
prefix assignment, so the variable only reached git clone's environment;
both later commands expanded it to an empty string, leaving git fetch on
the default branch and bare git checkout a silent no-op. Every builder
image has compiled upstream master as of build time.

git clone accepts tags but not SHAs, which is why the original needed
clone-then-fetch. Pinning a tag removes the variable entirely.

n8.1.2 over n9.0.1 for maturity: eight weeks in the field against a tag
cut hours ago. Verified to configure and build with these flags.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the docker Pull requests that update Docker code label Aug 12, 2026
@rickstaa
rickstaa requested a review from j0sh August 12, 2026 15:19
@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 35.54008%. Comparing base (7b66003) to head (bfdc188).

Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                 @@
##              master       #4025         +/-   ##
===================================================
- Coverage   35.54450%   35.54008%   -0.00442%     
===================================================
  Files            174         174                 
  Lines          45225       45225                 
===================================================
- Hits           16075       16073          -2     
- Misses         27877       27879          +2     
  Partials        1273        1273                 

see 2 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7b66003...bfdc188. Read the comment docs.
see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@j0sh

j0sh commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Merging because I keep hitting this, thanks

@j0sh
j0sh merged commit 04f957e into master Aug 14, 2026
19 checks passed
@j0sh
j0sh deleted the fix/ffmpeg-pin-and-mirror branch August 14, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker Pull requests that update Docker code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docker: intermittent HTTP 502 from git.ffmpeg.org fails the ffmpeg clone docker: pinned FFMPEG_SHA is never applied, builder tracks upstream master

2 participants