Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: No introspectable #222

Open
benfrancis opened this issue Jul 15, 2020 · 3 comments
Open

Error: No introspectable #222

benfrancis opened this issue Jul 15, 2020 · 3 comments

Comments

@benfrancis
Copy link

Is there a way to stop node-dbus from trying to open a gtkDialog to display an error message?

I'm working on a kiosk application running on top of Ubuntu Core, which doesn't have a full desktop environment and trying to open this dialog just crashes the application. I'd like to be able to fail more gracefully and handle the error myself.

More specifically, if the application tries to call

systemBus.getInterface('org.freedesktop.NetworkManager', '/org/freedesktop/NetworkManager', 'org.freedesktop.NetworkManager', callback);

but the application doesn't have permission to access the network manager, then node-dbus fires an error saying "Error: No introspectable" and I see an error saying "GtkDialog mapped without a transient parent. This is discouraged." and my application fails to start. I'd to prevent that error from trying to open a GtkDialog and handle it myself.

@benfrancis
Copy link
Author

I've discovered that this gtkDialog is actually being opened by Electron, due to an unhandled exception, so the dialog itself has nothing to do with node-dbus.

However, if there's a way to test whether a given interface is accessible before trying to call it (causing this unhandled exception), I'd be really grateful to find out as this is crashing my application.

@benfrancis benfrancis changed the title GtkDialog mapped without a transient parent. This is discouraged. Error: No introspectable Jul 17, 2020
@ErwinSteffens
Copy link

ErwinSteffens commented Jan 6, 2021

I have the same error. I have fixed the permissions. Any idea on what we are doing wrong here?

Here is the underlying error:

DBusError: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
    at new DBusError (/app/node_modules/dbus/lib/error.js:9:9)
    at createError (/app/node_modules/dbus/lib/bus.js:243:9) {
  dbusName: 'org.freedesktop.DBus.Error.NoReply'
}

Here are the message and response:

method call time=1609923796.324077 sender=:1.34 -> destination=org.freedesktop.timedate1 serial=3 path=/org/freedesktop/timedate1; interface=org.freedesktop.DBus.Introspectable; member=Introspect

method return time=1609923796.480598 sender=:1.36 -> destination=:1.34 serial=3 reply_serial=3
   string "<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
 <interface name="org.freedesktop.DBus.Peer">
  <method name="Ping"/>
  <method name="GetMachineId">
   <arg type="s" name="machine_uuid" direction="out"/>
  </method>
 </interface>
 <interface name="org.freedesktop.DBus.Introspectable">
  <method name="Introspect">
   <arg name="data" type="s" direction="out"/>
  </method>
 </interface>
 <interface name="org.freedesktop.DBus.Properties">
  <method name="Get">
   <arg name="interface" direction="in" type="s"/>
   <arg name="property" direction="in" type="s"/>
   <arg name="value" direction="out" type="v"/>
  </method>
  <method name="GetAll">
   <arg name="interface" direction="in" type="s"/>
   <arg name="properties" direction="out" type="a{sv}"/>
  </method>
  <method name="Set">
   <arg name="interface" direction="in" type="s"/>
   <arg name="property" direction="in" type="s"/>
   <arg name="value" direction="in" type="v"/>
  </method>
  <signal name="PropertiesChanged">
   <arg type="s" name="interface"/>
   <arg type="a{sv}" name="changed_properties"/>
   <arg type="as" name="invalidated_properties"/>
  </signal>
 </interface>
 <interface name="org.freedesktop.timedate1">
  <property name="Timezone" type="s" access="read">
  </property>
  <property name="LocalRTC" type="b" access="read">
  </property>
  <property name="CanNTP" type="b" access="read">
   <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/>
  </property>
  <property name="NTP" type="b" access="read">
  </property>
  <property name="NTPSynchronized" type="b" access="read">
   <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/>
  </property>
  <property name="TimeUSec" type="t" access="read">
   <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/>
  </property>
  <property name="RTCTimeUSec" type="t" access="read">
   <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/>
  </property>
  <method name="SetTime">
   <arg type="x" direction="in"/>
   <arg type="b" direction="in"/>
   <arg type="b" direction="in"/>
  </method>
  <method name="SetTimezone">
   <arg type="s" direction="in"/>
   <arg type="b" direction="in"/>
  </method>
  <method name="SetLocalRTC">
   <arg type="b" direction="in"/>
   <arg type="b" direction="in"/>
   <arg type="b" direction="in"/>
  </method>
  <method name="SetNTP">
   <arg type="b" direction="in"/>
   <arg type="b" direction="in"/>
  </method>
  <method name="ListTimezones">
   <arg type="as" direction="out"/>
  </method>
 </interface>
</node>
"

@ErwinSteffens
Copy link

Seems my issue is related to #183

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants