stratosphereips / StratosphereLinuxIPS

Slips, a free software behavioral Python intrusion prevention system (IDS/IPS) that uses machine learning to detect malicious behaviors in the network traffic. Stratosphere Laboratory, AIC, FEL, CVUT in Prague.
Other
668 stars 165 forks source link

Device is busy error when given a very large pcap #751

Open AlyaGomaa opened 2 days ago

AlyaGomaa commented 2 days ago

ERR:

2023/09/13 16:15:32.552878 [Flow Alerts] Problem in main() line 121
2023/09/13 16:15:33.455982 [Flow Alerts] Traceback (most recent call last):
File "/home/project/miniconda3/envs/slips/lib/python3.9/site-packages/redis/connection.py", line 559, in connect
File "/home/project/miniconda3/envs/slips/lib/python3.9/site-packages/redis/connection.py", line 584, in _connect
File "/home/project/miniconda3/envs/slips/lib/python3.9/socket.py", line 953, in getaddrinfo
OSError: [Errno 16] Device or resource busy

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/Malware-Project/tools/SLIPS_FOR_TESTING/slips_files/common/abstracts.py", line 121, in run
File "/opt/Malware-Project/tools/SLIPS_FOR_TESTING/modules/flowalerts/flowalerts.py", line 1895, in main
File "/opt/Malware-Project/tools/SLIPS_FOR_TESTING/modules/flowalerts/flowalerts.py", line 1709, in check_device_changing_ips
File "/opt/Malware-Project/tools/SLIPS_FOR_TESTING/slips_files/core/database/database_manager.py", line 190, in was_ip_seen_in_connlog_before
File "/opt/Malware-Project/tools/SLIPS_FOR_TESTING/slips_files/core/database/redis_db/database.py", line 891, in was_ip_seen_in_connlog_before
File "/home/project/miniconda3/envs/slips/lib/python3.9/site-packages/redis/client.py", line 2277, in sismember
File "/home/project/miniconda3/envs/slips/lib/python3.9/site-packages/redis/client.py", line 898, in execute_command
File "/home/project/miniconda3/envs/slips/lib/python3.9/site-packages/redis/connection.py", line 1192, in get_connection
File "/home/project/miniconda3/envs/slips/lib/python3.9/site-packages/redis/connection.py", line 563, in connect
redis.exceptions.ConnectionError: Error 16 connecting to localhost:8891. Device or resource busy.

Possible reasons:

Resource Exhaustion: In some cases, this error can occur if the system has exhausted certain resources, such as file descriptors or sockets. Check your code for resource leaks and ensure that you are properly closing and releasing resources when they are no longer needed. Concurrency Issues: If you are working with multi-threaded or multi-process code, it's possible that multiple threads or processes are attempting to use the same resource simultaneously, leading to resource contention. Ensure that you have proper synchronization mechanisms in place to avoid such conflicts.

Created by Alya Gomaa via monday.com integration. 🎉