Git path on Django migrate command
Hello, When installing AWX v15 on Bullseye, on the Django migrate step, under root account, I've got the error below.
sudo -u awx awx-manage migrate
Traceback (most recent call last):
File "/var/lib/awx/venv/awx/lib/python3.9/site-packages/git/__init__.py", line 83, in <module>
refresh()
File "/var/lib/awx/venv/awx/lib/python3.9/site-packages/git/__init__.py", line 73, in refresh
if not Git.refresh(path=path):
File "/var/lib/awx/venv/awx/lib/python3.9/site-packages/git/cmd.py", line 278, 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()
All git commands will error until this is rectified.
This initial warning can be silenced or aggravated in the future by setting the
$GIT_PYTHON_REFRESH environment variable. Use one of the following values:
- quiet|q|silence|s|none|n|0: for no warning or exception
- warn|w|warning|1: for a printed warning
- error|e|raise|r|2: for a raised exception
Example:
export GIT_PYTHON_REFRESH=quiet
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/bin/awx-manage", line 10, in <module>
load_entry_point('awx', 'console_scripts', 'awx-manage')()
File "/var/lib/awx/venv/awx/lib/python3.9/site-packages/awx/__init__.py", line 154, in manage
execute_from_command_line(sys.argv)
File "/var/lib/awx/venv/awx/lib/python3.9/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/var/lib/awx/venv/awx/lib/python3.9/site-packages/django/core/management/__init__.py", line 357, in execute
django.setup()
File "/var/lib/awx/venv/awx/lib/python3.9/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/var/lib/awx/venv/awx/lib/python3.9/site-packages/django/apps/registry.py", line 114, in populate
app_config.import_models()
File "/var/lib/awx/venv/awx/lib/python3.9/site-packages/django/apps/config.py", line 211, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 790, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/var/lib/awx/venv/awx/lib/python3.9/site-packages/awx/conf/models.py", line 11, in <module>
from awx.main.models.base import CreatedModifiedModel, prevent_search
File "/var/lib/awx/venv/awx/lib/python3.9/site-packages/awx/main/models/__init__.py", line 206, in <module>
activity_stream_registrar.connect(Organization)
File "/var/lib/awx/venv/awx/lib/python3.9/site-packages/awx/main/registrar.py", line 14, in connect
from awx.main.signals import activity_stream_create, activity_stream_update, activity_stream_delete, activity_stream_associate
File "/var/lib/awx/venv/awx/lib/python3.9/site-packages/awx/main/signals.py", line 42, in <module>
from awx.main.tasks import update_inventory_computed_fields
File "/var/lib/awx/venv/awx/lib/python3.9/site-packages/awx/main/tasks.py", line 45, in <module>
import git
File "/var/lib/awx/venv/awx/lib/python3.9/site-packages/git/__init__.py", line 85, in <module>
raise ImportError('Failed to initialize: {0}'.format(exc)) from exc
ImportError: Failed to initialize: 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()
All git commands will error until this is rectified.
This initial warning can be silenced or aggravated in the future by setting the
$GIT_PYTHON_REFRESH environment variable. Use one of the following values:
- quiet|q|silence|s|none|n|0: for no warning or exception
- warn|w|warning|1: for a printed warning
- error|e|raise|r|2: for a raised exception
Example:
export GIT_PYTHON_REFRESH=quiet
Under a user with sudo permissions, it works. For information, I didn't install git and / or python3-git on the server before launching the AWX installation.