Skip to content
This repository has been archived by the owner on Feb 23, 2021. It is now read-only.

Cuckoo crashes after connecitng to postgress #38

Open
TeslaSolari opened this issue Jan 16, 2019 · 1 comment
Open

Cuckoo crashes after connecitng to postgress #38

TeslaSolari opened this issue Jan 16, 2019 · 1 comment

Comments

@TeslaSolari
Copy link

Issue

When creating a Cuckoo Stack after cuckoo initilizes the postgress DB the container ruccing the cuckoo Deamon simply crashes with no error code,

The Webui does launch and I am able to browse but not fuction calling th cuckoo api works.

This could also have somthing to do with me porting the compose file over to V3.

Compose file

version: "3"

services:

  postgres:
    image: postgres
    ports:
      - 5432
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: cuckoo
      PGDATA: /var/lib/postgresql/data/pgdata
      # POSTGRES_INITDB_ARGS: --data-checksums
    volumes:
      - postgres-db:/var/lib/postgresql/data/pgdata
    networks:
      - cuckoo
    logging:
      driver: "json-file"

  mongo:
    image: mongo
    ports:
      - 27017
    volumes:
      - mongo-data:/data/db
    networks:
      - cuckoo

  elasticsearch:
    image: blacktop/elasticsearch
    ports:
      - 9200
    volumes:
      - es-data:/usr/share/elasticsearch/data
    networks:
      - cuckoo
    logging:
      driver: "json-file"

  cuckoo:
    image: blacktop/cuckoo
    command: daemon
    ports:
      - "2042:2042"
    depends_on:
      - mongo
      - elasticsearch
      - postgres
      - api
    volumes:
      - cuckoo-tmp:/tmp/cuckoo-tmp/
      - cuckoo-storage:/cuckoo/storage/
    networks:
      - cuckoo
    env_file:
      - ./2.0/config-file.env
    logging:
      driver: "json-file"

  web:
    image: blacktop/cuckoo
    ports:
      - "80:31337"
    depends_on:
      - mongo
      - elasticsearch
      - postgres
    command: web
    volumes:
      - cuckoo-tmp:/tmp/cuckoo-tmp/
      - cuckoo-storage:/cuckoo/storage/
    networks:
      - cuckoo
    env_file:
      - ./2.0/config-file.env
    logging:
      driver: "json-file"

  api:
    depends_on:
      - postgres
    image: blacktop/cuckoo
    ports:
      - "8000:1337"
    depends_on:
      - postgres
    command: api
    volumes:
      - cuckoo-tmp:/tmp/cuckoo-tmp/
      - cuckoo-storage:/cuckoo/storage/
    networks:
      - cuckoo
    env_file:
      - ./2.0/config-file.env
    logging:
      driver: "json-file"

networks:
  cuckoo:
    driver: overlay

volumes:
  cuckoo-data:
    driver: cloudstor:aws
    driver_opts:
      backing: "shared"
  cuckoo-tmp:
    driver: cloudstor:aws
    driver_opts:
      backing: "shared"
  cuckoo-storage:
    driver: cloudstor:aws
    driver_opts:
      backing: "shared"
  mongo-data:
    driver: cloudstor:aws
    driver_opts:
      backing: "shared"
      perfmode: "maxio"
  es-data:
    driver: cloudstor:aws
    driver_opts:
      backing: "shared"
      perfmode: "maxio"
  postgres-db:
    driver: cloudstor:aws
    driver_opts:
      backing: "shared"
      perfmode: "maxio"

Logs

Cuckoo


