{"record":{"id":"18efd6dd399071bc","repo":"kovidgoyal/kitty","slug":"failed-to-read-response-from-readall-with-error","errorCode":null,"errorMessage":"Failed to read response from ReadAll with error: %w","messagePattern":"Failed to read response from ReadAll with error: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kittens/desktop_ui/portal.go","lineNumber":269,"sourceCode":"\treturn ParseValueWithSignature(value, \"\")\n}\n\ntype ShowSettingsOptions struct {\n\tAsJson             bool\n\tAllowOtherBackends bool\n\tInNamespace        []string\n}\n\nfunc fetch_settings(conn *dbus.Conn, namespaces ...string) (ans ReadAllType, err error) {\n\tpath := \"/\" + strings.ToLower(strings.ReplaceAll(DESKTOP_PORTAL_NAME, \".\", \"/\"))\n\tobj := conn.Object(DESKTOP_PORTAL_NAME, dbus.ObjectPath(path))\n\tinterface_name := strings.ReplaceAll(DESKTOP_PORTAL_NAME, \"Desktop\", \"Settings\")\n\tif len(namespaces) == 0 {\n\t\tnamespaces = append(namespaces, \"\")\n\t}\n\tcall := obj.Call(interface_name+\".ReadAll\", dbus.FlagNoAutoStart, namespaces)\n\tif err = call.Store(&ans); err != nil {\n\t\treturn nil, fmt.Errorf(\"Failed to read response from ReadAll with error: %w\", err)\n\t}\n\treturn\n}\n\nfunc show_settings(opts *ShowSettingsOptions) (err error) {\n\tconn, err := dbus.SessionBus()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to connect to system bus with error: %w\", err)\n\t}\n\tdefer conn.Close()\n\tvar response ReadAllType\n\tresponse, err = fetch_settings(conn, opts.InNamespace...)\n\tif opts.AsJson {\n\t\tunwrapped := make(map[string]map[string]any, len(response))\n\t\tfor ns, m := range response {\n\t\t\tw := make(map[string]any, len(m))\n\t\t\tfor k, a := range m {\n\t\t\t\tw[k] = a.Value()","sourceCodeStart":251,"sourceCodeEnd":287,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/desktop_ui/portal.go#L251-L287","documentation":"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.","triggerScenarios":"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.","commonSituations":"Minimal window managers without xdg-desktop-portal installed; the portal service not started; running in SSH/containers where the portal is unreachable.","solutions":["Ensure xdg-desktop-portal is installed and running (systemctl --user status xdg-desktop-portal)","Enable the kitty backend: kitten desktop-ui enable, then restart the portal","Check the wrapped error: 'NoSuchObject' or 'UnknownMethod' indicates the settings interface is missing","Verify DBUS_SESSION_BUS_ADDRESS points at the graphical session's bus"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// check the portal is reachable first\nobj := conn.Object(\"org.freedesktop.portal.Desktop\", \"/org/freedesktop/portal/desktop\")\nif err := obj.Call(\"org.freedesktop.DBus.Peer.Ping\", 0).Err; err != nil {\n    return errors.New(\"no desktop portal available\")\n}","typeGuard":null,"tryCatchPattern":"settings, err := fetch_settings(conn, ns)\nif err != nil {\n    if strings.Contains(err.Error(), \"ReadAll\") {\n        // portal missing/down: guide user to start xdg-desktop-portal\n    }\n}","preventionTips":["Verify xdg-desktop-portal is running before reading settings","Enable the kitty backend and restart the portal service"],"tags":["dbus","xdg-desktop-portal","desktop-ui","settings"],"backgroundTag":"portal-readall-failed","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}