error in cassandra-driver RequestHandler.getDecision on timeout - node.js

uncaughtException: Cannot read property 'consistency' of null, TypeError: Cannot read property 'consistency' of null
at RequestHandler.getDecision (/mnt/infibond/infi-version2/node_modules/cassandra-driver/lib/request-handler.js:351:69)
at RequestHandler.handleError (/mnt/infibond/infi-version2/node_modules/cassandra-driver/lib/request-handler.js:304:27)
at /mnt/infibond/infi-version2/node_modules/cassandra-driver/lib/request-handler.js:285:19
at next (/mnt/infibond/infi-version2/node_modules/cassandra-driver/lib/utils.js:442:14)
at EventEmitter. (/mnt/infibond/infi-version2/node_modules/cassandra-driver/lib/request-handler.js:281:7)
I'm getting this exception in specific cases when i have a timeout (from what i can see in the driver the this.request is null.)
did anyone fix this localy or knows what could have made this error happen?
thanks!

The ticket you submitted looks like a driver bug: https://datastax-oss.atlassian.net/browse/NODEJS-296
It occurs when the Cassandra host is not responsive while preparing a query, which should not occur often as a query gets prepared once in the driver Client instance lifetime.
We've included it for the next patch release (v3.1.2).

Related

Set Isolation level to DIRTY READ in Entity Framework with Informix

Is there a way to set isolation levels in Entity Framework 5 with Informix database or LOCK MODE TO WAIT?
I have tried to set isolation using SQL query, at the time of DbContext object creation.
var dataContext = new DatabaseNameContext();
dataContext.Database.ExecuteSqlCommand("SET ISOLATION TO DIRTY READ");
But it seems this is not working. I am still getting a lock exception:
IBM.Data.DB2.DB2Exception (0x80004005): ERROR [IX000] [IBM][IDS/UNIX64]
Could not do a physical-order read to fetch next row.
(-107 ISAM error: record is locked.
I tried using TransactionScope with System.Transactions.IsolationLevel.ReadUncommitted, but it is throwing the exception:
IBM.Data.DB2.DB2Exception (0x80004005): ERROR [58005] [IBM][IDS/UNIX64]
SQL0998N Error occurred during transaction or heuristic processing.
Reason Code = "16". Subcode = "2-8004D026".
Can you explain what's going wrong and how to fix it?
dataContext.Database.ExecuteSqlCommand("SET LOCK MODE TO WAIT 20");
It works for me :) Might be of use to someone...

Updating titan vertex property using rexster rexpro failing

I am using titan 0.4.2 with cassandra 2.0.7 as the storage back end. I have used rexter-server 2.4.0 to insert vertex in the titan. However while i am trying to update a vertex property using rexter client I am getting null pointer exception.
RexsterClient client = RexsterClientFactory.open("localhost", "titangraph");
client.execute("g.getVertex(8).setProperty('name','William')");
The above code is throwing null pointer exception. However the script g.getVertex(8).setProperty('name','William') runs perfectly fine in the gremlin console
How can i update titan vertex property using rexster rexpro?
I will assume that you are saying the NullPointerException (NPE) is coming from the script executed on the server-side. In other words, the problem is a result of running:
g.getVertex(8).setProperty('name','William')
and not something in the client instantiation or related to other client side code beyond the script itself.
With that assumption in mind, I could not recreate your error. The execute method does return a list with a single null within it but I don't think you're referring to that as your problem given the assumption. So, there's really only two things that could be wrong that I can think of:
The vertex returned by g.v(8) does not exist and it returns null
g is null
To verify, just execute g.v(8). If it returns null then item one above is the issue. If you still get an NPE then item two above is the problem. If item two is the problem then the name of the graph you are referencing, titangraph, is either not right or there is a bug in Rexster's handling of that binding. To figure that out, execute this instead:
g = rexster.getGraph('titangraph')
g.v(8)
If you still have a NPE then I'd have to say that you need to check your rexster.xml more carefully regarding your configuration. If it works, then you should likely report a bug in Rexster.

phpcassa creating column family

I get a very strange error when creating column family with phpcassa, here is my code:
$sys = new SystemManager("127.0.0.1:9160");
$attr = array("comparator" => "UTF8Type");
$data = $sys->create_column_family("my_key_space", "user_likes", $attr);
So i'm not actually sure if it's a valid code, but i am quite sure it is, so this is the error i get:
TTransportException [ 0 ]: TSocket: timed out reading 4 bytes from 127.0.0.1:9160
And i get this error after a really long loading, maybe 30-60 secs, but any other code like retrieving or inserting data works perfectly, so what could it be?
I believe the attribute name should be "comparator_type" instead of "comparator".
As for why the server isn't responding, you'll probably find an Exception or stack trace in your Cassandra logs. If you're using an up-to-date version of Cassandra (like 1.1.5 or 1.1.6), I suggest opening a ticket in the Cassandra JIRA, because it should be returning an error instead of timing out.

jtds TDS Protocol error: Invalid packet type

I'm connecting to Sybase ASA v11.0.1 using the jTDS library (v1.2.6) and I'm getting the following error every time I try to return varchar data
Protocol error: Invalid packet type 0x0
(or x4 or x7)
The queries work fine when I return a timestamp or numeric value. Any idea what is causing this error or how to resolve it?
It seems Sybase is not supported by 1.2.6 according to this https://sourceforge.net/p/jtds/discussion/104389/thread/d6e2efe3/
But I see this sometimes when the timeout closes the connection while I read the result set

Cassandra Hector: How to verify the success/failure of a row update (error handling)

I'm using Hector to interact with a cassandra database from a java application. (Hector 1.0-1)
In this example, it shows how to insert (or update) a field.
mutator.addInsertion("650222", "Npanxx", HFactory.createStringColumn("state", "CA"));
MutationResult mr = mutator.execute();
However, there is not much information on the outcome of the operation. How can we verify if the operation was successful or not? The return value is a ResultStatus implementation and the 3 methods that can be called are:
mr.getHostUsed()
mr.getExecutionTimeNano()
mr.getExecutionTimeMicro()
Can I assume that if there were no exceptions calling the execute() method, that the operation succeeded?
It looks like the execute method doesn't declare any exceptions thrown because it will throw instances of HectorException which is a RuntimeException.
So yes, if no exceptions are thrown, the insert succeeded. Otherwise you will get an instance of HectorException thrown (likely HTimedOutException/HUnavailableException for problems on the Cassandra side and something else for something on the Hector side).

Resources