node-dbus icon indicating copy to clipboard operation
node-dbus copied to clipboard

No introspectable error in 0.2.22

Open craigmulligan opened this issue 9 years ago • 12 comments

node v: 6 v: 0.2.22

10.02.17 14:31:09 [-0300] { Error: No introspectable
10.02.17 14:31:09 [-0300] at /ap/node_modules/dbus/lib/bus.js:127:15
10.02.17 14:31:09 [-0300] cause:
10.02.17 14:31:09 [-0300] Error: No introspectable
10.02.17 14:31:09 [-0300] at /ap/node_modules/dbus/lib/bus.js:127:15,

Reverted to 0.2.19 and it works.

craigmulligan avatar Feb 10 '17 19:02 craigmulligan

not sure whether it's related to https://github.com/Shouqun/node-dbus/pull/150 could you post sample code here? thanks!

Shouqun avatar Feb 13 '17 14:02 Shouqun

Alternately, could it be an issue because of the API changes that I introduced?

bryanburgers avatar Feb 13 '17 14:02 bryanburgers

Hmm, yes we are using the Dbus constructor, which I see is now deprecated. When was that introduced?

craigmulligan avatar Feb 13 '17 14:02 craigmulligan

The DBus constructor still works in v0.2.22, should be other change related.

Shouqun avatar Feb 13 '17 15:02 Shouqun

From 0.2.19 -> 0.2.22, the major API that changed, that is probably relevant to you, is https://github.com/Shouqun/node-dbus/commit/f6d737049a8fb1f991863533bb3ad98f9f6d0b13

But that doesn't explain why you're getting a "Not Introspectable" error.

The DBus constructor was deprecated in 1.0.0. You can see all of those changes at Migrating. But like Shouqun said, that didn't land until 1.0.0, so is probably not your issue.

Can you narrow it down by trying your code with 0.2.21?

bryanburgers avatar Feb 13 '17 15:02 bryanburgers

Ah sorry I didn't see you'd bumped to v1 👍 Cool, we'll do some more digging and get back to you guys.

craigmulligan avatar Feb 13 '17 15:02 craigmulligan

For API compatibility, I just published 0.2.23 from branch https://github.com/Shouqun/node-dbus/tree/0.2.23 which is API compatible with 0.2.19 (without change https://github.com/Shouqun/node-dbus/commit/f6d737049a8fb1f991863533bb3ad98f9f6d0b13 and related code).

and for API 1.x, I'll publish 1.0.0 later. @bryanburgers

Shouqun avatar Feb 13 '17 15:02 Shouqun

@craig-mulligan I can't write CoffeeScript, nor do I have net.connman nor org.freedesktop.NetworkManager services on my virtual machine. So I can't test this against 1.0.0 (once it is released).

However, I tried to rewrite your dbus-promise using the new API, and it seems to work fine against org.freedesktop.DBus without throwing a "No introspectable" error.

Just playing around at this point to see what I can figure out.

bryanburgers avatar Feb 13 '17 16:02 bryanburgers

Edit: This was trivial. The fi.w1.wpa_supplicant1 service MUST be accessed with root permissions, meaning that node binary must have root permissions. Re-running this code with sudo node wpa_test.js removes the error and returns the expected functionality.


I am also running Node v6.x.x, with node-dbus v1.0.0 and getting the Error: No introspectable error whenever I try to connect to any system interface. Example code:

var DBus = require('../');

var bus = DBus.getBus('system');

bus.getInterface('fi.w1.wpa_supplicant1', '/fi/w1/wpa_supplicant1', 'fi.w1.wpa_supplicant1.Interface', function(err, iface) {
  if( err ) {
    console.error( err )
  }
});

Any ideas?

msolters avatar Jun 30 '17 22:06 msolters

Hi i have the same error, how can i fix that. here is service code `DBus = require('dbus');

process.env.DISPLAY = ':0';
process.env.DBUS_SESSION_BUS_ADDRESS = 'unix:path=/run/dbus/system_bus_socket';

var dbus = DBus.getBus('system');

// Create a new service, object and interface
var service = DBus.registerService('system', 'nodejs.dbus.PMTABounceManager');
var obj = service.createObject('/nodejs/dbus/PMTABounceManager');
var iface = obj.createInterface('nodejs.dbus.PMTABounceManager.PusherInterface');

iface.addMethod('Hello', { out: DBus.Define(String) }, function(callback) {
	callback(null, 'Hello There!');
});

iface.addSignal('message_state_available', {
	types: [
		DBus.Define(String)
	]
});

iface.update();

iface.on('message_state_available', function(messageState) {
	console.log('message state : '+messageState);
});

`

and this is the client code `dbus.getInterface('nodejs.dbus.PMTABounceManager', '/nodejs/dbus/PMTABounceManager', 'nodejs.dbus.PMTABounceManager.PusherInterface', function(err, iface) { console.log(err); iface.emit('message_state_available',line);

});`

blackxMan avatar Dec 01 '17 22:12 blackxMan

Hey guys, I found the cause of this. You can only load the system bus once

const bus1 = DBus.getBus("system");
const bus2 = DBus.getBus("system");

bus1.getInterface(); // will work
bus2.getInterface(); // will throw that error

posted this answer here too

https://github.com/Shouqun/node-dbus/issues/183#issuecomment-548242283

LukasBombach avatar Oct 31 '19 07:10 LukasBombach

Is there an intend to fix this?

vanthome avatar Sep 16 '22 17:09 vanthome