siyuan-note/siyuan · error

Conf.Language(14) (pandoc output: %s)

Error message

Conf.Language(14) (pandoc output: %s)

What it means

During docx export, SiYuan pipes Markdown content into the Pandoc process and reads its combined output. If Pandoc exits non-zero, the localized template Conf.Language(14) ('Export failed: %s') is filled with Pandoc's stderr/stdout message and returned. The raw message is also logged via logging.LogErrorf.

Source

Thrown at kernel/model/export.go:1162

		filterPath, filterErr := writePandocDocxFilter(tmpDir)
		if nil != filterErr {
			return filterErr
		}
		args = appendBuiltinPandocDocxFilter(args, filterPath)

		if !hasPandocOption(args, "--reference-doc") && "" != pandocRuntime.TemplatePath {
			args = append(args, "--reference-doc", pandocRuntime.TemplatePath)
		}

		pandoc := exec.Command(pandocRuntime.BinPath, args...)
		gulu.CmdAttr(pandoc)
		pandoc.Stdin = bytes.NewBufferString(content)
		output, pandocErr := pandoc.CombinedOutput()
		if pandocErr != nil {
			argStr := strings.Join(args, " ")
			msg := gulu.DecodeCmdOutput(output)
			logging.LogErrorf("export docx [%s] failed: %s", argStr, msg)
			return fmt.Errorf(Conf.Language(14), msg)
		}

		fullPath = filepath.Join(savePath, name+".docx")
		fullPath = util.GetUniqueFilename(fullPath)
		if copyErr := filelock.Copy(tmpDocxPath, fullPath); copyErr != nil {
			logging.LogErrorf("export docx failed: %s", copyErr)
			return fmt.Errorf(Conf.Language(14), copyErr)
		}

		if tmpAssets := filepath.Join(tmpDir, "assets"); !removeAssets && gulu.File.IsDir(tmpAssets) {
			if copyErr := filelock.Copy(tmpAssets, filepath.Join(savePath, "assets")); copyErr != nil {
				logging.LogErrorf("export docx failed: %s", copyErr)
				return fmt.Errorf(Conf.Language(14), copyErr)
			}
		}
		return nil
	})
	if err != nil {

View on GitHub (pinned to 8641553a1f)

Solutions

  1. Read the %s portion of the error — it contains Pandoc's own output; fix the documented Pandoc issue.
  2. Check kernel logs (logging.LogErrorf 'export docx ... failed') for the full Pandoc message and args.
  3. Upgrade or downgrade Pandoc to a version compatible with the SiYuan-exported arguments.
  4. Retry export after removing recently added unusual content (embeds, exotic blocks) to isolate the failing construct.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  await exportDocx({id, savePath});
} catch (e) {
  // e.msg contains Pandoc's own output; surface it to the user
  showExportError(e.msg);
}

Prevention

When it happens

Trigger: ExportDocx conversion step: pandoc.CombinedOutput() returns an error, e.g. unsupported Markdown construct, invalid Pandoc arguments, corrupted input content, or the Pandoc process crashes mid-conversion.

Common situations: Pandoc version mismatch producing unrecognized CLI flags; documents with constructs Pandoc cannot convert; memory exhaustion while converting very large documents; locale/encoding issues on the host.

Related errors


AI-assisted analysis of siyuan-note/siyuan@8641553a1f (2026-09-11). Data as JSON: /api/errors/46d6a40a28adc7d3. Report an issue: GitHub.