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

docker-compose instructions unclear and db error #100

Open
skupfer opened this issue Oct 19, 2021 · 1 comment
Open

docker-compose instructions unclear and db error #100

skupfer opened this issue Oct 19, 2021 · 1 comment

Comments

@skupfer
Copy link

skupfer commented Oct 19, 2021

Short description

Evaluate Dagda. Therefore I used the docker-compose way to no avail.

Reproduction steps

  1. Install docker and docker-compose
  2. git clone repository
  3. docker-compose build
  4. docker-compose up -d
  5. docker-compose exec dagda /bin/sh -c 'python dagda.py vuln --init'´
  6. docker-compose exec dagda /bin/sh -c 'python dagda.py vuln --init_status'

Expected results

Get a working state of the database.

Actual results

I waited 1 hour (~250MBit network) for it to finish but it is still in state "Initializing". So something isn't working properly here I guess.

The status is now showing an error.

On which platforms did you notice this:

Please complete the following information:

  • OS: Ubuntu 18.04
  • Docker version: Latest

Backtrace

Unexpected exception of type TypeError occured: ('documents must be a non-empty list' )
docker.log

Same problem using the local setup on building <Updating RHSA & RHBA collections ...>

<2021-10-19 21:15:09,654> <ERROR> <DagdaServer> <dagda_server> <_init_or_update_db:155> <Unexpected exception of type TypeError occurred: ('documents must be a non-empty list',)>
Traceback (most recent call last):
  File "/home/kupfer/git/dagda/dagda/api/dagda_server.py", line 150, in _init_or_update_db
    db_composer.compose_vuln_db()
  File "/home/kupfer/git/dagda/dagda/vulnDB/db_composer.py", line 92, in compose_vuln_db
    self.mongoDbDriver.bulk_insert_rhsa(rhsa_list)
  File "/home/kupfer/git/dagda/dagda/driver/mongodb_driver.py", line 112, in bulk_insert_rhsa
    self.db.rhsa.insert_many(rhsa_list)
  File "/usr/local/lib/python3.8/dist-packages/pymongo/collection.py", line 755, in insert_many
    raise TypeError("documents must be a non-empty list")
TypeError: documents must be a non-empty list

Solution

  1. Update README with correct commands / correct way to setup dagda using docker-compose instead of manual install.
    1.1. Are the other steps still required? I am talking about: pip install requirements and kernel headers
  2. Update docker-compose with the environment variables or include a .env to be edited
services:
  dagda:
    build: .
    image: 3grander/dagda:0.8.0
    environment:
       - DAGDA_HOST=127.0.0.1
       - DAGDA_PORT=5000
  1. Include Falco and every other image/service needed in docker-compose.yml
    3.1. Shutdown is incomplete if these containers are still running!
@amills157
Copy link

amills157 commented Oct 20, 2021

I've had the same

<ERROR> <DagdaServer> <dagda_server> <_init_or_update_db:155> <Unexpected exception of type TypeError occurred: ('documents must be a non-empty list',)>

issue on a CentOS 7 machine using both docker-compose and on host build / setup

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

2 participants