Cortex-Analyzers
Cortex-Analyzers copied to clipboard
Cortex Analysers fails : No module named 'requests'
Request Type
Bug
Work Environment
(replace with N/A if not applicable)
| Question | Answer |
|---|---|
| TheHive version | 4 |
| OS version (server) | RedHat |
| OS version (client) | Seven |
| Cortex Analyzer Name | OTXQuery, Pulsedive, VirusTotal etc |
| Cortex Version | 3.1.0-1 |
| ElasticSearch client | 7.9.1 |
Description
Most of the Analysers are failed to run with the following error messages.
Traceback (most recent call last): File "/xxx/Cortex-Analyzers/analyzers/OTXQuery/otxquery.py", line 4, in
Traceback (most recent call last): File "/opt/Cortex-Analyzers/analyzers/Abuse_Finder/abusefinder.py", line 9, in
Installed both Python2.7 and Python 3.6. When I tried to install dependencies manually, it shows that requirements are already satisfied.
When we upgrade the pip version python 27 breaks.
Sample error log
ImportError: /opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/_io.so: undefined symbol: _PyErr_ReplaceException
Traceback (most recent call last):
File "/opt/rh/python27/root/usr/bin/pip", line 5, in
Hi, from the error I cannot understand properly what's going on. Can you please specify how have you installed cortex [package or docker] and if you have copied analyzer locally or are running them with docker?
I have installed cortex package not docker version.
Ok..in any analyzer folder there is a requirements.txt file with specific dependencies for the analyzer.. you need to install them with: pip3 install -r requirements.txt
I ran the above command and it gave the following output
Requirement already satisfied: cortexutils in /opt/rh/rh-python36/root/usr/lib/python3.6/site-packages (from -r requirements.txt (line 1)) (2.1.0) Requirement already satisfied: future in /opt/rh/rh-python36/root/usr/lib/python3.6/site-packages (from -r requirements.txt (line 2)) (0.18.2) Requirement already satisfied: requests in /opt/rh/rh-python36/root/usr/lib/python3.6/site-packages (from -r requirements.txt (line 3)) (2.25.1) Requirement already satisfied: virustotal-api in /opt/rh/rh-python36/root/usr/lib/python3.6/site-packages (from -r requirements.txt (line 4)) (1.1.11) Requirement already satisfied: idna<3,>=2.5 in /opt/rh/rh-python36/root/usr/lib/python3.6/site-packages (from requests->-r requirements.txt (line 3)) (2.10) Requirement already satisfied: chardet<5,>=3.0.2 in /opt/rh/rh-python36/root/usr/lib/python3.6/site-packages (from requests->-r requirements.txt (line 3)) (4.0.0) Requirement already satisfied: urllib3<1.27,>=1.21.1 in /opt/rh/rh-python36/root/usr/lib/python3.6/site-packages (from requests->-r requirements.txt (line 3)) (1.26.3) Requirement already satisfied: certifi>=2017.4.17 in /opt/rh/rh-python36/root/usr/lib/python3.6/site-packages (from requests->-r requirements.txt (line 3)) (2020.12.5)