{"id":"a1089741f3fe1297","repo":"gohugoio/hugo","slug":"timeout","errorCode":null,"errorMessage":"timeout","messagePattern":"timeout","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/warpc/warpc.go","lineNumber":247,"sourceCode":"\tif err != nil {\n\t\treturn d.zeroR, err\n\t}\n\n\tif err := d.send(call); err != nil {\n\t\treturn d.zeroR, err\n\t}\n\n\ttimer := getTimer(30 * time.Second)\n\tdefer putTimer(timer)\n\n\tselect {\n\tcase call = <-call.donec:\n\tcase <-p.donec:\n\t\treturn d.zeroR, p.Err()\n\tcase <-ctx.Done():\n\t\treturn d.zeroR, ctx.Err()\n\tcase <-timer.C:\n\t\treturn d.zeroR, errors.New(\"timeout\")\n\t}\n\n\tif call.err != nil {\n\t\treturn d.zeroR, call.err\n\t}\n\n\tresp, err := call.response, p.Err()\n\n\tif err == nil && resp.Header.Err != \"\" {\n\t\terr = errors.New(resp.Header.Err)\n\t}\n\n\treturn resp, err\n}\n\nfunc (d *dispatcher[Q, R]) newCall(q Message[Q]) (*call[Q, R], error) {\n\tif q.Header.ID == 0 {\n\t\tq.Header.ID = d.id.Add(1)","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/gohugoio/hugo/blob/8a468df065a75c1c7cf9f6850f32148746590ea5/internal/warpc/warpc.go#L229-L265","documentation":"Returned by dispatcherPool.Execute (internal/warpc/warpc.go:247) when a single RPC to a WASM worker (katex, AVIF/WebP codec) gets no response within the hard-coded 30-second timer. The dispatcher gave up waiting on the call's done channel, meaning the WASM module is hung, overloaded, or its response was lost.","triggerScenarios":"Any transform.ToMath (KaTeX), AVIF, or WebP encode/decode call where the Wasmtime-hosted module takes longer than 30s to reply — huge images, enormous formulas, a deadlocked module, or a machine under extreme CPU/memory pressure.","commonSituations":"Encoding very large images to WebP/AVIF on slow CI runners; heavily parallel builds starving the WASM workers; antivirus or cgroup CPU limits throttling wasmtime; pathological KaTeX input.","solutions":["Reduce the size of the offending asset (resize images before AVIF/WebP encode; split giant math expressions).","Give the build more CPU or reduce build parallelism so each WASM call finishes within 30s.","Retry the build — transient host load can cause one-off timeouts.","If a specific reproducible input always times out, report it to Hugo (the 30s limit is not configurable)."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if timeout := cfg.Timeout; timeout < expectedWorstCase {\n    // raise the warpc timeout for large images/katex batches\n}","typeGuard":null,"tryCatchPattern":"res, err := d.Execute(ctx, msg)\nif err != nil && strings.Contains(err.Error(), \"timeout\") {\n    // retry once with a longer deadline; if it still times out, reduce input size\n}","preventionTips":["Size the timeout to the largest asset you process, not the average","Retry at most once — repeated timeouts mean the input is too large or the runtime is starved","Split very large images/formula batches into smaller units"],"tags":["hugo","warpc","wasm","timeout","image-processing","katex"],"analyzedSha":"8a468df065a75c1c7cf9f6850f32148746590ea5","analyzedAt":"2026-07-31T21:23:07.045Z","schemaVersion":2}