node-cassandra-cql
node-cassandra-cql copied to clipboard
executeBatch error
I am trying to update using six insert statements, like so:
[ { query: 'INSERT INTO accounting_user (username, timestamp, usertype, statustype, delaytime, inputoctets, outputoctets, sessionid, sessiontime, terminatecause, nasidentifier, nasport, framedip, callingstationid) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', params: [ 'user1', 'd20ec080-23ae-11e2-9318-273e7e437743', 'broadband', 'Start', 0, 0, 0, '8312ff770d162c9777a71af111e1ec44', 21600, 'User-Request', '1.1.1.1', 37297, '2.2.2.2', '00:1d:7d:a1' ] }, { query: 'INSERT INTO accounting_ip (username, timestamp, usertype, statustype, delaytime, inputoctets, outputoctets, sessionid, sessiontime, terminatecause, nasidentifier, nasport, framedip, callingstationid) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', params: [ 'user1', 'd20ec080-23ae-11e2-9318-273e7e437743', 'broadband', 'Start', 0, 0, 0, '8312ff770d162c9777a71af111e1ec44', 21600, 'User-Request', '1.1.1.1', 37297, '2.2.2.2', '00:1d:7d:a1' ] }, { query: 'INSERT INTO accounting_session (username, timestamp, usertype, statustype, delaytime, inputoctets, outputoctets, sessionid, sessiontime, terminatecause, nasidentifier, nasport, framedip, callingstationid) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', params: [ 'user1', 'd20ec080-23ae-11e2-9318-273e7e437743', 'broadband', 'Start', 0, 0, 0, '8312ff770d162c9777a71af111e1ec44', 21600, 'User-Request', '1.1.1.1', 37297, '2.2.2.2', '00:1d:7d:a1' ] }, { query: 'INSERT INTO accounting_user (username, timestamp, usertype, statustype, delaytime, inputoctets, outputoctets, sessionid, sessiontime, terminatecause, nasidentifier, nasport, framedip, callingstationid) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', params: [ 'user1', '1ca93080-23e1-11e2-9318-273e7e437743', 'broadband', 'Stop', 0, 0, 0, '8312ff770d162c9777a71af111e1ec44', 21600, 'User-Request', '1.1.1.1', 37297, '2.2.2.2', '00:1d:7d:a1' ] }, { query: 'INSERT INTO accounting_ip (username, timestamp, usertype, statustype, delaytime, inputoctets, outputoctets, sessionid, sessiontime, terminatecause, nasidentifier, nasport, framedip, callingstationid) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', params: [ 'user1', '1ca93080-23e1-11e2-9318-273e7e437743', 'broadband', 'Stop', 0, 0, 0, '8312ff770d162c9777a71af111e1ec44', 21600, 'User-Request', '1.1.1.1', 37297, '2.2.2.2', '00:1d:7d:a1' ] }, { query: 'INSERT INTO accounting_session (username, timestamp, usertype, statustype, delaytime, inputoctets, outputoctets, sessionid, sessiontime, terminatecause, nasidentifier, nasport, framedip, callingstationid) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', params: [ 'user1', '1ca93080-23e1-11e2-9318-273e7e437743', 'broadband', 'Stop', 0, 0, 0, '8312ff770d162c9777a71af111e1ec44', 21600, 'User-Request', '1.1.1.1', 37297, '2.2.2.2', '00:1d:7d:a1' ] } ]
And getting back the following error:
{ name: 'ResponseError', message: 'Expected 8 or 0 byte long (4)', info: 'Represents a error message from the server', code: 8704, isServerUnhealthy: false }
Not sure what this error is referring to?
First, try reducing the number of queries to one so that you can isolate the particular query this is a problem.
Then try using hints to specify the target data type:
https://github.com/jorgebay/node-cassandra-cql#how-can-specify-the-target-data-type-of-a-query-parameter
@somecallmemike I've seen similar issues when I (accidentally) attempted to write strings into bigint columns.