kovidgoyal/kitty · error
failed to export introspected methods with error
Error message
failed to export introspected methods with error: %w
What it means
Raised by Portal.ExportInterface when conn.Export fails to export the org.freedesktop.DBus.Introspectable interface built from the generated introspection node. This is the final export step after methods and properties.
Solutions
- Check for other running desktop-ui/portal processes on the session bus
- Ensure Start() is called only once per Portal instance
- Inspect the wrapped error from godbus for details
- Retry after restarting the session bus if it was interrupted
Defensive patterns
Strategy: try-catch
Try / catch
if err := portal.Start(); err != nil {
log.Fatalf("portal startup failed: %v", err)
} Prevention
- Treat any Start() failure as fatal for the server loop
- Restart cleanly rather than retrying on a broken connection
When it happens
Trigger: The introspectable interface cannot be exported, typically because the connection is broken or the object path already hosts an introspectable implementation.
Common situations: Bus connection closed mid-setup; another portal backend already owning overlapping paths; concurrent Start() calls.
Related errors
- can't register D-Bus name: name already taken
- could not connect to session D-Bus
- failed to connect to system bus with error
- failed to export interface
- failed to export properties with error
AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27).
Data as JSON: /api/errors/93323677c44dea11.
Report an issue: GitHub.
Appendix: source
Thrown at kittens/desktop_ui/portal.go:178
})
}
}
interface_data := introspect.Interface{
Name: interface_name,
Methods: methods,
Properties: properties,
Signals: signals,
}
interfaces := []introspect.Interface{
introspect.IntrospectData, interface_data,
}
if len(properties) > 0 {
interfaces = append(interfaces, prop.IntrospectData)
}
n := &introspect.Node{Name: object_path, Interfaces: interfaces}
if err = conn.Export(introspect.NewIntrospectable(n), op, introspect.IntrospectData.Name); err != nil {
return fmt.Errorf("failed to export introspected methods with error: %w", err)
}
return
}
func (self *Portal) Start() (err error) {
if self.bus, err = dbus.SessionBus(); err != nil {
return fmt.Errorf("could not connect to session D-Bus: %s", err)
}
reply, err := self.bus.RequestName(PORTAL_BUS_NAME, dbus.NameFlagDoNotQueue)
if err != nil {
return fmt.Errorf("failed to register dbus name: %v", err)
}
if reply != dbus.RequestNameReplyPrimaryOwner {
return fmt.Errorf("can't register D-Bus name: name already taken")
}
props := PropSpec{
"version": {Value: uint32(1), Writable: false, Emit: prop.EmitFalse},
}View on GitHub (pinned to 6d5d0c4406)