siyuan-note/siyuan · error

parse created [%s] failed: %w

Error message

parse created [%s] failed: %w

What it means

Error "parse created [%s] failed: %w" thrown in siyuan-note/siyuan.

Source

Thrown at kernel/model/attribute_view_render.go:1076

	}
	if len(matches) != 1 {
		return "", fmt.Errorf("attribute view snapshot context is ambiguous [%s]", avID)
	}
	boxID := avBoxIDFromRepoPath(matches[0].Path)
	if IsEncryptedBox(boxID) {
		return boxID, nil
	}
	return "", nil
}

// ResolveHistoryAttributeViewBoxID 返回历史属性视图的唯一加密笔记本上下文。
func ResolveHistoryAttributeViewBoxID(avID, created string) (string, error) {
	if !ast.IsNodeIDPattern(avID) {
		return "", ErrInvalidID
	}
	createdUnix, err := strconv.ParseInt(created, 10, 64)
	if err != nil {
		return "", fmt.Errorf("parse created [%s] failed: %w", created, err)
	}
	dirPrefix := time.Unix(createdUnix, 0).Format("2006-01-02-150405")
	matches, err := filepath.Glob(filepath.Join(util.HistoryDir, dirPrefix+"*"))
	if err != nil {
		return "", err
	}
	var boxIDs []string
	for _, historyDir := range matches {
		if gulu.File.IsExist(filepath.Join(historyDir, "storage", "av", avID+".json")) {
			boxIDs = append(boxIDs, "")
		}
		entries, _ := os.ReadDir(historyDir)
		for _, entry := range entries {
			if !entry.IsDir() || !ast.IsNodeIDPattern(entry.Name()) {
				continue
			}
			candidate := filepath.Join(historyDir, entry.Name(), "storage", "av", avID+".json")
			if gulu.File.IsExist(candidate) {

View on GitHub (pinned to 251596fc0d)

Solutions

  1. Ensure the snapshot's created timestamp is a valid date/time string.
  2. If the snapshot data is corrupted, restore the attribute view from an earlier history or re-create it.

Example fix

Fix the 'created' value in the snapshot data to a parseable timestamp such as 2024-01-01 10:00:00.

When it happens

Trigger: Loading an attribute view snapshot whose created-time field cannot be parsed.

Common situations: Occurs when an attribute view snapshot contains a created timestamp that cannot be parsed, usually from a corrupted or hand-edited snapshot file.


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