gohugoio/hugo · error

{}

Error message

{}

What it means

Returned by dispatcherPool.Execute in internal/warpc/warpc.go:257 when the WASM codec call completed but the response header carried a non-empty Err string. The {} placeholder is that remote error text — i.e. the codec (webp/avif/etc.) reported a failure of its own.

Source

Thrown at internal/warpc/warpc.go:257

	select {
	case call = <-call.donec:
	case <-p.donec:
		return d.zeroR, p.Err()
	case <-ctx.Done():
		return d.zeroR, ctx.Err()
	case <-timer.C:
		return d.zeroR, errors.New("timeout")
	}

	if call.err != nil {
		return d.zeroR, call.err
	}

	resp, err := call.response, p.Err()

	if err == nil && resp.Header.Err != "" {
		err = errors.New(resp.Header.Err)
	}

	return resp, err
}

func (d *dispatcher[Q, R]) newCall(q Message[Q]) (*call[Q, R], error) {
	if q.Header.ID == 0 {
		q.Header.ID = d.id.Add(1)
	}
	if err := q.init(); err != nil {
		return nil, err
	}
	responseKinds := maphelpers.NewConcurrentMap[string, bool]()
	for _, rk := range q.Header.ResponseKinds {
		responseKinds.Set(rk, true)
	}
	call := &call[Q, R]{
		donec:         make(chan *call[Q, R], 1),

View on GitHub (pinned to 52c9bd7908)

Solutions

  1. Inspect the full error text Hugo prints (the header Err) for the codec-specific reason.
  2. Validate the source image opens in a standard decoder before passing it to the Hugo pipeline.
  3. Re-encode the source (e.g. PNG/JPEG round-trip) to clear malformed metadata the codec rejects.
  4. Try a different output format to confirm whether the fault is codec-specific.

Example fix

// before
{{ $webp = $corruptImg.Resize "800x webp" }}
// after (validate first)
{{ $okImg = $corruptImg | fingerprint }}
{{ $webp = $okImg.Resize "800x webp" }}
Defensive patterns

Strategy: validation

Validate before calling

// Validate the source decodes cleanly before the warpc pipeline.
{{ $img := resources.Get "x.png" }}
{{ if not $img }}{{ errorf "source image missing" }}{{ end }}

Prevention

When it happens

Trigger: Any warpc codec invocation (image encode/decode/config) where the WASM plugin populates response.Header.Err — e.g. corrupt input bytes, unsupported color model, or an internal codec assertion.

Common situations: Feeding a truncated/corrupt image to the webp or avif codec, an unsupported pixel format, or a codec version that rejects the given parameters.

Related errors


AI-assisted analysis of gohugoio/hugo@52c9bd7908 (2026-08-09). Data as JSON: /api/errors/a06790ace10beb08. Report an issue: GitHub.