kovidgoyal/kitty · error

Failed to read response from ReadAll with error: %w

Error message

Failed to read response from ReadAll with error: %w

What it means

fetch_settings calls the org.freedesktop.portal.Settings.ReadAll method over D-Bus; if the call fails (call.Store error) — no portal running, unknown namespace handling, or transport failure — this wrapped error is returned.

Source

Thrown at kittens/desktop_ui/portal.go:269

	return ParseValueWithSignature(value, "")
}

type ShowSettingsOptions struct {
	AsJson             bool
	AllowOtherBackends bool
	InNamespace        []string
}

func fetch_settings(conn *dbus.Conn, namespaces ...string) (ans ReadAllType, err error) {
	path := "/" + strings.ToLower(strings.ReplaceAll(DESKTOP_PORTAL_NAME, ".", "/"))
	obj := conn.Object(DESKTOP_PORTAL_NAME, dbus.ObjectPath(path))
	interface_name := strings.ReplaceAll(DESKTOP_PORTAL_NAME, "Desktop", "Settings")
	if len(namespaces) == 0 {
		namespaces = append(namespaces, "")
	}
	call := obj.Call(interface_name+".ReadAll", dbus.FlagNoAutoStart, namespaces)
	if err = call.Store(&ans); err != nil {
		return nil, fmt.Errorf("Failed to read response from ReadAll with error: %w", err)
	}
	return
}

func show_settings(opts *ShowSettingsOptions) (err error) {
	conn, err := dbus.SessionBus()
	if err != nil {
		return fmt.Errorf("failed to connect to system bus with error: %w", err)
	}
	defer conn.Close()
	var response ReadAllType
	response, err = fetch_settings(conn, opts.InNamespace...)
	if opts.AsJson {
		unwrapped := make(map[string]map[string]any, len(response))
		for ns, m := range response {
			w := make(map[string]any, len(m))
			for k, a := range m {
				w[k] = a.Value()

View on GitHub (pinned to 6d5d0c4406)

Solutions

  1. Ensure xdg-desktop-portal is installed and running (systemctl --user status xdg-desktop-portal)
  2. Enable the kitty backend: kitten desktop-ui enable, then restart the portal
  3. Check the wrapped error: 'NoSuchObject' or 'UnknownMethod' indicates the settings interface is missing
  4. Verify DBUS_SESSION_BUS_ADDRESS points at the graphical session's bus
Defensive patterns

Strategy: try-catch

Validate before calling

// check the portal is reachable first
obj := conn.Object("org.freedesktop.portal.Desktop", "/org/freedesktop/portal/desktop")
if err := obj.Call("org.freedesktop.DBus.Peer.Ping", 0).Err; err != nil {
    return errors.New("no desktop portal available")
}

Try / catch

settings, err := fetch_settings(conn, ns)
if err != nil {
    if strings.Contains(err.Error(), "ReadAll") {
        // portal missing/down: guide user to start xdg-desktop-portal
    }
}

Prevention

When it happens

Trigger: Calling show-settings or set-color-scheme when no xdg-desktop-portal backend is available, the portal crashed, or the D-Bus call returns an error reply.

Common situations: Minimal window managers without xdg-desktop-portal installed; the portal service not started; running in SSH/containers where the portal is unreachable.

Related errors


AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27). Data as JSON: /api/errors/18efd6dd399071bc. Report an issue: GitHub.