orientechnologies / orientjs

The official fast, lightweight node.js client for OrientDB
http://orientdb.com
Other
326 stars 68 forks source link

orientjs@3.0.0-beta.1 - Live Query - Exception: LINKBAG should never appear in a projection #336

Closed jymcheong closed 6 years ago

jymcheong commented 6 years ago

Exception Message

Exceptions at server side, after which no more output from test harness.

$ANSI{green {db=DataFusion}} Error executing live query subscriber.
java.lang.UnsupportedOperationException: LINKBAG should never appear in a projection
        at com.orientechnologies.orient.core.serialization.serializer.result.binary.OResultSerializerNetwork.serializeValue(OResultSerializerNetwork.java:426)
        at com.orientechnologies.orient.core.serialization.serializer.result.binary.OResultSerializerNetwork.serialize(OResultSerializerNetwork.java:134)
        at com.orientechnologies.orient.core.serialization.serializer.result.binary.OResultSerializerNetwork.toStream(OResultSerializerNetwork.java:649)
        at com.orientechnologies.orient.client.remote.message.OMessageHelper.writeProjection(OMessageHelper.java:411)
        at com.orientechnologies.orient.client.remote.message.OMessageHelper.writeResult(OMessageHelper.java:448)
        at com.orientechnologies.orient.client.remote.message.OLiveQueryPushRequest.write(OLiveQueryPushRequest.java:62)
        at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.push(ONetworkProtocolBinary.java:873)
        at com.orientechnologies.orient.server.OServerLiveQueryResultListener.sendEvent(OServerLiveQueryResultListener.java:34)
        at com.orientechnologies.orient.server.OServerLiveQueryResultListener.onUpdate(OServerLiveQueryResultListener.java:47)
        at com.orientechnologies.orient.core.sql.executor.LiveQueryListenerImpl.onLiveResult(LiveQueryListenerImpl.java:139)
        at com.orientechnologies.orient.core.query.live.OLiveQueryQueueThreadV2.run(OLiveQueryQueueThreadV2.java:57)

Test Harness Code

const OrientDBClient = require("orientjs").OrientDBClient;
var _session, _client;

OrientDBClient.connect({
  host: "localhost",
  port: 2424
}).then(client => {
    _client = client;
    client.session({ name: "DataFusion", username: "USER", password: "PASS" })
    .then(session => {
    // use the session
       console.log('session opened')
       _session = session;
       session.liveQuery("select from processcreate").on("data", data => {
            console.log(data);
        });
    })
});

process.stdin.resume(); //so the program will not close instantly
function exitHandler(err) {
    console.log('cleaning up...')    
    _session.close()
    .then(() =>{
        console.log('session closed');
        _client.close()
        .then(() => {
            console.log('client closed');
            process.exit();
        })
    })
}
process.on('exit', exitHandler.bind(null));
process.on('SIGINT', exitHandler.bind(null));
process.on('SIGUSR1', exitHandler.bind(null));
process.on('SIGUSR2', exitHandler.bind(null));
process.on('uncaughtException', exitHandler.bind(null));

Test Harness Output

