siyuan-note/siyuan · error

send article to liandi failed: <liandi server response messa

Error message

send article to liandi failed: <liandi server response message>

What it means

Raised inside Export2Liandi when the liandi server answers HTTP 200 but the structured response body carries a non-zero result.Code (business-level error). The server's own result.Msg string is returned verbatim as the error, so the message content varies — it is the forum's application-level rejection reason (e.g. content too long, duplicate title, banned word, insufficient permission). Unlike error 660 this is a successful transport that failed validation server-side.

Source

Thrown at kernel/model/export.go:484

			resp, sendErr = request.Put(apiURL)
		} else {
			resp, sendErr = request.Post(apiURL)
		}
		if nil != sendErr {
			logging.LogErrorf("send article to liandi failed: %s", sendErr)
			return sendErr
		}
		if 200 != resp.StatusCode {
			msg := fmt.Sprintf("send article to liandi failed [sc=%d]", resp.StatusCode)
			logging.LogError(msg)
			return errors.New(msg)
		}

		if 0 != result.Code {
			msg := fmt.Sprintf("send article to liandi failed [code=%d, msg=%s]", result.Code, result.Msg)
			logging.LogError(msg)
			util.PushClearMsg(msgId)
			return errors.New(result.Msg)
		}

		if !foundArticle {
			articleId = result.Data.(string)
			tree, _ = LoadTreeByBlockID(id) // 这里必须重新加载,因为前面导出时已经修改了树结构
			tree.Root.SetIALAttr(liandiArticleIdAttrName, articleId)
			if err = writeTreeUpsertQueue(tree); err != nil {
				return err
			}
		}

		util.PushMsg(fmt.Sprintf(Conf.Language(181), util.GetCloudAccountServer()+"/article/"+articleId), 7000)
		return nil
	})
	return
}

func ExportSystemLog() (zipPath string) {

View on GitHub (pinned to 251596fc0d)

Solutions

  1. Read result.Msg in the kernel log (export.go:481 logs the full [code, msg]) to get the exact server-side reason and act on it.
  2. If the message indicates size limits, split the document or remove embedded assets before sending.
  3. If the message indicates a title conflict or permission issue, resolve it on the forum side first.
  4. If the article-id is stale/owned-by-another, clear custom-liandi-articleid so a fresh article is created.
Defensive patterns

Strategy: try-catch

Try / catch

// result.Msg is returned verbatim; log code+msg from the wrapper to branch
if err := model.Export2Liandi(id); err != nil {
    logging.LogErrorf("liandi business error: %s", err.Error())
    // inspect err.Error() which equals result.Msg; advise user based on content
}

Prevention

When it happens

Trigger: POST /api/export/export2Liandi succeeds at the HTTP layer but the article content exceeds the forum's length limit, the title collides with an existing article the user does not own, the tags contain forbidden terms, or the account lacks posting privileges. Also surfaces when uploading assets failed earlier but the article endpoint reports the downstream error.

Common situations: Exporting a very large document whose Markdown exceeds liandi's article size cap. The account was restricted/banned on the forum. A duplicate article title exists. The custom-liandi-articleid attribute points to an article owned by a different account.

Related errors


AI-assisted analysis of siyuan-note/siyuan@251596fc0d (2026-08-12). Data as JSON: /api/errors/07f9b643dfe857db. Report an issue: GitHub.