Tencent/WeKnora · error

anydoc: binding not built into this binary

Error message

anydoc: binding not built into this binary

What it means

Sentinel error returned by anydoc Convert when the cgo/native anydoc binding was not linked into the compiled binary. It fires unconditionally at the top of Convert via backendAvailable(); the wrapped backendUnavailableReason() explains why (e.g. build tag or missing shared library).

Source

Thrown at internal/infrastructure/docparser/anydoc/anydoc.go:80

	Section string
}

// Options tunes a single conversion.
type Options struct {
	// Format names the parser explicitly ("docx", "csv", ...). Empty means
	// the format is detected from the content, which every format except
	// CSV carries a signature for.
	Format string
	// WithAssets extracts embedded images and renders them in place in the
	// markdown using anydoc's official GFM serializer (asset images are
	// rewritten to `images/image-N.ext` links first). Ignored for PDF.
	WithAssets bool
}

// ErrUnavailable is returned by Convert when the binding is not linked into
// this build. Callers that can fall back to another engine should check for it
// with errors.Is.
var ErrUnavailable = errors.New("anydoc: binding not built into this binary")

// supportedExtensions are the file types anydoc converts, mapped to the format
// name its parser selector uses. The list is static so that engine metadata
// (file types shown in the UI) is identical whether or not the binding is
// linked in.
var supportedExtensions = map[string]string{
	"doc":  "doc",
	"docx": "docx",
	"docm": "docx",
	"odt":  "odt",
	"rtf":  "rtf",
	"ppt":  "ppt",
	"pptx": "pptx",
	"pptm": "pptx",
	"odp":  "odp",
	"xls":  "xlsx",
	"xlsx": "xlsx",
	"xlsm": "xlsx",

View on GitHub (pinned to 988cbb0330)

Solutions

  1. Rebuild the binary with the anydoc build tag / CGO enabled so the native parser binding is linked in
  2. Install the anydoc native library the binding expects and ensure it is on the library path
  3. Check backendUnavailableReason() output in the wrapped error for the specific build deficiency
  4. Route document conversion to a build/deployment that includes the anydoc binding
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at internal/infrastructure/docparser/anydoc/anydoc.go:80 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Tencent/WeKnora@988cbb0330 (2026-09-02). Data as JSON: /api/errors/21a266aee1f5a8f3. Report an issue: GitHub.