siyuan-note/siyuan · error

result.Msg

Error message

result.Msg

What it means

liandi answered HTTP 200 but with a non-zero business result code; the kernel returns result.Msg directly (the log line 'send article to liandi failed [code=..., msg=...]' carries both). The text is whatever the liandi API reported, e.g. invalid title, content rejected, or posting frequency limit.

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 afa823b6b4)

Solutions

  1. Act on the returned message text: shorten the title/content or wait out the frequency limit, then retry
  2. If updates keep failing, remove the doc's liandi article id attribute to force a fresh POST instead of PUT
  3. Check the article on ld246.com in a browser to see its actual state
Defensive patterns

Strategy: try-catch

Try / catch

if result.Code != 0 {
    switch {
    case strings.Contains(result.Msg, "frequency"), strings.Contains(result.Msg, "频率"):
        // wait and retry later
    default:
        // surface result.Msg to the user for content fixes
    }
}

Prevention

When it happens

Trigger: Article content or title violates liandi validation rules; posting too frequently; the account lacking permission to publish; a stale liandiArticleIdAttrName pointing at an article that no longer exists.

Common situations: Very long markdown docs; rapid re-shares after edits; special characters or over-long titles; previously deleted article on the forum while the doc still stores its ID.

Related errors


AI-assisted analysis of siyuan-note/siyuan@afa823b6b4 (2026-08-18). Data as JSON: /api/errors/b518170b82d94d1a. Report an issue: GitHub.