{"record":{"id":"4290336717f5c861","repo":"remotion-dev/remotion","slug":"linear-gradient-program-link-failed-log-no","errorCode":null,"errorMessage":"Linear gradient program link failed: ${log ?? '(no log)'}","messagePattern":"Linear gradient program link failed: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/linear-gradient.ts","lineNumber":203,"sourceCode":"\nconst createProgram = (gl: WebGL2RenderingContext): WebGLProgram => {\n\tconst vs = compileShader(gl, gl.VERTEX_SHADER, VERTEX_SHADER);\n\tconst fs = compileShader(gl, gl.FRAGMENT_SHADER, FRAGMENT_SHADER);\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\tgl.deleteShader(vs);\n\tgl.deleteShader(fs);\n\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(\n\t\t\t`Linear gradient program link failed: ${log ?? '(no log)'}`,\n\t\t);\n\t}\n\n\treturn program;\n};\n\nconst setupLinearGradient = (\n\ttarget: HTMLCanvasElement,\n): LinearGradientState => {\n\tconst gl = target.getContext('webgl2', {\n\t\tpremultipliedAlpha: true,\n\t\talpha: true,\n\t\tpreserveDrawingBuffer: true,\n\t});\n\tif (!gl) {\n\t\tthrow createWebGL2ContextError('linear gradient effect');\n\t}","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/linear-gradient.ts#L185-L221","documentation":"Thrown by createProgram() in the linear-gradient effect when gl.linkProgram() reports a non-LINK_STATUS. The interpolated log carries the driver's linker message. Because the vertex/fragment shaders are fixed and compiled cleanly, a link failure here indicates the driver failed to reconcile them (varying/uniform mismatch on that implementation) rather than a library-logic error.","triggerScenarios":"Both VERTEX_SHADER and FRAGMENT_SHADER compiled, but the driver's linker rejected the combined program — a known class of WebGL2 driver bug where varying declarations (vUv) or precision qualifiers are matched inconsistently. Also seen after a GPU-process crash leaves context state inconsistent.","commonSituations":"Buggy mobile/integrated GPU drivers, older mesa on headless Linux, Chrome GPU-process crash mid-session, or a remote-rendering host with a stripped GL stack.","solutions":["Inspect the interpolated linker log for the exact mismatch the driver reported.","Restart Chrome / the render worker to clear stale context state and retry.","Switch to a software GL backend (`--gl=angle --angle-backend=swiftshader`) that implements linking deterministically.","Update Chrome and GPU drivers; on serverless, move to a Remotion-published Chrome layer.","If reproducible on a specific driver, file an issue against @remotion/effects with the driver string and the linker log."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  renderWithLinearGradient();\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith('Linear gradient program link failed')) {\n    console.error(err.message); // driver linker log\n    await withGlBackend('swiftshader', () => renderWithLinearGradient());\n  } else throw err;\n}","preventionTips":["Use SwiftShader/ANGLE on CI and Lambda for deterministic program linking.","Restart the worker after any Chrome GPU-process crash to discard stale context state.","Capture the linker log when this fires to identify the driver defect.","Report reproducible driver-specific link failures to @remotion/effects."],"tags":["webgl","gpu","glsl","shader","linker","driver"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}