docker@OrientDB:~/liveQueryTest$ node t.js 
session opened
{ monitorId: -1685914961,
  operation: 1,
  data: 
   { Task: 1,
     Company: 'Microsoft Corporation',
     ParentImage: 'C:\\Windows\\explorer.exe',
     LogonGuid: '{4EF4918F-A430-5BA8-0000-002081DD330E}',
     EventType: 'INFO',
     IntegrityLevel: 'Medium',
     ParentProcessId: '8444',
     Product: 'Microsoft® Windows® Operating System',
     SysmonProcessId: 1848,
     Image: 'C:\\Windows\\System32\\mmc.exe',
     ProcessGuid: '{4EF4918F-965A-5BA9-0000-00104259540F}',
     UtcTime: 2018-09-24T17:58:50.000Z,
     ToBeProcessed: true,
     Version: 5,
     FileVersion: '10.0.10240.16384 (th1.150709-1700)',
     DeviceProduct: 'EventLog',
     id: 1537840732355,
     ParentCommandLine: 'C:\\Windows\\Explorer.EXE',
     DeviceVendor: 'Microsoft',
     OpcodeValue: 0,
     Channel: 'Microsoft-Windows-Sysmon/Operational',
     Hostname: 'DESKTOP-CPQ2OES',
     EventReceivedTime: 2018-09-25T01:58:51.000Z,
     SourceModuleName: 'in',
     Hashes: 'MD5=26D6ADDFF03D7446D0C71547A2EC72A9,SHA256=FA962A1682C640D6A5A842C14F7714A43C34E43C6B1D6A9364FC9A986FD0BC4A',
     EventTime: 2018-09-25T01:58:50.000Z,
     EventID: 1,
     Domain: 'NT AUTHORITY',
     ParentProcessGuid: '{4EF4918F-A431-5BA8-0000-0010EC53340E}',
     RecordNumber: 3674162,
     AccountName: 'SYSTEM',
     Keywords: '-9223372036854776000',
     Category: 'Process Create (rule: ProcessCreate)',
     Description: 'Microsoft Management Console',
     User: 'DESKTOP-CPQ2OES\\q',
     TerminalSessionId: '4',
     Opcode: 'Info',
     CurrentDirectory: 'C:\\Windows\\system32\\',
     SeverityValue: 2,
     UserID: 'S-1-5-18',
     LogonId: '0xe33dd81',
     SourceModuleType: 'im_msvistalog',
     SourceName: 'Microsoft-Windows-Sysmon',
     Severity: 'INFO',
     AccountType: 'User',
     ProviderGuid: '{5770385F-C22A-43E0-BF4C-06F5698FFBD9}',
     CommandLine: '"C:\\Windows\\system32\\mmc.exe" "C:\\Windows\\system32\\eventvwr.msc" /s',
     ThreadID: 3400,
     ProcessId: 17812,
     '@rid': RecordID { cluster: 22, position: 10 },
     '@class': 'ProcessCreate',
     '@version': 1 } }
{ monitorId: -1685914961,
  operation: 2,
  data: 
   { Task: 1,
     Company: 'Microsoft Corporation',
     ParentImage: 'C:\\Windows\\explorer.exe',
     LogonGuid: '{4EF4918F-A430-5BA8-0000-002081DD330E}',
     EventType: 'INFO',
     IntegrityLevel: 'Medium',
     ParentProcessId: '8444',
     Product: 'Microsoft® Windows® Operating System',
     SysmonProcessId: 1848,
     Image: 'C:\\Windows\\System32\\mmc.exe',
     ProcessGuid: '{4EF4918F-965A-5BA9-0000-00104259540F}',
     UtcTime: 2018-09-24T17:58:50.000Z,
     ToBeProcessed: false,
     Version: 5,
     FileVersion: '10.0.10240.16384 (th1.150709-1700)',
     DeviceProduct: 'EventLog',
     id: 1537840732355,
     ParentCommandLine: 'C:\\Windows\\Explorer.EXE',
     DeviceVendor: 'Microsoft',
     OpcodeValue: 0,
     Channel: 'Microsoft-Windows-Sysmon/Operational',
     Hostname: 'DESKTOP-CPQ2OES',
     EventReceivedTime: 2018-09-25T01:58:51.000Z,
     SourceModuleName: 'in',
     Hashes: 'MD5=26D6ADDFF03D7446D0C71547A2EC72A9,SHA256=FA962A1682C640D6A5A842C14F7714A43C34E43C6B1D6A9364FC9A986FD0BC4A',
     EventTime: 2018-09-25T01:58:50.000Z,
     EventID: 1,
     ParentProcessGuid: '{4EF4918F-A431-5BA8-0000-0010EC53340E}',
     Domain: 'NT AUTHORITY',
     RecordNumber: 3674162,
     AccountName: 'SYSTEM',
     Keywords: '-9223372036854776000',
     Category: 'Process Create (rule: ProcessCreate)',
     Description: 'Microsoft Management Console',
     User: 'DESKTOP-CPQ2OES\\q',
     TerminalSessionId: '4',
     Opcode: 'Info',
     CurrentDirectory: 'C:\\Windows\\system32\\',
     SeverityValue: 2,
     UserID: 'S-1-5-18',
     LogonId: '0xe33dd81',
     SourceModuleType: 'im_msvistalog',
     SourceName: 'Microsoft-Windows-Sysmon',
     Severity: 'INFO',
     AccountType: 'User',
     ProviderGuid: '{5770385F-C22A-43E0-BF4C-06F5698FFBD9}',
     CommandLine: '"C:\\Windows\\system32\\mmc.exe" "C:\\Windows\\system32\\eventvwr.msc" /s',
     ThreadID: 3400,
     ProcessId: 17812,
     '@rid': RecordID { cluster: 22, position: 10 },
     '@class': 'ProcessCreate',
     '@version': 2 },
  before: 
   { Task: 1,
     Company: 'Microsoft Corporation',
     ParentImage: 'C:\\Windows\\explorer.exe',
     LogonGuid: '{4EF4918F-A430-5BA8-0000-002081DD330E}',
     EventType: 'INFO',
     IntegrityLevel: 'Medium',
     ParentProcessId: '8444',
     Product: 'Microsoft® Windows® Operating System',
     SysmonProcessId: 1848,
     Image: 'C:\\Windows\\System32\\mmc.exe',
     ProcessGuid: '{4EF4918F-965A-5BA9-0000-00104259540F}',
     UtcTime: 2018-09-24T17:58:50.000Z,
     ToBeProcessed: true,
     Version: 5,
     FileVersion: '10.0.10240.16384 (th1.150709-1700)',
     DeviceProduct: 'EventLog',
     id: 1537840732355,
     ParentCommandLine: 'C:\\Windows\\Explorer.EXE',
     DeviceVendor: 'Microsoft',
     OpcodeValue: 0,
     Channel: 'Microsoft-Windows-Sysmon/Operational',
     Hostname: 'DESKTOP-CPQ2OES',
     EventReceivedTime: 2018-09-25T01:58:51.000Z,
     SourceModuleName: 'in',
     Hashes: 'MD5=26D6ADDFF03D7446D0C71547A2EC72A9,SHA256=FA962A1682C640D6A5A842C14F7714A43C34E43C6B1D6A9364FC9A986FD0BC4A',
     EventTime: 2018-09-25T01:58:50.000Z,
     EventID: 1,
     ParentProcessGuid: '{4EF4918F-A431-5BA8-0000-0010EC53340E}',
     Domain: 'NT AUTHORITY',
     RecordNumber: 3674162,
     AccountName: 'SYSTEM',
     Keywords: '-9223372036854776000',
     Category: 'Process Create (rule: ProcessCreate)',
     Description: 'Microsoft Management Console',
     User: 'DESKTOP-CPQ2OES\\q',
     TerminalSessionId: '4',
     Opcode: 'Info',
     CurrentDirectory: 'C:\\Windows\\system32\\',
     SeverityValue: 2,
     UserID: 'S-1-5-18',
     LogonId: '0xe33dd81',
     SourceModuleType: 'im_msvistalog',
     SourceName: 'Microsoft-Windows-Sysmon',
     Severity: 'INFO',
     AccountType: 'User',
     ProviderGuid: '{5770385F-C22A-43E0-BF4C-06F5698FFBD9}',
     CommandLine: '"C:\\Windows\\system32\\mmc.exe" "C:\\Windows\\system32\\eventvwr.msc" /s',
     ThreadID: 3400,
     ProcessId: 17812,
     '@rid': RecordID { cluster: 22, position: 10 },
     '@class': 'ProcessCreate',
     '@version': 1 } }
wolf4ood commented 6 years ago

Hi @jymcheong

yes it is a server side issue. It has been solved and it will be released in 3.0.8

See here https://github.com/orientechnologies/orientjs/issues/334

Thanks

jymcheong commented 6 years ago

Hi @wolf4ood

Noted with thanks.

Regards.