{"record":{"id":"a1089741f3fe1297","repo":"gohugoio/hugo","slug":"timeout","errorCode":null,"errorMessage":"timeout","messagePattern":"timeout","errorType":"console","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/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/internal/warpc/warpc.go#L229-L265","documentation":"Returned by dispatcherPool.Execute in internal/warpc/warpc.go:247 when the 30-second timer fires before the WASM dispatcher responds, the pool shuts down, or the context is cancelled. warpc drives Hugo's out-of-process/WASM image codecs (webp, avif) and this guards every call against a hung plugin.","triggerScenarios":"Encoding/decoding an image via a warpc codec whose WASM call does not return within 30s — e.g. an extremely large image, a deadlock in the plugin, or the host process being starved.","commonSituations":"Processing a very large or deeply animated source image through |webp or the avif pipeline on a constrained machine, or a corrupted WASM binary that hangs on init.","solutions":["Reduce the input image dimensions (resize before encode) to keep the codec under the 30s budget.","Check system load/memory; the WASM codec may be starved or swapping.","Retry the build; transient host contention can produce a one-off timeout.","If recurring, rebuild/reinstall the Hugo binary so the bundled WASM codecs are intact."],"exampleFix":"// before\n{{ $img = resources.Get | fingerprint }}\n{{ $webp = $img.Resize \"6000x\" }}\n// after (smaller workload)\n{{ $webp = $img.Resize \"1600x webp\" }}","handlingStrategy":"retry","validationCode":"// Cap image workload before encode so the codec stays well under 30s.\n// Resize to <= ~4000px per side for webp before further processing.","typeGuard":null,"tryCatchPattern":"// Retry transient timeouts once; report persistent ones.\n// err = codec.Encode(...); if errors.Is(err, ...) or strings.Contains(err.Error(), \"timeout\") { retry }","preventionTips":["Pre-size large images before passing to webp/avif.","Monitor host CPU/memory during heavy image builds.","Don't bundle suspect custom WASM codecs; use the shipped ones."],"tags":["wasm","timeout","image","warpc"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}