Containers are failing to start due to missing git executable
Summary
Newer versions of the defectdojo-django containers are crashing with an ImportError (see stacktrace in logs/screenshots section below).
Older versions of the containers do not exhibit this behavior. For example, version 2.20.1 containers are working correctly.
I inspected the 2.20.1 containers and found a git executable available in the container:
$ git -v
I inspected the 2.24.2 containers and did NOT find a git exeuctable. It seems to have gone missing.
Steps to reproduce
Launch the containers with the standard docker-compose configuration using the postgres-redis option and inspect the logs, and you will see the error messages.
What is the current bug behavior?
The containers are crashing because the entrypoint script cannot find a git executable.
What is the expected correct behavior?
The containers should stay running and host the django application.
Relevant logs and/or screenshots
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/git/__init__.py", line 89, in <module>
refresh()
File "/usr/local/lib/python3.9/site-packages/git/__init__.py", line 76, in refresh
if not Git.refresh(path=path):
File "/usr/local/lib/python3.9/site-packages/git/cmd.py", line 392, in refresh
raise ImportError(err)
ImportError: Bad git executable.
The git executable must be specified in one of the following ways:
- be included in your $PATH
- be set via $GIT_PYTHON_GIT_EXECUTABLE
- explicitly set via git.refresh()
Possible fixes
Unsure why the git executable is no longer available in recent versions of the containers.
Tasks
-
Bug has been identified and corrected within the container