sipeed/picoclaw · critical

deltachat: rpc_server_path %q not found

Error message

deltachat: rpc_server_path %q not found

What it means

rpc_server_path was provided but after ~-expansion (expandHome) the file does not exist (fileExists/os.Stat failed). The configured path is treated as authoritative, so no PATH fallback occurs.

Source

Thrown at pkg/channels/deltachat/deltachat.go:1289

		logger.InfoCF("deltachat", "Joined invite chat", map[string]any{"chat_id": chatID})
	}
	return nil
}

// resolveServerPath validates the configured deltachat-rpc-server path, or
// falls back to deltachat-rpc-server on PATH.
func resolveServerPath(configured string) (string, error) {
	if configured == "" {
		p, err := exec.LookPath("deltachat-rpc-server")
		if err != nil {
			return "", fmt.Errorf("deltachat: deltachat-rpc-server not found on PATH " +
				"(set rpc_server_path to the binary path if it is installed elsewhere)")
		}
		return p, nil
	}
	p := expandHome(configured)
	if !fileExists(p) {
		return "", fmt.Errorf("deltachat: rpc_server_path %q not found", p)
	}
	return p, nil
}

// resolveDataDir picks where the account database lives.
func resolveDataDir(configured, channelName string) string {
	if configured != "" {
		return expandHome(configured)
	}
	home, err := os.UserHomeDir()
	if err != nil {
		home = "."
	}
	name := channelName
	if name == "" {
		name = config.ChannelDeltaChat
	}
	return filepath.Join(home, ".picoclaw", "deltachat", name)

View on GitHub (pinned to 49183d7e8d)

Solutions

  1. Correct rpc_server_path to the verified absolute path (`readlink -f $(which deltachat-rpc-server)`)
  2. Ensure the file is readable and executable by the service user
  3. Confirm with `ls -l <path>` under the same user

Example fix

# before
rpc_server_path: "~/bin/dc-server"

# after
rpc_server_path: "/home/bot/.cargo/bin/deltachat-rpc-server"
Defensive patterns

Strategy: validation

Validate before calling

p := expandHome(cfg.RPCServerPath)
if _, err := os.Stat(p); errors.Is(err, fs.ErrNotExist) {
    return fmt.Errorf("rpc_server_path %q does not exist; fix the channel config", p)
}

Try / catch

if err := ch.Start(ctx); err != nil {
    if strings.Contains(err.Error(), "rpc_server_path") && strings.Contains(err.Error(), "not found") {
        // config fix: correct the path, then restart
    }
    return err
}

Prevention

When it happens

Trigger: resolveServerPath(configured) with a typo'd path, a moved binary, or a '~' that expands to a different home than expected.

Common situations: Home-relative path set for user A but PicoClaw runs as user B; binary path changed after an upgrade; leading quote/space in the YAML value.

Related errors


AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15). Data as JSON: /api/errors/622c745a6074293c. Report an issue: GitHub.