Skip to content

Error caused by dbus.Error with invalid name is unhandled #396

@alexg-axis

Description

@alexg-axis

I recently debugged an issue where a client would never receive a response from a method call if said method call returned a dbus.Error. The client would basically just time out.

I attached a debugger and started looking for the cause and found this:

  1. An error is returned when encoding the error

return err

  1. The error bubbles

dbus/conn.go

Line 807 in e523abc

return h.conn.SendMessage(msg)

  1. The error bubbles

dbus/conn.go

Line 495 in e523abc

err := conn.outHandler.sendAndIfClosed(msg, ifClosed)

  1. The error bubbles

dbus/conn.go

Line 503 in e523abc

func (conn *Conn) handleSendError(msg *Message, err error) {

  1. The error is silently dropped

dbus/conn.go

Line 511 in e523abc

conn.serialGen.RetireSerial(msg.serial)

The cause was that the error's name was not a valid name. It was akin to failed to perform method rather than org.freedesktop.DBus.Error.InvalidArgs.

For v6 I suggest for that validation to happen in dbus.NewError, with an error returned if it fails. But for v5 it would be really nice to surface this error one way or another.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions