DefectDojo / godojo

Golang installer for DefectDojo
GNU General Public License v3.0
25 stars 22 forks source link

Unable to install DefectDojo 2.20.1 #68

Closed byjoaofilipe closed 1 year ago

byjoaofilipe commented 1 year ago

Hello.

I'm trying to install the DefectDojo 2.20.1 with the default configuration from dojoConfig.yml. The only thing I have changed from this default file generated by the godojo it was these parameters:

image

I ran the godojo with the root user and with another user with sudo privileges and I always have the same error:

image

I have the PostgreSQL database up and running without problems.

PostgreSQL: 15.2

Ubuntu: 22.04.2 LTS

Thank you and have a nice day.

mtesauro commented 1 year ago

There were some changes in how to run migrations and I'm very close to completing a MAJOR refactor of godojo.

Give me a couple of days and I'll have a new release out that its tested for the install target you tried.

You could also clone the refactor branch and build a Go binary with the source if you're familiar with Go and need it quicker.

byjoaofilipe commented 1 year ago

hello @mtesauro

I have cloned the refactor branch and built a Go binary with the source. I ran the executable created from the "go build" but the same problem remains. Maybe there is something I have missed or some requirement (OS, dependencies, etc.). I'm going to share with you the logs and maybe you can help me to understand what happened during the installation.

Thank you for the help.

Log files and dojoConfig: logs-and-dojoConfig.zip

Local machine: Ubuntu: 22.04.2 LTS PostgreSQL: 15.2 Python: 3.10.6

byjoaofilipe commented 1 year ago

Hello @mtesauro

I tried to install the DefectDojo with the last release (godojo-v1.2.0_standard.zip) but I faced the same problem during the installation.

Can you help me to understand what is happening?

See the attachments with the logs: godojo-problem-04112023.zip

Thank you!

mtesauro commented 1 year ago

@byjoaofilipe So the best way to figure out what went wrong is to take the last command from ./logs/cmd-output_[timestamp].log and manually try it in a terminal as you'll usually get a decent error message.

So, from what you sent, I'd run the following (assuming you've still got that OS running and haven't removed/deleted things godojo did):

cd /opt/dojo/django-DefectDojo && source ../bin/activate && python3 manage.py migrate

Once you run that command, drop the error message here if it doesn't help you figure out what's going wrong.

From the logs you sent, it looks like you're installing on Ubuntu 22.04 with a local PosgreSQL database which is one of the better tested install targets.

mtesauro commented 1 year ago

@byjoaofilipe Two more things:

(1) I'd do a specific release version rather then a source install. I noticed this in the logs:

INFO:    2023/04/11 09:50:41 SECTION: Downloading the source for DefectDojo
TRACE:   2023/04/11 09:50:41 Determining if this is a source or release install: SourceInstall is true
TRACE:   2023/04/11 09:50:41 Dojo will be installed from source
INFO:    2023/04/11 09:50:41 Downloading DefectDojo source as a branch or commit from the repo directly
TRACE:   2023/04/11 09:50:41 Creating source directory if it doesn't exist already
TRACE:   2023/04/11 09:50:41 Determining if a commit or branch will be checked out of the repo
INFO:    2023/04/11 09:50:41 DefectDojo will be installed from master branch
TRACE:   2023/04/11 09:50:41 Checking out branch master

So I'd change the first few lines of dojoConfig.yml to read something like:

Install:
  Version: "2.21.0" # DD_Version - Release version of DefectDojo from Github Releases
  SourceInstall: false # DD_SourceInstall - Boolean if a source install is desired (vs a release)

where Version is a specific release of DefectDojo and SourceInstall is false. Source installs are really only meant for automated QA tests or to debug a very specific tag/commit.

(2) I just tried an install of DefectDojo on Ubuntu 22.04 with a local PostgreSQL and it worked - note I specified a specific version (2.21.0) and didn't do a source install.

This is the output after running a script that sets up a VM for me to run godojo against:

Launching Ubuntu 22.04
root@3c71d7dfe894:/opt/godojo# ./godojo 

==============================================================================
  Starting the dojo install at Tue Apr 11, 2023 21:05:49 UTC
==============================================================================

        ____       ____          __     ____          _      
       / __ \___  / __/__  _____/ /_   / __ \____    (_)___  
      / / / / _ \/ /_/ _ \/ ___/ __/  / / / / __ \  / / __ \ 
     / /_/ /  __/ __/  __/ /__/ /_   / /_/ / /_/ / / / /_/ / 
    /_____/\___/_/  \___/\___/\__/  /_____/\____/_/ /\____/  
                                               /___/         
    version  1.2.0

  Welcome to godojo, the official way to install DefectDojo on iron.
  For more information on how goDojo does an install, see:
  https://github.com/DefectDojo/godojo

==============================================================================
  Determining OS for installation
==============================================================================

OS was determined to be Linux, Ubuntu:22.04
DefectDojo installation on this OS is supported, continuing

==============================================================================
  Bootstrapping the godojo installer
==============================================================================

Boostraping godojo installer complete

==============================================================================
  Checking for Python 3
==============================================================================

Python 3 found, install can continue

==============================================================================
  Downloading the source for DefectDojo
==============================================================================

Downloading the configured release of DefectDojo => version 2.21.0
Successfully downloaded and extracted the DefectDojo release file

==============================================================================
  Installing OS packages needed for DefectDojo
==============================================================================

Installing OS packages complete

==============================================================================
  Installing database needed for DefectDojo
==============================================================================

Installing Database complete

==============================================================================
  Starting the database needed for DefectDojo
==============================================================================

Starting Database complete

==============================================================================
  Preparing the database needed for DefectDojo
==============================================================================

Checking connectivity to PostgreSQL
Validating DB connection settings

==============================================================================
  Starting the database needed for DefectDojo
==============================================================================

Starting Database complete

==============================================================================
  Preparing the OS for DefectDojo installation
==============================================================================

Preparing the OS complete

==============================================================================
  Creating settings.py for DefectDojo
==============================================================================

Creating settings.py for DefectDojo complete

==============================================================================
  Setting up Django for DefectDojo
==============================================================================

Setting up Django complete

Successfully installed DefectDojo using godojo version 1.2.0
byjoaofilipe commented 1 year ago

Hello @mtesauro

Sorry for the late reply. The DefectDojo is working fine now and it's very useful for the DevSecOps daily actions. We can close this issue.

Thank you for your help and explanation!

mtesauro commented 1 year ago

Glad things worked out for you. Best of luck with DefectDojo!