siyuan-note/siyuan · error

Vault paths differ only by letter case

Error message

Vault paths differ only by letter case [%s] and [%s]

What it means

Two paths in the Vault differ only by letter case (e.g. `Notes/readme.md` and `Notes/README.md`), which maps to the same case-insensitive key in the internal file index. Since SiYuan storage is case-sensitive and such vaults are ambiguous (common on case-insensitive filesystems), the import aborts instead of guessing which file wins.

Solutions

  1. In the vault, rename one of the two reported files so their paths differ beyond letter case
  2. Search the vault for case-duplicates (git users: `git config core.ignoreCase false` and list variants)
  3. If the duplicate came from a sync tool, reconcile it there before re-importing
  4. On case-sensitive systems hosting a vault copied from Windows/macOS, deduplicate before import

Example fix

// vault content before
Notes/readme.md
Notes/README.md
// after renaming one
Notes/readme.md
Notes/about.md
Defensive patterns

Strategy: validation

Validate before calling

const seen = new Map();
for (const f of vaultFiles) {
  const key = f.path.toLowerCase();
  if (seen.has(key) && seen.get(key) !== f.path) {
    throw new Error(`Case-only duplicate: ${seen.get(key)} vs ${f.path}`);
  }
  seen.set(key, f.path);
}

Prevention

When it happens

Trigger: scanObsidianVaultFiles registers a file under key obsidianPathKey(rel) and finds an existing entry with a different but case-only-different RelPath — only possible when the underlying filesystem treats paths case-insensitively while storing mixed-case names.

Common situations: macOS/Windows vaults containing files like `TODO.md` and `todo.md` in the same folder (created via different tools, cloud sync, or git with case-only renames); sync clients that resurrect both spellings.

Understand the failure class

Background: "already exists" / EEXIST / FileAlreadyExistsException: what the 'file already exists' error means and how to fix it — this error's family across 37 libraries.

Related errors


AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19). Data as JSON: /api/errors/a7d8a0049e1642fe. Report an issue: GitHub.

Appendix: source

Thrown at kernel/model/import_obsidian.go:655

					continue
				}
			}
			if err = scanObsidianVaultFiles(ctx, vault, rel, abs); err != nil {
				return err
			}
			continue
		}
		if !isObsidianImportableFileMode(entryInfo.Mode()) {
			vault.Analysis.SkippedSpecialCount++
			continue
		}

		ext := strings.ToLower(filepath.Ext(name))
		isMD := ext == ".md"
		file := &obsidianSourceFile{RelPath: rel, AbsPath: abs, Size: entryInfo.Size(), ModTime: entryInfo.ModTime(), IsMD: isMD}
		key := obsidianPathKey(rel)
		if existing := vault.Files[key]; existing != nil && existing.RelPath != rel {
			return fmt.Errorf("Vault paths differ only by letter case [%s] and [%s]", existing.RelPath, rel)
		}
		vault.Files[key] = file
		if !isMD {
			finalName := util.AssetName(util.FilterUploadFileName(filepath.Base(rel)), ast.NewNodeID())
			vault.Assets[key] = &obsidianAssetPlan{Source: file, FinalName: finalName}
		}
	}
	return nil
}

func isObsidianImportableFileMode(mode fs.FileMode) bool {
	return mode.IsRegular()
}

func isObsidianResolvedLink(p string) bool {
	resolved, err := filepath.EvalSymlinks(p)
	return err == nil && !sameObsidianPath(filepath.Clean(p), filepath.Clean(resolved))
}

View on GitHub (pinned to 9f775e8a12)