{"record":{"id":"8801a54fe3b27b2d","repo":"siyuan-note/siyuan","slug":"send-article-to-liandi-failed-sc-d","errorCode":null,"errorMessage":"send article to liandi failed [sc=%d]","messagePattern":"send article to liandi failed \\[sc=(.+?)\\]","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/export.go","lineNumber":508,"sourceCode":"\t\t\tSetBody(map[string]any{\n\t\t\t\t\"articleTitle\":   title,\n\t\t\t\t\"articleTags\":    tags,\n\t\t\t\t\"articleContent\": content})\n\t\tvar resp *req.Response\n\t\tvar sendErr error\n\t\tif foundArticle {\n\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","sourceCodeStart":490,"sourceCodeEnd":526,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/export.go#L490-L526","documentation":"The kernel POSTs (or PUTs) the exported document to the Liandi article API. If the HTTP response status is not 200, it logs and returns errors.New(\"send article to liandi failed [sc=<status>]\"). The Liandi endpoint accepted the TCP/HTTP exchange but rejected the request at the HTTP status level.","triggerScenarios":"Calling Export2Liandi and the create/update article call returns a non-200 status: invalid or expired auth token, payload rejected (413/400), server 5xx, or proxy interference.","commonSituations":"Token expired mid-session; document too large or containing content Liandi rejects; Liandi server outage; network middleware rewriting the response.","solutions":["Re-login to Liandi to refresh credentials, then retry the export.","Inspect the reported status code: 401/403 -> auth, 4xx -> payload problem (try a smaller/simpler document), 5xx -> retry later.","Check network connectivity and any proxy between the kernel and Liandi.","Retry after confirming the Liandi service is healthy (the lookup call succeeded earlier)."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"send article to liandi failed [sc=\") {\n    // parse status code; on 5xx retry with backoff, on 401/403 re-authenticate\n}","preventionTips":["Re-authenticate with Liandi before large or repeated exports","Keep exported documents within size limits Liandi accepts","Retry on 5xx only; do not hammer on 4xx"],"tags":["network","liandi","http-status"],"backgroundTag":"http-error-response","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}