080iych0t9h9 www.cuckoosandbox.org
080iych0t9h9 Copyright (c) 2010-2017
080iych0t9h9
080iych0t9h9 2019-01-16 09:48:49,927 [cuckoo.core.startup] DEBUG: Imported modules...
080iych0t9h9 2019-01-16 09:48:50,435 [elasticsearch] WARNING: �[33mPUT http://elasticsearch:9200/_template/cuckoo_template [status:400 request:0.490s]�[0m
080iych0t9h9 Traceback (most recent call last):
080iych0t9h9 File "/usr/bin/cuckoo", line 11, in <module>
080iych0t9h9 load_entry_point('Cuckoo==2.0.5.3', 'console_scripts', 'cuckoo')()
080iych0t9h9 File "/usr/lib/python2.7/site-packages/click/core.py", line 716, in __call__
080iych0t9h9 return self.main(*args, **kwargs)
080iych0t9h9 File "/usr/lib/python2.7/site-packages/click/core.py", line 696, in main
080iych0t9h9 rv = self.invoke(ctx)
080iych0t9h9 File "/usr/lib/python2.7/site-packages/click/core.py", line 1037, in invoke
080iych0t9h9 return Command.invoke(self, ctx)
080iych0t9h9 File "/usr/lib/python2.7/site-packages/click/core.py", line 889, in invoke
080iych0t9h9 return ctx.invoke(self.callback, **ctx.params)
080iych0t9h9 File "/usr/lib/python2.7/site-packages/click/core.py", line 534, in invoke
080iych0t9h9 return callback(*args, **kwargs)
080iych0t9h9 File "/usr/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
080iych0t9h9 return f(get_current_context(), *args, **kwargs)
080iych0t9h9 File "/usr/lib/python2.7/site-packages/cuckoo/main.py", line 240, in main
080iych0t9h9 sys.stderr.write(exception_message())
080iych0t9h9 File "/usr/lib/python2.7/site-packages/cuckoo/common/utils.py", line 260, in exception_message
080iych0t9h9 for package in pip.get_installed_distributions()
080iych0t9h9 AttributeError: 'module' object has no attribute 'get_installed_distributions'
iarrvmt92cce ===> Use default ports and hosts if not specified...
iarrvmt92cce ES_HOST=elasticsearch
iarrvmt92cce ES_PORT=9200
iarrvmt92cce MONGO_HOST=mongo
iarrvmt92cce MONGO_TCP_PORT=27017
iarrvmt92cce POSTGRES_HOST=postgres
iarrvmt92cce POSTGRES_TCP_PORT=5432
iarrvmt92cce RESULTSERVER=0.0.0.0
iarrvmt92cce RESULTSERVER_HOST=0.0.0.0
iarrvmt92cce RESULTSERVER_PORT=2042
iarrvmt92cce
iarrvmt92cce ===> Update /cuckoo/conf/reporting.conf if needed...
iarrvmt92cce
iarrvmt92cce ===> Waiting on elasticsearch(http://elasticsearch:9200) to start...
iarrvmt92cce Elasticsearch is ready!
iarrvmt92cce
iarrvmt92cce ===> Waiting for MongoDB(mongo:27017) to start...MongoDB is ready!
iarrvmt92cce
iarrvmt92cce ===> Waiting for Postgres(postgres:5432) to start...Postgres is ready!
iarrvmt92cce �[36m
iarrvmt92cce sSSs .S S. sSSs .S S. sSSs_sSSs sSSs_sSSs
iarrvmt92cce d%%SP .SS SS. d%%SP .SS SS. d%%SP~YS%%b d%%SP~YS%%b
iarrvmt92cce d%S' S%S S%S d%S' S%S S&S d%S' `S%b d%S' `S%b
iarrvmt92cce S%S S%S S%S S%S S%S d*S S%S S%S S%S S%S
iarrvmt92cce S&S S&S S&S S&S S&S .S*S S&S S&S S&S S&S
iarrvmt92cce S&S S&S S&S S&S S&S_sdSSS S&S S&S S&S S&S
iarrvmt92cce S&S S&S S&S S&S S&S~YSSY%b S&S S&S S&S S&S
iarrvmt92cce S&S S&S S&S S&S S&S `S% S&S S&S S&S S&S
iarrvmt92cce S*b S*b d*S S*b S*S S% S*b d*S S*b d*S
iarrvmt92cce S*S. S*S. .S*S S*S. S*S S& S*S. .S*S S*S. .S*S
iarrvmt92cce SSSbs SSSbs_sdSSS SSSbs S*S S& SSSbs_sdSSS SSSbs_sdSSS
iarrvmt92cce YSSP YSSP~YSSY YSSP S*S SS YSSP~YSSY YSSP~YSSY
iarrvmt92cce SP
iarrvmt92cce Y�[0m
iarrvmt92cce
iarrvmt92cce Cuckoo Sandbox �[33m2.0.5�[0m
iarrvmt92cce www.cuckoosandbox.org
iarrvmt92cce Copyright (c) 2010-2017
iarrvmt92cce
iarrvmt92cce 2019-01-16 09:49:06,310 [cuckoo.core.startup] DEBUG: Imported modules...
iarrvmt92cce 2019-01-16 09:49:06,432 [elasticsearch] WARNING: �[33mPUT http://elasticsearch:9200/_template/cuckoo_template [status:400 request:0.095s]�[0m
iarrvmt92cce Traceback (most recent call last):
iarrvmt92cce File "/usr/bin/cuckoo", line 11, in <module>
iarrvmt92cce load_entry_point('Cuckoo==2.0.5.3', 'console_scripts', 'cuckoo')()
iarrvmt92cce File "/usr/lib/python2.7/site-packages/click/core.py", line 716, in __call__
iarrvmt92cce return self.main(*args, **kwargs)
iarrvmt92cce File "/usr/lib/python2.7/site-packages/click/core.py", line 696, in main
iarrvmt92cce rv = self.invoke(ctx)
iarrvmt92cce File "/usr/lib/python2.7/site-packages/click/core.py", line 1037, in invoke
iarrvmt92cce return Command.invoke(self, ctx)
iarrvmt92cce File "/usr/lib/python2.7/site-packages/click/core.py", line 889, in invoke
iarrvmt92cce return ctx.invoke(self.callback, **ctx.params)
iarrvmt92cce File "/usr/lib/python2.7/site-packages/click/core.py", line 534, in invoke
iarrvmt92cce return callback(*args, **kwargs)
iarrvmt92cce File "/usr/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
iarrvmt92cce return f(get_current_context(), *args, **kwargs)
iarrvmt92cce File "/usr/lib/python2.7/site-packages/cuckoo/main.py", line 240, in main
iarrvmt92cce sys.stderr.write(exception_message())
iarrvmt92cce File "/usr/lib/python2.7/site-packages/cuckoo/common/utils.py", line 260, in exception_message
iarrvmt92cce for package in pip.get_installed_distributions()
iarrvmt92cce AttributeError: 'module' object has no attribute 'get_installed_distributions'
kdecvxtgk0qz ===> Use default ports and hosts if not specified...
kdecvxtgk0qz ES_HOST=elasticsearch
kdecvxtgk0qz ES_PORT=9200
kdecvxtgk0qz MONGO_HOST=mongo
kdecvxtgk0qz MONGO_TCP_PORT=27017
kdecvxtgk0qz POSTGRES_HOST=postgres
kdecvxtgk0qz POSTGRES_TCP_PORT=5432
kdecvxtgk0qz RESULTSERVER=0.0.0.0
kdecvxtgk0qz RESULTSERVER_HOST=0.0.0.0
kdecvxtgk0qz RESULTSERVER_PORT=2042
kdecvxtgk0qz
kdecvxtgk0qz ===> Update /cuckoo/conf/reporting.conf if needed...
kdecvxtgk0qz
kdecvxtgk0qz ===> Waiting on elasticsearch(http://elasticsearch:9200) to start...
kdecvxtgk0qz Elasticsearch is ready!
kdecvxtgk0qz
kdecvxtgk0qz ===> Waiting for MongoDB(mongo:27017) to start...MongoDB is ready!
kdecvxtgk0qz
kdecvxtgk0qz ===> Waiting for Postgres(postgres:5432) to start...Postgres is ready!

Postgres

3sfc5e2gsz0z 2019-01-16 09:48:18.817 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
3sfc5e2gsz0z 2019-01-16 09:48:18.817 UTC [1] LOG: listening on IPv6 address "::", port 5432
3sfc5e2gsz0z 2019-01-16 09:48:18.838 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
3sfc5e2gsz0z 2019-01-16 09:48:19.309 UTC [21] LOG: database system was shut down at 2019-01-16 09:47:26 UTC
3sfc5e2gsz0z 2019-01-16 09:48:19.645 UTC [1] LOG: database system is ready to accept connections
3sfc5e2gsz0z 2019-01-16 09:48:42.919 UTC [28] LOG: incomplete startup packet
3sfc5e2gsz0z 2019-01-16 09:48:42.928 UTC [29] LOG: incomplete startup packet
3sfc5e2gsz0z 2019-01-16 09:48:42.968 UTC [30] LOG: incomplete startup packet
3sfc5e2gsz0z 2019-01-16 09:48:57.878 UTC [33] LOG: incomplete startup packet
3sfc5e2gsz0z 2019-01-16 09:49:12.676 UTC [36] LOG: incomplete startup packet
3sfc5e2gsz0z 2019-01-16 09:50:39.783 UTC [40] LOG: incomplete startup packet

Cuckoo API

ys92wqaom1z4 ===> Use default ports and hosts if not specified...
ys92wqaom1z4 ES_HOST=elasticsearch
ys92wqaom1z4 ES_PORT=9200
ys92wqaom1z4 MONGO_HOST=mongo
ys92wqaom1z4 MONGO_TCP_PORT=27017
ys92wqaom1z4 POSTGRES_HOST=postgres
ys92wqaom1z4 POSTGRES_TCP_PORT=5432
ys92wqaom1z4 RESULTSERVER_HOST=0.0.0.0
ys92wqaom1z4 RESULTSERVER_PORT=2042
ys92wqaom1z4
ys92wqaom1z4 ===> Update /cuckoo/conf/reporting.conf if needed...
ys92wqaom1z4
ys92wqaom1z4 ===> Waiting on elasticsearch(http://elasticsearch:9200) to start........................................
ys92wqaom1z4 Elasticsearch is ready!
ys92wqaom1z4
ys92wqaom1z4 ===> Waiting for MongoDB(mongo:27017) to start...MongoDB is ready!
ys92wqaom1z4
ys92wqaom1z4 ===> Waiting for Postgres(postgres:5432) to start...Postgres is ready!
ys92wqaom1z4 2019-01-16 09:48:49,756 [werkzeug] INFO: * Running on http://0.0.0.0:1337/ (Press CTRL+C to quit)
@sbazzell
Copy link

sbazzell commented May 12, 2020

It looks like you aren't getting it to crash because of postgres, but from the same issue I'm having with pip. If you look closely in the logs you will see an exception thrown.

080iych0t9h9 File "/usr/lib/python2.7/site-packages/cuckoo/common/utils.py", line 260, in exception_message
080iych0t9h9 for package in pip.get_installed_distributions()
080iych0t9h9 AttributeError: 'module' object has no attribute 'get_installed_distributions'

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

No branches or pull requests

2 participants