Using LevelDB with Autobahn/Crossbar

#1

If I try to use Level DB with autobahn/crossbar the crossbar task fails. If I run the same js file straight from Node it’s fine. If it starts from crossbar it fails.

The level db code is very simple as I’m just starting with it. I know it gets as far as var db = level(’./mydb’); because the subdir gets created and there are some files within it.

The crossbar error is below. The error just keeps repeating until I terminate it.
Does anyone have any idea of what the error could be?

var autobahn = require(‘autobahn’);
var level = require(‘level’);

var connection = new autobahn.Connection({
url: ‘ws://127.0.0.1:8080/ws’,
realm: ‘realm1’}
);

var db = level(’./mydb’);
var obj = {firstname: ‘Fred’, lastname: ‘Flintstone’, age: 1046, kids: [‘pebbles’, ‘bambam’]}

db.put(‘fred’, obj, function (err) {
if (err) console.log(‘Ooops! Save’, err)
else console.log(‘Saved’);
});

db.get(‘fred’, function (err, value) {
if (err) {
console.log(‘Ooops! Get’, err)
return ‘Failure’
}
console.log(value)
})

greg@greg-desktop:~/node-projects/aad$ crossbar start
2014-10-27 12:10:00-0300 [Controller 26094] Log opened.
2014-10-27 12:10:00-0300 [Controller 26094] ============================== Crossbar.io ==============================

2014-10-27 12:10:00-0300 [Controller 26094] Crossbar.io 0.9.9 starting
2014-10-27 12:10:00-0300 [Controller 26094] Running on CPython using EPollReactor reactor
2014-10-27 12:10:00-0300 [Controller 26094] Starting from node directory /home/greg/node-projects/aad/.crossbar
2014-10-27 12:10:00-0300 [Controller 26094] /usr/local/lib/python2.7/dist-packages/twisted/internet/_sslverify.py:184: exceptions.UserWarning: You do not have the service_identity module installed. Please install it from https://pypi.python.org/pypi/service_identity. Without the service_identity module and a recent enough pyOpenSSL tosupport it, Twisted can perform only rudimentary TLS client hostnameverification. Many valid certificate/hostname mappings may be rejected.
2014-10-27 12:10:00-0300 [Controller 26094] Starting from local configuration ‘/home/greg/node-projects/aad/.crossbar/config.json’
2014-10-27 12:10:00-0300 [Controller 26094] Warning, could not set process title (setproctitle not installed)
2014-10-27 12:10:00-0300 [Controller 26094] Warning: process utilities not available
2014-10-27 12:10:00-0300 [Controller 26094] No WAMPlets detected in enviroment.
2014-10-27 12:10:00-0300 [Controller 26094] Starting Router with ID ‘worker1’ …
2014-10-27 12:10:00-0300 [Router 26103] Log opened.
2014-10-27 12:10:00-0300 [Router 26103] Warning: could not set worker process title (setproctitle not installed)
2014-10-27 12:10:00-0300 [Router 26103] Running under CPython using EPollReactor reactor
2014-10-27 12:10:00-0300 [Router 26103] /usr/local/lib/python2.7/dist-packages/twisted/internet/_sslverify.py:184: exceptions.UserWarning: You do not have the service_identity module installed. Please install it from https://pypi.python.org/pypi/service_identity. Without the service_identity module and a recent enough pyOpenSSL tosupport it, Twisted can perform only rudimentary TLS client hostnameverification. Many valid certificate/hostname mappings may be rejected.
2014-10-27 12:10:01-0300 [Router 26103] Entering event loop …
2014-10-27 12:10:01-0300 [Router 26103] Warning: process utilities not available
2014-10-27 12:10:01-0300 [Controller 26094] Router with ID ‘worker1’ and PID 26103 started
2014-10-27 12:10:01-0300 [Controller 26094] Router ‘worker1’: realm ‘realm1’ started
2014-10-27 12:10:01-0300 [Controller 26094] Router ‘worker1’: role ‘role1’ started on realm ‘realm1’
2014-10-27 12:10:01-0300 [Router 26103] Site starting on 8080
2014-10-27 12:10:01-0300 [Controller 26094] Router ‘worker1’: transport ‘transport1’ started
2014-10-27 12:10:01-0300 [Controller 26094] Starting Guest with ID ‘worker2’ …
2014-10-27 12:10:01-0300 [Controller 26094] GuestWorkerClientProtocol.connectionMade
2014-10-27 12:10:01-0300 [Controller 26094] Guest with ID ‘worker2’ and PID 26106 started
2014-10-27 12:10:01-0300 [Controller 26094] Guest ‘worker2’: started
2014-10-27 12:10:01-0300 [Controller 26094] Restarting guest …
2014-10-27 12:10:01-0300 [Controller 26094] GuestWorkerClientProtocol.connectionLost: [Failure instance: Traceback (failure with no frames): <class ‘twisted.internet.error.ProcessTerminated’>: A process has ended with a probable error condition: process ended with exit code 143.
]
2014-10-27 12:10:01-0300 [Controller 26094] GuestWorkerClientProtocol: guest ended with error 143
2014-10-27 12:10:01-0300 [Controller 26094] Guest excited with error [Failure instance: Traceback (failure with no frames): <class ‘twisted.internet.error.ProcessTerminated’>: A process has ended with a probable error condition: process ended with exit code 143.
]
2014-10-27 12:10:01-0300 [Controller 26094] Starting Guest with ID ‘worker2’ …
2014-10-27 12:10:01-0300 [Controller 26094] GuestWorkerClientProtocol.connectionMade
2014-10-27 12:10:01-0300 [Controller 26094] Guest with ID ‘worker2’ and PID 26118 started
2014-10-27 12:10:02-0300 [Controller 26094] Restarting guest …
2014-10-27 12:10:02-0300 [Controller 26094] GuestWorkerClientProtocol.connectionLost: [Failure instance: Traceback (failure with no frames): <class ‘twisted.internet.error.ProcessTerminated’>: A process has ended with a probable error condition: process ended with exit code 143.
]
2014-10-27 12:10:02-0300 [Controller 26094] GuestWorkerClientProtocol: guest ended with error 143
2014-10-27 12:10:02-0300 [Controller 26094] Guest excited with error [Failure instance: Traceback (failure with no frames): <class ‘twisted.internet.error.ProcessTerminated’>: A process has ended with a probable error condition: process ended with exit code 143.

0 Likes