# Segmentation Fault

**URL:** <https://discuss.aerospike.com/t/segmentation-fault/2922>\
**Category:** Node.js Client\
**Created:** [May 9, 2016, 9:23pm UTC](https://discuss.aerospike.com/t/segmentation-fault/2922 "2016-05-09T21:23:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![slane](https://avatars.discourse-cdn.com/v4/letter/s/4da419/32.png) [@slane](https://discuss.aerospike.com/u/slane)\
**Post date:** [May 9, 2016, 9:23pm UTC](https://discuss.aerospike.com/t/segmentation-fault/2922/1 "2016-05-09T21:23:23Z")

</div>

Attempting to set up NodeJS application to connect to Aerospike, and I hit an error I can’t find a solution to.

Basically, I connect as such:

```
var client = Aerospike.client({
        hosts: [{addr: '10.10.128.48', port: 3000}],
        log: {level: Aerospike.log.DEBUG}
});
client.connect(function (error) {
  if (error) {
        console.log('Connection to Aerospike cluster failed!')
  } else {
        console.log('Connection to Aerospike cluster succeeded!')
  }
});

```

Then as part of processing a command, I attempt to issue a put:

```
    var key = new Aerospike.Key('test22', 'node_set', accessKey);

    var rec = {
            sid: 'ABCDEF99',
            site_id: 1,
            language_id: 2
    };

    client.put(key, rec, function(err) {
            if (err) {
                    console.log("Error: %s", err.message);
                    callbackFunc(err, res, null);
            }
            else {
                    console.log("Create success");
                    callbackFunc(err, res, session);
            }
    });

```

Output:

```
May 09 2016 20:58:19 GMT: DEBUG(32599) [client.cc:115] [New] - Aerospike object initialization : success
May 09 2016 20:58:19 GMT: DEBUG(32599) [cluster.cc:52] [Connect] - Connecting to Cluster: Success
Connection to Aerospike cluster succeeded!
PORT defined as undefined
Binding to port 9001
May 09 2016 20:58:24 GMT: DEBUG(32599) [put_async.cc:81] [PutAsync] - Sending async put command

May 09 2016 20:58:24 GMT: DEBUG(32599) [async.cc:165] [async_write_listener] - Command failed: -6 uv_tcp_connect failed: unknown error
May 09 2016 20:58:24 GMT: DEBUG(32599) [async.cc:171] [async_write_listener] - Invoking JS callback function
Error: uv_tcp_connect failed: unknown error
Segmentation fault (core dumped)

```

I assume this to mean that the initial connection succeeds, but it appears to be a connection error when it attempts the PUT. I’m not sure where to look for further info to debug.

Thanks, Sam

---

<div class="post-metadata">

**Author:** ![rbotzer](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/rbotzer/32/2114_2.png) [@rbotzer](https://discuss.aerospike.com/u/rbotzer)\
**Post date:** [May 9, 2016, 11:38pm UTC](https://discuss.aerospike.com/t/segmentation-fault/2922/2 "2016-05-09T23:38:59Z")

</div>

Hey Sam, can you open this as an issue on the [aerospike/aerospike-client-nodejs](https://github.com/aerospike/aerospike-client-nodejs/issues) GitHub repo? Please add information about your OS, and the version of Node and our client that you’re using.

---

<div class="post-metadata">

**Author:** ![slane](https://avatars.discourse-cdn.com/v4/letter/s/4da419/32.png) [@slane](https://discuss.aerospike.com/u/slane)\
**Post date:** [May 10, 2016, 5:35pm UTC](https://discuss.aerospike.com/t/segmentation-fault/2922/3 "2016-05-10T17:35:13Z")

</div>

Done - Issue #128 - [Segmentation Fault · Issue #128 · aerospike/aerospike-client-nodejs · GitHub](https://github.com/aerospike/aerospike-client-nodejs/issues/128)
