Skip to content

Error: Expected Stream, got object #91

@godronus

Description

@godronus

Trying to connect to either a Janus database, Tinkergraph Database or OreintDB. In each case I have managed to connect a gremlin server to the database. I am able to connect to the gremlin server with the gremlin console and can traverse the records. However I am unable to do so with gremlin-javascript.
If you could add some insight to what I am doing wrong it would be muchly appreciated.
simple code I am using:

var gremlin = require('gremlin');
var client = gremlin.createClient();
console.log(client);
var script = 'g.V()';
// Callback style
client.execute(script, function(err, res) {
   console.log(err, res);
});

the error stack: (Including the console.log of the client):

client GremlinClient {
   domain: null,
   _events: {},
   _eventsCount: 0,
   _maxListeners: undefined,
   port: 8182,
   host: 'localhost',
   options:
    { language: 'gremlin-groovy',
      session: false,
      op: 'eval',
      processor: '',
      accept: 'application/json',
      executeHandler: [Function: defaultExecuteHandler],
      ssl: false,
      rejectUnauthorized: true,
      user: '',
      password: '',
      path: '/gremlin' },
   useSession: false,
   user: '',
   password: '',
   connected: false,
   queue: [],
   commands: {},
   connection:
    WebSocketGremlinConnection {
      domain: null,
      _events:
       { open: [Function],
         error: [Function],
         message: [Function],
         close: [Function] },
      _eventsCount: 4,
      _maxListeners: undefined,
      open: false,
      ws:
       WebSocket {
         domain: null,
         _events: [Object],
         _eventsCount: 4,
         _maxListeners: undefined,
         readyState: 0,
         bytesReceived: 0,
         extensions: {},
         protocol: '',
         _binaryType: 'arraybuffer',
         _finalize: [Function: bound finalize],
         _finalizeCalled: false,
         _closeMessage: null,
         _closeTimer: null,
         _closeCode: null,
         _receiver: null,
         _sender: null,
         _socket: null,
         _ultron: null,
         protocolVersion: 13,
         _isServer: false,
         url: 'ws://localhost:8182/gremlin',
         _req: [Object] } } }
events.js:182
       throw er; // Unhandled 'error' event
       ^

Error: Expected Stream, got object
     at
/home/farqs/Code/testClient/node_modules/highland/lib/index.js:3504:26
     at
/home/farqs/Code/testClient/node_modules/highland/lib/index.js:1576:9
     at Stream.s._send
(/home/farqs/Code/testClient/node_modules/highland/lib/index.js:1532:9)
     at Stream.write
(/home/farqs/Code/testClient/node_modules/highland/lib/index.js:1633:18)
     at Stream._send
(/home/farqs/Code/testClient/node_modules/highland/lib/index.js:959:26)
     at push
(/home/farqs/Code/testClient/node_modules/highland/lib/index.js:1498:19)
     at
/home/farqs/Code/testClient/node_modules/highland/lib/index.js:2104:13
     at Stream.s._send
(/home/farqs/Code/testClient/node_modules/highland/lib/index.js:1532:9)
     at Stream.write
(/home/farqs/Code/testClient/node_modules/highland/lib/index.js:1633:18)
     at Stream._send
(/home/farqs/Code/testClient/node_modules/highland/lib/index.js:959:26)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions