siyuan-note/siyuan · error

Conf.Language(47)

Error message

Conf.Language(47)

What it means

UninstallPackage calls bazaar.UninstallPackage to delete the package directory; when that OS-level removal fails (permission denied, files locked, read-only volume), the error is wrapped with localized message Conf.Language(47) containing the underlying error string.

Solutions

  1. Read the underlying cause embedded in the localized message (e.g. 'file in use', 'access denied')
  2. Disable/switch away from the plugin/theme/icon, then retry the uninstall
  3. Fix permissions on the workspace package directory (chown/chmod or take ownership on Windows)
  4. Retry after closing other processes (AV scans, editors, sync clients) that hold handles

Example fix

// before
if err := model.UninstallPackage("themes", name); err != nil { return err }
// after: disable theme before uninstall
model.Conf.Appearance.ThemeDark = "" // switch away from the theme first, save conf
if err := model.UninstallPackage("themes", name); err != nil {
    logging.LogErrorf("uninstall %s failed: %v", name, err)
    return err
}
Defensive patterns

Strategy: try-catch

Validate before calling

// check writability of the install dir first
probe := filepath.Join(installPath, ".write-test")
if err := os.WriteFile(probe, nil, 0o644); err != nil { return fmt.Errorf("not writable: %w", err) }
os.Remove(probe)

Try / catch

err := model.UninstallPackage(pkgType, name)
if err != nil {
  // err embeds Conf.Language(47) with the OS cause
  logging.LogErrorf("uninstall %s: %v", name, err)
  return promptUserToDisableAndRetry(err)
}

Prevention

When it happens

Trigger: Uninstalling while the theme/icon is applied or the plugin is loaded and its files are open; workspace on a read-only or network mount; Windows AV/indexer holding a handle on files in the package directory; insufficient user permissions on the workspace path.

Common situations: Windows 'file in use' on an active theme's assets; Linux workspace owned by another user after running SiYuan with sudo once; disk errors; Docker volumes mounted read-only.

Understand the failure class

Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.

Related errors


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

Appendix: source

Thrown at kernel/model/bazaar.go:714

	return "", errors.New("installed package not found")
}

func UninstallPackage(pkgType, packageName string) error {
	installPath, err := getPackageUninstallPath(pkgType, packageName)
	if err != nil {
		return err
	}

	if pkgType == "plugins" {
		pluginPublishLock.Lock()
		defer pluginPublishLock.Unlock()
		if err = removePluginPublishData(packageName); err != nil {
			return err
		}
	}
	err = bazaar.UninstallPackage(installPath)
	if err != nil {
		return fmt.Errorf(Conf.Language(47), err.Error())
	}

	// 删除集市包的持久化信息
	bazaar.RemovePackageInfo(pkgType, packageName)
	bazaar.RemoveInstalledPackageSizeCache(pkgType, packageName)

	switch pkgType {
	case "plugins":
		petals := getPetals()
		var tmp []*Petal
		for i, petal := range petals {
			if petal.Name != packageName {
				tmp = append(tmp, petals[i])
			}
		}
		petals = tmp
		savePetals(petals)

View on GitHub (pinned to 9f775e8a12)