{"record":{"id":"966d2602cdb985a5","repo":"kovidgoyal/kitty","slug":"failed-to-register-dbus-name-v","errorCode":null,"errorMessage":"failed to register dbus name: %v","messagePattern":"failed to register dbus name: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kittens/desktop_ui/portal.go","lineNumber":189,"sourceCode":"\t\tintrospect.IntrospectData, interface_data,\n\t}\n\tif len(properties) > 0 {\n\t\tinterfaces = append(interfaces, prop.IntrospectData)\n\t}\n\tn := &introspect.Node{Name: object_path, Interfaces: interfaces}\n\tif err = conn.Export(introspect.NewIntrospectable(n), op, introspect.IntrospectData.Name); err != nil {\n\t\treturn fmt.Errorf(\"failed to export introspected methods with error: %w\", err)\n\t}\n\treturn\n}\n\nfunc (self *Portal) Start() (err error) {\n\tif self.bus, err = dbus.SessionBus(); err != nil {\n\t\treturn fmt.Errorf(\"could not connect to session D-Bus: %s\", err)\n\t}\n\treply, err := self.bus.RequestName(PORTAL_BUS_NAME, dbus.NameFlagDoNotQueue)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to register dbus name: %v\", err)\n\t}\n\tif reply != dbus.RequestNameReplyPrimaryOwner {\n\t\treturn fmt.Errorf(\"can't register D-Bus name: name already taken\")\n\t}\n\tprops := PropSpec{\n\t\t\"version\": {Value: uint32(1), Writable: false, Emit: prop.EmitFalse},\n\t}\n\tsignals := SignalSpec{\n\t\t\"SettingChanged\": {{\"namespace\", \"s\"}, {\"key\", \"s\"}, {\"value\", \"v\"}},\n\t}\n\tmethods := MethodSpec{\n\t\t\"Read\":    {{\"namespace\", \"s\", false}, {\"key\", \"s\", false}, {\"value\", \"v\", true}},\n\t\t\"ReadAll\": {{\"namespaces\", \"as\", false}, {\"value\", \"a{sa{sv}}\", true}},\n\t}\n\tif err = ExportInterface(self.bus, self, SETTINGS_INTERFACE, DESKTOP_OBJECT_PATH, methods, props, signals); err != nil {\n\t\treturn\n\t}\n\tmethods = MethodSpec{","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/desktop_ui/portal.go#L171-L207","documentation":"Portal.Start wraps the error returned by bus.RequestName for PORTAL_BUS_NAME when the request itself errors (not merely queued). This indicates a transport-level failure talking to the bus daemon.","triggerScenarios":"RequestName fails because the connection was closed after SessionBus() succeeded, or the bus daemon rejected the call.","commonSituations":"Bus daemon crashed or restarted between connect and name request; flaky socket transport; the process was signaled mid-startup.","solutions":["Check the wrapped %v error for the transport cause","Restart the session bus daemon (systemctl --user restart dbus) and retry","Confirm no firewall/permission issues on abstract sockets in containers"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"var err error\nfor i := 0; i < 3; i++ {\n    if err = portal.Start(); err == nil || !strings.Contains(err.Error(), \"failed to register dbus name\") {\n        break\n    }\n    time.Sleep(200 * time.Millisecond)\n}","preventionTips":["Restart the session bus before retrying","Check bus daemon health before startup"],"tags":["dbus","desktop-ui","kitty","connection"],"backgroundTag":"dbus-name-request-failed","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}