Asterisk CLI error "Too many open files"

Hello everyone,

Today i’ve stared to see these logs which I have never seen before . Anyone with any knowledge of this ?

[2022-11-07 09:28:50] ERROR[410309] res_rtp_asterisk.c: (0x7efcc4a00b00) ICE Error obtaining list of local addresses: Too many open files
[2022-11-07 09:28:50] ERROR[410309] astobj2_container.c: FRACK!, Failed assertion user_data is NULL (0)
[2022-11-07 09:28:50] ERROR[410309] : Got 20 backtrace records
# 0: /usr/sbin/asterisk(__ao2_ref+0x686) [0x55749b4a4de6]
# 1: /usr/sbin/asterisk(ao2_iterator_init+0x38) [0x55749b4a7e58]
# 2: /usr/lib/asterisk/modules/ [0x7efcd6713b4b]
# 3: /usr/lib/asterisk/modules/ [0x7efcd6714dca]
# 4: /usr/lib/asterisk/modules/ [0x7efcd6716b39]
# 5: /usr/lib/asterisk/modules/ [0x7efcd6716de8]
# 6: /usr/sbin/asterisk(ast_rtp_instance_new+0x1fe) [0x55749b59685e]
# 7: /usr/lib/asterisk/modules/ [0x7efcd5b018e3]
# 8: /usr/lib/asterisk/modules/ [0x7efcd5b04712]
# 9: /usr/lib/asterisk/modules/ [0x7efcd6e13721]
#10: /usr/lib/asterisk/modules/ [0x7efcd6e1aacf]
#11: /usr/lib/asterisk/modules/ [0x7efcd6e2485f]
#12: /usr/lib/asterisk/modules/ [0x7efcd650f979]
#13: /usr/sbin/asterisk(ast_taskprocessor_execute+0xe7) [0x55749b5f35d7]
#14: /usr/sbin/asterisk(+0x1c5108) [0x55749b5fa108]
#15: /usr/sbin/asterisk(ast_taskprocessor_execute+0xe7) [0x55749b5f35d7]
#16: /usr/sbin/asterisk(+0x1c5bdf) [0x55749b5fabdf]
#17: /usr/sbin/asterisk(+0x1cda86) [0x55749b602a86]
#18: /lib/x86_64-linux-gnu/ [0x7efd21578b43]
#19: /lib/x86_64-linux-gnu/ [0x7efd2160aa00]
[2022-11-07 13:44:49] WARNING[410309]: res_rtp_asterisk.c:3381 create_new_socket: Unable to allocate RTP socket: Too many open files
[2022-11-07 13:44:49] WARNING[410309]: res_rtp_asterisk.c:3856 rtp_allocate_transport: Failed to create a new socket for RTP instance '0x7efcc5442d40'
[2022-11-07 13:44:49] WARNING[410309]: res_rtp_asterisk.c:2873 dtls_srtp_stop_timeout_timer: Unable to cancel schedule ID 0.  This is probably a bug (res_rtp_asterisk.c: dtls_srtp_stop_timeout_timer, line 2873).

does it have any relation to ulimit -a ? or maxfiles under asterisk.conf ?

system does not crash , keeps working


What is your maxfiles set to in asterisk.conf ?

What is the output of command core show settings on the Asterisk CLI ? Specifically, what is the line Maximum open file handles telling you ?

Also this older thread might help.

Everything was set to default, once I changed the max open file settings (increasing it) error went away and concurrent call count increased. Error would start around 130-140 pjsip channels, after the change , system could handle higher volume.

What values did you use and how many calls could you max out before other limits arose ? (This will help users in the future and you can then mark this as solved issue.)

130-140 sounds like about the OS default of 1024. Although the exact numbers may have changed, I think a SIP type channel uses roughly 8 file descriptors.

asterisk.conf default was 1024, changed it to 10000. Before 130-140 calls (pjsip channels) now it can handle more (I’ve seen 170 - 200 calls ) without any issues.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.