tcosolutions / betterscan

Code Scanning/SAST/Static Analysis/Linting using many tools/Scanners with One Report (Code, IaC) - Betterscan
https://betterscan.io
GNU Affero General Public License v3.0
818 stars 90 forks source link

Docker container crashing and retarting #207

Open danielcoquette opened 13 hours ago

danielcoquette commented 13 hours ago

Hello, I've install the container as shown in the README file. Address htp://locahost:500 is not available. Here is the logs from docker compose up:

/betterscan/dockerhub ⎇ main $ docker compose up
WARN[0000] The "OPENAI_GPT_API" variable is not set. Defaulting to a blank string. 
WARN[0000] The "OPENAI_GPT_API" variable is not set. Defaulting to a blank string. 
[+] Running 5/5
 ✔ Network dockerhub_default       Created                                                                                                           0.2s 
 ✔ Container dockerhub-postgres-1  Created                                                                                                           0.1s 
 ✔ Container rabbitmq              Created                                                                                                           0.1s 
 ✔ Container dockerhub-server-1    Created                                                                                                           0.1s 
 ✔ Container dockerhub-worker_1-1  Created                                                                                                           0.0s 
Attaching to postgres-1, server-1, worker_1-1, rabbitmq
postgres-1  | 
postgres-1  | PostgreSQL Database directory appears to contain a database; Skipping initialization
postgres-1  | 
postgres-1  | 2024-12-02 10:03:26.814 UTC [1] LOG:  starting PostgreSQL 13.2 (Debian 13.2-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
postgres-1  | 2024-12-02 10:03:26.814 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
postgres-1  | 2024-12-02 10:03:26.814 UTC [1] LOG:  listening on IPv6 address "::", port 5432
postgres-1  | 2024-12-02 10:03:26.818 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres-1  | 2024-12-02 10:03:26.825 UTC [26] LOG:  database system was shut down at 2024-12-02 10:03:06 UTC
postgres-1  | 2024-12-02 10:03:26.832 UTC [1] LOG:  database system is ready to accept connections
rabbitmq    | WARNING: 'docker-entrypoint.sh' generated/modified the RabbitMQ configuration file, which will no longer happen in 3.9 and later! (https://github.com/docker-library/rabbitmq/pull/424)
rabbitmq    | 
rabbitmq    | Generated end result, for reference:
rabbitmq    | ------------------------------------
rabbitmq    | loopback_users.guest = false
rabbitmq    | 
rabbitmq    | listeners.tcp.default = 5672
rabbitmq    | 
rabbitmq    | default_pass = qc
rabbitmq    | 
rabbitmq    | default_user = qc
rabbitmq    | 
rabbitmq    | management.tcp.port = 15672
rabbitmq    | ------------------------------------
rabbitmq    | Configuring logger redirection
server-1    | Traceback (most recent call last):
server-1    |   File "/srv/betterscan/manage.py", line 22, in <module>
server-1    |     from quantifiedcode.settings import settings
server-1    |   File "/srv/betterscan/quantifiedcode/settings/__init__.py", line 22, in <module>
server-1    |     from .base import * #noqa
server-1    |   File "/srv/betterscan/quantifiedcode/settings/base.py", line 33, in <module>
server-1    |     from quantifiedcode.helpers.settings import Settings, load_settings
server-1    |   File "/srv/betterscan/quantifiedcode/helpers/settings.py", line 26, in <module>
server-1    |     import yaml
server-1    | ModuleNotFoundError: No module named 'yaml'
server-1 exited with code 0
Gracefully stopping... (press Ctrl+C again to force)
dependency failed to start: container rabbitmq is unhealthy
marcinguy commented 11 hours ago

yaml should be in PyYAML. I triggered a rebuild and did some cleanup

danielcoquette commented 9 hours ago

Hello :)

Thanks you for your prompt reply :+1:

It seems your modification on docker-compose.yml is not valid:

/betterscan/dockerhub ⎇ main $ docker compose up                                                                          
validating /home/daniel/Projects/betterscan/dockerhub/docker-compose.yml: services.worker_1.environment must be a mapping                                 

I remove environment: from section worker_1: and it build. But error ModuleNotFoundError: No module named 'yaml' is still there.