Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7218137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T21:26:36+00:00 2026-05-28T21:26:36+00:00

I tried connecting to my cassandra cluster [version 1.0.6] via nodejs using node-cassandra-client This

  • 0

I tried connecting to my cassandra cluster [version 1.0.6] via nodejs using node-cassandra-client

This is my sample script

var Connection = require('cassandra-client').Connection;
var con = new Connection({host:'x.x.x.x', port:9160, keyspace:'Stats', timeout:10000});
console.log(con);
con.execute('UPDATE TestCF ?=? WHERE key=?', ['cola', '1', '20120132'], function(err) {
    if (err) {
        console.log("Failed");
    } else {
        console.log("success");
    }
});

On executing the script

    The "sys" module is now called "util". It should have a similar interface.
    node-cassandra-client.driver: connecting x.x.x.x:9160 {}
    { validators: {},
      client: null,
      connectionInfo: 
       { host: 'x.x.x.x',
         port: 9160,
         keyspace: 'Stats',
         timeout: 10000 },
      timeout: 10000 }

    node.js:201
            throw e; // process.nextTick error, or 'error' event on first tick
                  ^
    TypeError: Cannot call method 'execute_cql_query' of null
        at [object Object].execute (/home/tamil/workspace/TestProjects/node-cass/node_modules/cassandra-client/lib/driver.js:367:17)
        at Object.<anonymous> (/home/tamil/workspace/TestProjects/node-cass/index.js:5:5)
        at Module._compile (module.js:432:26)
        at Object..js (module.js:450:10)
        at Module.load (module.js:351:31)
        at Function._load (module.js:310:12)
        at Array.0 (module.js:470:10)
        at EventEmitter._tickCallback (node.js:192:40)

My nodetool stats

Address         DC          Rack        Status State   Load            Owns    Token                                       
x.x.x.x         datacenter1 rack1       Up     Normal  1.03 MB         100.00% 0     

What would be the error reason? and Need some help to fix this

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T21:26:37+00:00Added an answer on May 28, 2026 at 9:26 pm

    the client inside your connection is null. You need to connect() first. Here’s an example (ignores all errors):

    var con = new Connection({host:'x.x.x.x', port:9160, keyspace:'Stats', timeout:10000});
    con.connect(function(err) {
      assert.ifError(err);
      con.execute('SELECT COUNT(*) FROM TestCF', [], function(err, rows) {
        con.close(function(err) {
          // you're done now.
        });
      });
    });
    

    I recommend using async to handle the ordering of connct, query, close, etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was using Codeplex and tried connecting to their source control using Team Explorer,
I've tried connecting to mysql via my registered server on dreamhost, and via localhost.
I've tried converting the double value into a string and using the Replace() method
Tried something like this: HttpApplication app = s as HttpApplication; //s is sender of
Tried this: $('.link').click(function(e) { $.getScript('http://www.google.com/uds/api?file=uds.js&amp;v=1.0', function() { $('body').append('<p>GOOGLE API (UDS) is loaded</p>'); }); return
Tried to make a little old school ajax (iframe-javascript) script. A bit of mootools
I have tried contacting tech support with this question, but it has been over
I tried using AJAX Control for my first time after I installed the AJAX
I created a sample hello world application using Flash Builder 4.5.1 (with the update
I'm writings some ASP.NET and I tried connecting to my MySQL database. I found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.