# Weird error happening randomly with Node client- Bad file descriptor as\_socket\_read\_limit line 432

**URL:** <https://discuss.aerospike.com/t/weird-error-happening-randomly-with-node-client-bad-file-descriptor-as-socket-read-limit-line-432/3865>\
**Category:** Node.js Client\
**Created:** [February 18, 2017, 7:42am UTC](https://discuss.aerospike.com/t/weird-error-happening-randomly-with-node-client-bad-file-descriptor-as-socket-read-limit-line-432/3865 "2017-02-18T07:42:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanchit](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@sanchit](https://discuss.aerospike.com/u/sanchit)\
**Post date:** [February 18, 2017, 7:42am UTC](https://discuss.aerospike.com/t/weird-error-happening-randomly-with-node-client-bad-file-descriptor-as-socket-read-limit-line-432/3865/1 "2017-02-18T07:42:07Z")

</div>

Aerospike Version: Aerospike Community Edition build 3.6.3 We have a node server using Aerospike as DB. The load on the server is minimal. We have a monitoring service which monitors one of the API by repeatedly calling the API(once every minute). 99% of the time it works properly. However, once or twice a day, the get call from DB fails and we get following error: “{"code":-1,"message":"Bad file descriptor","func":"as\_socket\_read\_limit","file":"src/main/aerospike/as\_socket.c","line":432}”

Kindly note that the Aerospike get query parameters remains the same in all those requests.

I have tried increasing the timeout to 800ms. var config = { hosts: settings.aerospike.hosts, policies : { key :aerospike.policy.key.SEND, timeout:800 } };

Also, have tried doubling proto-fd-max to 30000. Didn’t help ☹

This is not a major issue now. But in future when we have hundreds of request coming in every second, we may end up dropping requests. Thanks in advance

---

<div class="post-metadata">

**Author:** ![Albot](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/albot/32/2076_2.png) [@Albot](https://discuss.aerospike.com/u/Albot)\
**Post date:** [February 18, 2017, 7:20pm UTC](https://discuss.aerospike.com/t/weird-error-happening-randomly-with-node-client-bad-file-descriptor-as-socket-read-limit-line-432/3865/2 "2017-02-18T19:20:29Z")

</div>

What kind of call are you making? Do the server logs have anything in them?

---

<div class="post-metadata">

**Author:** ![Jan](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/jan/32/1124_2.png) [@Jan](https://discuss.aerospike.com/u/Jan)\
**Post date:** [February 23, 2017, 2:44am UTC](https://discuss.aerospike.com/t/weird-error-happening-randomly-with-node-client-bad-file-descriptor-as-socket-read-limit-line-432/3865/3 "2017-02-23T02:44:26Z")

</div>

This error indicates that the server might have closed the socket connection. The server logs might contain a hint as to why that might have happened.

What client version are you using?

---

<div class="post-metadata">

**Author:** ![sanchit](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@sanchit](https://discuss.aerospike.com/u/sanchit)\
**Post date:** [February 24, 2017, 12:20pm UTC](https://discuss.aerospike.com/t/weird-error-happening-randomly-with-node-client-bad-file-descriptor-as-socket-read-limit-line-432/3865/4 "2017-02-24T12:20:34Z")

</div>

Hi Albot,

Thanks a lot for your reply. The server log does not contains anything. We are making a get call. Here is the entire code

var aerospike = require(“aerospike”);

var client = aerospike.client(config); &nbsp;&nbsp;&nbsp;&nbsp;client.connect(function (response) { &nbsp;&nbsp;&nbsp;&nbsp; if ( response.code === 0) { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // handle success &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.log(“\nConnection to Aerospike cluster succeeded!\n”); &nbsp;&nbsp;&nbsp;&nbsp; } &nbsp;&nbsp;&nbsp;&nbsp; else { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // handle failure &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.log(“\nConnection to Aerospike cluster failed!\n”); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; console.log(response); &nbsp;&nbsp;&nbsp;&nbsp; } });

function getPersonList(group, cb){ &nbsp;&nbsp;&nbsp;&nbsp;var key = {ns : groupList.ns, set : groupList.set, key : group}; &nbsp;&nbsp;&nbsp;&nbsp;var udf = { module: HV\_MODULE, funcname: “getids”}; &nbsp;&nbsp;&nbsp;&nbsp;client.execute(key, udf, function (err, result){ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;switch (err.code) { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case aerospike.status.AEROSPIKE\_OK: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cb(null, result); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cb({“type”: “internal\_error”, “message”: JSON.stringify(err)}); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} &nbsp;&nbsp;&nbsp;&nbsp;}); }

Apologies for the delay in response.

---

<div class="post-metadata">

**Author:** ![sanchit](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@sanchit](https://discuss.aerospike.com/u/sanchit)\
**Post date:** [February 24, 2017, 12:25pm UTC](https://discuss.aerospike.com/t/weird-error-happening-randomly-with-node-client-bad-file-descriptor-as-socket-read-limit-line-432/3865/5 "2017-02-24T12:25:58Z")

</div>

Hi Jan,

Thanks a lot for replying. Server logs does not have any error.

Client version: 1.0.57(according to History.md file)

Thanks in advance, Sanchit
