Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unbale to run manage.py script #231

Open
ngms17 opened this issue May 11, 2021 · 15 comments
Open

Unbale to run manage.py script #231

ngms17 opened this issue May 11, 2021 · 15 comments

Comments

@ngms17
Copy link

ngms17 commented May 11, 2021

Hello,

Getting this error while running the script.

image

Dont know how to fix this. I need some help

@pevma
Copy link
Member

pevma commented May 11, 2021

Which Scirius version do you use and what is the command you are trying to execute?

@ngms17
Copy link
Author

ngms17 commented May 11, 2021

Now i am trying to execute "python3 manage.py migrate"

Its giving me this error.
root@suricata:~/scirius# python3 manage.py migrate
Traceback (most recent call last):
File "manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.6/dist-packages/django/core/management/init.py", line 419, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.6/dist-packages/django/core/management/init.py", line 395, in execute
django.setup()
File "/usr/local/lib/python3.6/dist-packages/django/init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python3.6/dist-packages/django/apps/registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "/usr/local/lib/python3.6/dist-packages/django/apps/config.py", line 224, in create
import_module(entry)
File "/usr/lib/python3.6/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 994, in _gcd_import
File "", line 971, in _find_and_load
File "", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'bootstrap3'

@ngms17
Copy link
Author

ngms17 commented May 11, 2021

Following all the commands from the documentation gives me the first error that i have shown

@pevma
Copy link
Member

pevma commented May 11, 2021

It seems some dependencies are missing.
@yodapotatofly can you lend a hand ?

@yodapotatofly
Copy link
Contributor

yodapotatofly commented May 11, 2021

The missing dependencies usually occurs because scirius is using a python virtual environment. Therefore, python packages (dependencies) are only available from inside the virtual env.
The virtual env needs to be activated before running those commands.

I will be able to complete this answer with exact commands tomorrow

@yodapotatofly
Copy link
Contributor

yodapotatofly commented May 12, 2021

Usually, the path to scirius installation is /usr/share/python/scirius

Following commands should resolve your issue :

cd /usr/share/python/scirius/
. bin/activate
python3 bin/manage.py migrate
deactivate
cd ~

@ngms17
Copy link
Author

ngms17 commented May 12, 2021

Usually, the path to scirius installation is /usr/share/python/scirius

Following commands should resolve your issue :

cd /usr/share/python/scirius/
. bin/activate
python3 bin/manage.py migrate
deactivate
cd ~

But i dont have the following path "cd /usr/share/python/scirius".

Scirius folder is not there

@ngms17
Copy link
Author

ngms17 commented May 12, 2021

Is there any way to remove scirius and remove and the dependencies attached to it?

In order to follow all the commands all over again?

@yodapotatofly
Copy link
Contributor

Is there any way to remove scirius and remove and the dependencies attached to it?

apt purge scirius
apt autoremove

@ngms17
Copy link
Author

ngms17 commented May 12, 2021

Getting this error when executing "npm install -g npm@latest [email protected]"

Screenshot 2021-05-12 at 22 45 19

@yodapotatofly
Copy link
Contributor

yodapotatofly commented May 14, 2021

You could just use the apt package instead of building everything by hand:
sudo apt install scirius

However, if you want to build it yourself, please follow those commands for the nodejs part

sudo apt-get install npm
npm install
npm install -g [email protected]
webpack
cd hunt
npm install
npm run build
cd ..

@ngms17
Copy link
Author

ngms17 commented May 14, 2021

Using the apt package gives the error "unable to locate the package".

What is the repository?

@yodapotatofly
Copy link
Contributor

yodapotatofly commented May 19, 2021

What OS are you running ?

@ngms17
Copy link
Author

ngms17 commented May 19, 2021

Ubuntu 18.04

@yodapotatofly
Copy link
Contributor

OK so indeed the debian package would not be the way to go.

First make sure you have the python dependencies :

python -m pip install --upgrade pip wheel setuptools
python -m pip install --upgrade six python-daemon suricatactl
python -m pip install django-bootstrap3==11.1.0 elasticsearch-curator==5.6 django-webpack-loader==0.7 pyinotify
python -m pip install -r requirements.txt  

then execute the commands for the nodejs part :

sudo apt-get install npm

npm install
npm install -g [email protected]
webpack
cd hunt
npm install
npm run build
cd ..

You should then be able to go on from there https://scirius.readthedocs.io/en/latest/installation-ce.html#running-scirius-ce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants