{"record":{"id":"07f9b643dfe857db","repo":"siyuan-note/siyuan","slug":"send-article-to-liandi-failed-liandi-server-resp","errorCode":null,"errorMessage":"send article to liandi failed: <liandi server response message>","messagePattern":"send article to liandi failed: <liandi server response message>","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/export.go","lineNumber":484,"sourceCode":"\t\t\tresp, sendErr = request.Put(apiURL)\n\t\t} else {\n\t\t\tresp, sendErr = request.Post(apiURL)\n\t\t}\n\t\tif nil != sendErr {\n\t\t\tlogging.LogErrorf(\"send article to liandi failed: %s\", sendErr)\n\t\t\treturn sendErr\n\t\t}\n\t\tif 200 != resp.StatusCode {\n\t\t\tmsg := fmt.Sprintf(\"send article to liandi failed [sc=%d]\", resp.StatusCode)\n\t\t\tlogging.LogError(msg)\n\t\t\treturn errors.New(msg)\n\t\t}\n\n\t\tif 0 != result.Code {\n\t\t\tmsg := fmt.Sprintf(\"send article to liandi failed [code=%d, msg=%s]\", result.Code, result.Msg)\n\t\t\tlogging.LogError(msg)\n\t\t\tutil.PushClearMsg(msgId)\n\t\t\treturn errors.New(result.Msg)\n\t\t}\n\n\t\tif !foundArticle {\n\t\t\tarticleId = result.Data.(string)\n\t\t\ttree, _ = LoadTreeByBlockID(id) // 这里必须重新加载，因为前面导出时已经修改了树结构\n\t\t\ttree.Root.SetIALAttr(liandiArticleIdAttrName, articleId)\n\t\t\tif err = writeTreeUpsertQueue(tree); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tutil.PushMsg(fmt.Sprintf(Conf.Language(181), util.GetCloudAccountServer()+\"/article/\"+articleId), 7000)\n\t\treturn nil\n\t})\n\treturn\n}\n\nfunc ExportSystemLog() (zipPath string) {","sourceCodeStart":466,"sourceCodeEnd":502,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/model/export.go#L466-L502","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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.","If the message indicates size limits, split the document or remove embedded assets before sending.","If the message indicates a title conflict or permission issue, resolve it on the forum side first.","If the article-id is stale/owned-by-another, clear custom-liandi-articleid so a fresh article is created."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// result.Msg is returned verbatim; log code+msg from the wrapper to branch\nif err := model.Export2Liandi(id); err != nil {\n    logging.LogErrorf(\"liandi business error: %s\", err.Error())\n    // inspect err.Error() which equals result.Msg; advise user based on content\n}","preventionTips":["Keep articles under the forum size limit; split large docs.","Avoid duplicate titles across your forum articles.","Strip forbidden tags before sending.","Log result.Code/result.Msg (export.go:481) to diagnose the exact rejection."],"tags":["liandi","export","business-error","validation"],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}