OpenCTI-Platform / client-python

OpenCTI Python Client
https://www.opencti.io
Apache License 2.0
113 stars 128 forks source link

Segmentation Fault (core dumped) #35

Closed Multidivide closed 4 years ago

Multidivide commented 4 years ago

Description

Segmentation fault (core dumped) appears as an error when running the worker command 'pip3 install -r requirements.txt', from when I do a further breakdown it seems like the pip install works for most of the modules but is having challenges with 4 of them.

Environment

  1. OS (where OpenCTI server runs): Ubuntu 18.04
  2. OpenCTI version: 2.0.1
  3. OpenCTI client: frontend
  4. Other environment details: Appears that the issue is related to python

Reproducible Steps

Steps to create the smallest reproducible scenario:

  1. run pip3 install -r requirements.txt under the file path opencti/worker/

Expected Output

A clean exit, no error messages occurring or at least an error log to show where the issue is occurring.

Actual Output

The tail end of the result shows the following:

Installing collected packages: pytz, pika, six, python-dateutil, regex, datefinder, appdirs, certifi, chardet, urllib3, idna, requests, requests-cache, more-itertools, zipp, importlib-metadata, attrs, pyrsistent, setuptools, jsonschema, simplejson, antlr4-python3-runtime, stix2-patterns, colorama, stix2-validator, PyYAML, stix2, pycti
Segmentation fault (core dumped)

Additional information

I was able to breakdown the actual output and do one-by-one of each installation. Below is what did work and what appeared with an error flag:

What worked
    six  
    python-dateutil  
    pytz  
    pika  
    PyYAML  
    chardet  
    urllib3  
    idna
    certifi  
    requests
    regex
    requests  
    antlr4-python3-runtime  
    stix2-patterns 
    pyrsistent
    attrs
    more-itertools
    zipp
    importlib-metadata
    setuptools
    jsonschema
    colorama
    requests-cache
    appdirs

What didnt work
    simplejson  
        Collecting
        Installing collected packages: simplejson
        Successfully installed simplejson-3.16.0
        Segmentation fault (core dumped)
    stix2  
        (Segmentation Fault core dumped)
    stix2-validator 
        (Segmentation Fault core dumped)
    pycti 
        (Segmentation Fault core dumped)

Hope this helps, let me know what further information is required and I'll try provide when available, otherwise i'll keep searching and see what a solution could be

Multidivide commented 4 years ago

I havent had much luck yet, but I'll give it a go again with the 2.0.2 release. But because the segmentation fault is to do with the python modules, what would be the best way I can help in solving this?

Multidivide commented 4 years ago

What I was able to do after a few more days of restarting and going through my snapshots, the command that worked appears to be the following: sudo -H pip3 install simplejson stix2 stix2-validator pycti The -H requests that the security policy set the HOME environment variable to the home directory specified by the target user's password database entry. Depending on the policy, this may be the default behavior.

And for no particular reason (just seems to work better) I did it while I was in my normal directory of account/home.

This was also done with version 2.0.2 of OpenCTI. For now I have closed this issue since I feel that it's been resolved, however if you need to contact me about anything I'll be happy to try help. Other advice I can offer is making sure that all your updates are up-to-date and upgraded too.