{"record":{"id":"ee0596509695b51f","repo":"remotion-dev/remotion","slug":"failed-to-create-webgl-vertex-array-ee0596","errorCode":null,"errorMessage":"Failed to create WebGL vertex array","messagePattern":"Failed to create WebGL vertex array","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/effects/src/linear-gradient.ts","lineNumber":227,"sourceCode":"};\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}\n\n\tconst program = createProgram(gl);\n\n\tconst vao = gl.createVertexArray();\n\tif (!vao) {\n\t\tthrow new Error('Failed to create WebGL vertex array');\n\t}\n\n\tgl.bindVertexArray(vao);\n\n\tconst data = new Float32Array([\n\t\t-1, -1, 0, 0, 1, -1, 1, 0, -1, 1, 0, 1, 1, 1, 1, 1,\n\t]);\n\n\tconst vbo = gl.createBuffer();\n\tif (!vbo) {\n\t\tthrow new Error('Failed to create WebGL buffer');\n\t}\n\n\tgl.bindBuffer(gl.ARRAY_BUFFER, vbo);\n\tgl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);\n\n\tconst aPos = gl.getAttribLocation(program, 'aPos');\n\tconst aUv = gl.getAttribLocation(program, 'aUv');","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/linear-gradient.ts#L209-L245","documentation":"Thrown by setupLinearGradient() when gl.createVertexArray() returns null after the program was built. The library needs a VAO to bind the fullscreen-quad attributes, so it aborts rather than silently drawing nothing.","triggerScenarios":"WebGL2 context is alive but refused a VAO allocation — context on the verge of loss, driver VAO-object limit reached, or a GPU process that crashed and left allocations failing. Distinct from a context-creation failure (that throws createWebGL2ContextError earlier).","commonSituations":"High concurrency renders where many effects each create VAOs; long-lived Studio sessions; GPU memory pressure on integrated graphics; headless Chrome whose GPU process was killed by the OS OOM-killer.","solutions":["Restart the render worker / Chrome to recover a clean context and retry.","Lower `--concurrency` or framesPerLambda so fewer GL objects are live at once.","Force software rendering (`--gl=angle --angle-backend=swiftshader`).","Monitor host memory during the render; raise Lambda memory if the GPU process is being OOM-killed.","Update GPU drivers / Chrome on persistent failures."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"function canAllocateVao(canvas: HTMLCanvasElement): boolean {\n  const gl = canvas.getContext('webgl2');\n  if (!gl) return false;\n  const vao = gl.createVertexArray();\n  const ok = vao !== null;\n  if (vao) gl.deleteVertexArray(vao);\n  return ok;\n}","typeGuard":null,"tryCatchPattern":"try {\n  renderWithLinearGradient();\n} catch (err) {\n  if (err instanceof Error && err.message === 'Failed to create WebGL vertex array') {\n    await restartRendererWorker();\n    renderWithLinearGradient();\n  } else throw err;\n}","preventionTips":["Limit concurrency so the driver's VAO/object budget is not exhausted.","Run effect cleanup paths so VAOs are released between compositions.","Recycle the worker after GPU-process crashes.","Force software rendering on unstable GPUs."],"tags":["webgl","gpu","rendering","resource-exhaustion"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}