# Bad file descriptor error while getting a key

**URL:** <https://discuss.aerospike.com/t/bad-file-descriptor-error-while-getting-a-key/2636>\
**Category:** Python Client\
**Tags:** error\
**Created:** [March 16, 2016, 6:48am UTC](https://discuss.aerospike.com/t/bad-file-descriptor-error-while-getting-a-key/2636 "2016-03-16T06:48:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![manana](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@manana](https://discuss.aerospike.com/u/manana)\
**Post date:** [March 16, 2016, 6:48am UTC](https://discuss.aerospike.com/t/bad-file-descriptor-error-while-getting-a-key/2636/1 "2016-03-16T06:48:38Z")

</div>

Hi, I’m running 2.0.1 python client on python3 Flask based web application. Time to time, when load is higher, getting a key failed with (-1, ‘Bad file descriptor’, ‘src/main/client/get.c’, 113) error. I’m using one object per process, that is constructed in this way:

```auto
conf = {"hosts": self.addresses,
        "policies": {"timeout": self.timeout},
        "shm": {}}
proxy = aerospike.Client(conf)
proxy.connect()
return proxy

```

Thank for advice how to avoid this behaviour.

---

<div class="post-metadata">

**Author:** ![tivvit](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/tivvit/32/314_2.png) [@tivvit](https://discuss.aerospike.com/u/tivvit)\
**Post date:** [March 23, 2016, 8:12am UTC](https://discuss.aerospike.com/t/bad-file-descriptor-error-while-getting-a-key/2636/2 "2016-03-23T08:12:12Z")

</div>

Hi, I have the same problem, but when writing (puting or incrementing).

Maybe proto-fd-max is low?

---

<div class="post-metadata">

**Author:** ![\_PPC-help.ru](https://avatars.discourse-cdn.com/v4/letter/_/f04885/32.png) [@\_PPC-help.ru](https://discuss.aerospike.com/u/_PPC-help.ru)\
**Post date:** [October 6, 2016, 7:04pm UTC](https://discuss.aerospike.com/t/bad-file-descriptor-error-while-getting-a-key/2636/3 "2016-10-06T19:04:41Z")

</div>

I have this problem too, anyone solved it?

---

<div class="post-metadata">

**Author:** ![kporter](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/kporter/32/515_2.png) [@kporter](https://discuss.aerospike.com/u/kporter)\
**Post date:** [October 6, 2016, 8:33pm UTC](https://discuss.aerospike.com/t/bad-file-descriptor-error-while-getting-a-key/2636/4 "2016-10-06T20:33:06Z")

</div>

> [@manana](#):
>
> Bad file descriptor

This message ([1](https://github.com/aerospike/aerospike-client-c/blob/master/src/main/aerospike/as_socket.c#L417), [2](https://github.com/aerospike/aerospike-client-c/blob/master/src/main/aerospike/as_socket.c#L501), [3](https://github.com/aerospike/aerospike-client-c/blob/master/src/main/aerospike/as_socket.c#L595)) occurs when an Aerospike server closes an active socket. One way which this may happen, as mentioned by @tivvit, is if [proto-fd-max](http://www.aerospike.com/docs/reference/configuration#proto-fd-max) has been exceeded.

---

<div class="post-metadata">

**Author:** ![\_PPC-help.ru](https://avatars.discourse-cdn.com/v4/letter/_/f04885/32.png) [@\_PPC-help.ru](https://discuss.aerospike.com/u/_PPC-help.ru)\
**Post date:** [October 8, 2016, 9:00pm UTC](https://discuss.aerospike.com/t/bad-file-descriptor-error-while-getting-a-key/2636/5 "2016-10-08T21:00:05Z")

</div>

I have set this option to 100.000, but it didin’t solve the problem. This problem occurs, when i’m trying to get data from LLIST contains 10-20 million elements. I have also set timeout to 2 min, but this problem occurs immediately when i’m trying to work with llist.

---

<div class="post-metadata">

**Author:** ![kporter](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/kporter/32/515_2.png) [@kporter](https://discuss.aerospike.com/u/kporter)\
**Post date:** [October 10, 2016, 5:25pm UTC](https://discuss.aerospike.com/t/bad-file-descriptor-error-while-getting-a-key/2636/6 "2016-10-10T17:25:16Z")

</div>

What version of Aerospike Server are you running and do any warnings appear in the logs when these transactions timeout?

---

<div class="post-metadata">

**Author:** ![\_PPC-help.ru](https://avatars.discourse-cdn.com/v4/letter/_/f04885/32.png) [@\_PPC-help.ru](https://discuss.aerospike.com/u/_PPC-help.ru)\
**Post date:** [October 10, 2016, 6:29pm UTC](https://discuss.aerospike.com/t/bad-file-descriptor-error-while-getting-a-key/2636/7 "2016-10-10T18:29:01Z")

</div>

There are no any warnings in the logs. How can i get my AS version?
