{"record":{"id":"28c9ec1398b7460f","repo":"remotion-dev/remotion","slug":"program-link-failed-log-no-log","errorCode":null,"errorMessage":"Program link failed: ${log ?? '(no log)'}","messagePattern":"Program link failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/effects/src/barrel-distortion/barrel-distortion-runtime.ts","lineNumber":58,"sourceCode":"};\n\nconst linkProgram = (\n\tgl: WebGL2RenderingContext,\n\tvs: WebGLShader,\n\tfs: WebGLShader,\n): WebGLProgram => {\n\tconst program = gl.createProgram();\n\tif (!program) {\n\t\tthrow new Error('Failed to create WebGL program');\n\t}\n\n\tgl.attachShader(program, vs);\n\tgl.attachShader(program, fs);\n\tgl.linkProgram(program);\n\tif (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n\t\tconst log = gl.getProgramInfoLog(program);\n\t\tgl.deleteProgram(program);\n\t\tthrow new Error(`Program link failed: ${log ?? '(no log)'}`);\n\t}\n\n\treturn program;\n};\n\nconst createProgram = (\n\tgl: WebGL2RenderingContext,\n\tvertexSource: string,\n\tfragmentSource: string,\n): WebGLProgram => {\n\tconst vs = compileShader(gl, gl.VERTEX_SHADER, vertexSource);\n\tconst fs = compileShader(gl, gl.FRAGMENT_SHADER, fragmentSource);\n\tconst program = linkProgram(gl, vs, fs);\n\tgl.deleteShader(vs);\n\tgl.deleteShader(fs);\n\treturn program;\n};\n","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/barrel-distortion/barrel-distortion-runtime.ts#L40-L76","documentation":"Thrown by the barrel distortion effect's `linkProgram` helper when a vertex and fragment shader compile successfully but fail to link into a usable WebGL2 program. The GLSL sources are bundled constants (BARREL_DISTORTION_VS / BARREL_DISTORTION_FS), so a link failure indicates a shader-authoring bug or a driver that rejected the linked program (varying/in-out mismatch, unsupported feature). The error message appends the driver's info log when available.","triggerScenarios":"Called inside `setupBarrelDistortion(target)` via `createProgram(gl, BARREL_DISTORTION_VS, BARREL_DISTORTION_FS)` -> `linkProgram`. Fires exactly when `gl.getProgramParameter(program, gl.LINK_STATUS)` returns a falsy value after `gl.linkProgram`.","commonSituations":"A new barrel-distortion shader revision ships with a vertex/fragment interface mismatch; running on a GPU driver with strict GLSL ES 3.00 enforcement; headless/CI software rasterizers (SwiftShader, llvmpipe) that reject constructs a discrete GPU accepts; corrupted build output that truncated the shader string.","solutions":["Read the appended info log in the thrown message — it names the exact linker complaint (e.g. varying mismatch, undefined symbol).","Update @remotion/effects to the latest patch; shader regressions are fixed upstream.","Update your GPU drivers / browser; driver bugs sometimes surface as link failures.","Reproduce on a second GPU/browser to isolate hardware-specific driver behavior.","If running headless in CI, ensure Chrome uses a real GPU (or an accepted software WebGL2 path) rather than falling back to an unsupported context."],"exampleFix":"// Not user-fixable at the call site — the shader sources are library constants.\n// Action: report the info log from the error message to the Remotion issue tracker\n// with your GPU vendor/renderer string:\ndebugger; // then capture gl.getParameter(gl.RENDERER) / gl.getParameter(gl.VERSION)","handlingStrategy":"fallback","validationCode":"// Before setup, confirm the context can link programs at all.\nconst testProgram = gl.createProgram();\nif (!testProgram) { /* skip barrel distortion, fall back */ }\ngl.deleteProgram(testProgram);","typeGuard":null,"tryCatchPattern":"try {\n  const state = setupBarrelDistortion(canvas);\n} catch (err) {\n  if (String(err.message).startsWith('Program link failed')) {\n    // fall back to a non-WebGL effect or skip\n  } else { throw err; }\n}","preventionTips":["Pin a known-good @remotion/effects version; test shader changes in CI across GPUs.","Capture GL_RENDERER in render logs to triage driver-specific link failures.","Provide a non-WebGL fallback effect for environments that fail linking."],"tags":["webgl2","shader","barrel-distortion","gpu","driver"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}