Netflix / security_monkey

Security Monkey monitors AWS, GCP, OpenStack, and GitHub orgs for assets and their changes over time.
Apache License 2.0
4.36k stars 800 forks source link

monkey db upgrade - issues #1244

Closed ping4lucifer closed 4 years ago

ping4lucifer commented 4 years ago

Please make sure that you have checked the boxes:

Description of issue:

Dear Security_Monkey Team:

When running the monkey db upgrade after modifying the config.py file it throws the following error. Kindly assist.

(venv) ubuntu@ip-172-31-40-24:/usr/local/src/security_monkey$ monkey db upgrade Traceback (most recent call last): File "/usr/local/src/security_monkey/venv/bin/monkey", line 6, in from pkg_resources import load_entry_point File "/usr/local/src/security_monkey/venv/local/lib/python2.7/site-packages/pkg_resources/init.py", line 3088, in @_call_aside File "/usr/local/src/security_monkey/venv/local/lib/python2.7/site-packages/pkg_resources/init.py", line 3072, in _call_aside f(*args, **kwargs) File "/usr/local/src/security_monkey/venv/local/lib/python2.7/site-packages/pkg_resources/init.py", line 3101, in _initialize_master_working_set working_set = WorkingSet._build_master() File "/usr/local/src/security_monkey/venv/local/lib/python2.7/site-packages/pkg_resources/init.py", line 576, in _build_master return cls._build_from_requirements(requires) File "/usr/local/src/security_monkey/venv/local/lib/python2.7/site-packages/pkg_resources/init.py", line 589, in _build_from_requirements dists = ws.resolve(reqs, Environment()) File "/usr/local/src/security_monkey/venv/local/lib/python2.7/site-packages/pkg_resources/init.py", line 778, in resolve raise DistributionNotFound(req, requirers) pkg_resources.DistributionNotFound: The 'deepdiff==4.0.9' distribution was not found and is required by security-monkey

mikegrima commented 4 years ago

Hello:

Did you install the requirements as documented here: https://github.com/Netflix/security_monkey/blob/develop/docs/installation/03-install-sm.md#clone-security_monkey ?

ping4lucifer commented 4 years ago

@mikegrima it worked like a charm. Thank you.

priyanka-devops08 commented 4 years ago

I have followed all the mentioned steps but still I can see below error after running monkey db upgrade:

/usr/local/src/security_monkey/venv/lib/python3.5/site-packages/flask_sqlalchemy/init.py:835: FSADeprecationWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future. Set it to True or False to suppress this warning. 'SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and ' Traceback (most recent call last): File "/usr/local/src/security_monkey/venv/bin/monkey", line 33, in sys.exit(load_entry_point('security-monkey==1.1.1', 'console_scripts', 'monkey')()) File "/usr/local/src/security_monkey/venv/bin/monkey", line 25, in importlib_load_entry_point return next(matches).load() File "/usr/local/src/security_monkey/venv/lib/python3.5/site-packages/importlib_metadata/init.py", line 105, in load module = import_module(match.group('module')) File "/usr/lib/python3.5/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 986, in _gcd_import File "", line 969, in _find_and_load File "", line 944, in _find_and_load_unlocked File "", line 222, in _call_with_frames_removed File "", line 986, in _gcd_import File "", line 969, in _find_and_load File "", line 958, in _find_and_load_unlocked File "", line 673, in _load_unlocked File "", line 665, in exec_module File "", line 222, in _call_with_frames_removed File "/usr/local/src/security_monkey/venv/lib/python3.5/site-packages/security_monkey/init.py", line 188, in from security_monkey.views.user_settings import UserSettings File "/usr/local/src/security_monkey/venv/lib/python3.5/site-packages/security_monkey/views/user_settings.py", line 15, in from marshmallow.validate import OneOf File "/usr/local/src/security_monkey/venv/lib/python3.5/site-packages/marshmallow/init.py", line 16, in from distutils.version import LooseVersion File "", line 969, in _find_and_load File "", line 958, in _find_and_load_unlocked File "", line 666, in _load_unlocked File "", line 577, in module_from_spec File "/usr/local/src/security_monkey/venv/lib/python3.5/site-packages/_distutils_hack/init.py", line 82, in create_module return importlib.import_module('._distutils', 'setuptools') File "/usr/lib/python3.5/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 981, in _gcd_import File "", line 931, in _sanity_check SystemError: Parent module 'setuptools' not loaded, cannot perform relative import

mikegrima commented 4 years ago

Please re-run the installation steps from the venv.

mikegrima commented 4 years ago

I just did a fresh clone and doing the following documented installation instructions worked perfectly for me:

export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
python3 -m venv venv
source venv/bin/activate
pip install --upgrade setuptools
pip install --upgrade pip
pip install --upgrade urllib3[secure]   # to prevent InsecurePlatformWarning
pip install -r requirements.txt
pip install google-compute-engine  # Only required on GCP
pip install oauth2client # Required to retrieve GCP data
pip install google-api-python-client # Required to retrieve GCP data
pip install httplib2 # Required to retrieve GCP data
pip install cloudaux\[gcp\]
pip install cloudaux\[openstack\]    # Only required on OpenStack
pip install .