When I try to run the dev container for core I get the following error:
Requirement already satisfied: distlib<1,>=0.3.6 in /usr/local/lib/python3.9/sit
e-packages (from virtualenv>=20.0.8->pre-commit) (0.3.6)
Requirement already satisfied: platformdirs<3,>=2.4 in /usr/local/lib/python3.9/
site-packages (from virtualenv>=20.0.8->pre-commit) (2.5.4)
Requirement already satisfied: filelock<4,>=3.4.1 in /usr/local/lib/python3.9/si
te-packages (from virtualenv>=20.0.8->pre-commit) (3.8.0)
Requirement already satisfied: setuptools in /usr/local/lib/python3.9/site-packa
ges (from nodeenv>=0.11.1->pre-commit) (58.1.0)
Installing collected packages: colorlog
Successfully installed colorlog-6.7.0
WARNING: You are using pip version 22.0.4; however, version 22.3.1 is available.
You should consider upgrading via the '/usr/local/bin/python3 -m pip install --u
pgrade pip' command.
An error has occurred: FatalError: git failed. Is it installed, and are you in a
Git repository directory?
Check the log at /home/vscode/.cache/pre-commit/pre-commit.log
[18684 ms] postCreateCommand failed with exit code 1. Skipping any further user-provided commands.
Done. Press any key to close the terminal.
Here the log from the /home/vscode/.cache/pre-commit/pre-commit.log
file
### version information
pre-commit version: 2.20.0
git --version: git version 2.38.1
sys.version:
3.9.15 (main, Oct 26 2022, 03:47:43)
[GCC 10.2.1 20210110]
sys.executable: /usr/local/bin/python
os.name: posix
sys.platform: linux
### error information
An error has occurred: FatalError: git failed. Is it installed, and are you in a Git repository directory?
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/pre_commit/git.py", line 58, in get_root
cmd_output('git', 'rev-parse', '--show-cdup')[1].strip(),
File "/usr/local/lib/python3.9/site-packages/pre_commit/util.py", line 152, in cmd_output
returncode, stdout_b, stderr_b = cmd_output_b(*cmd, **kwargs)
File "/usr/local/lib/python3.9/site-packages/pre_commit/util.py", line 146, in cmd_output_b
raise CalledProcessError(returncode, cmd, retcode, stdout_b, stderr_b)
pre_commit.util.CalledProcessError: command: ('/usr/local/bin/git', 'rev-parse', '--show-cdup')
return code: 128
expected return code: 0
stdout: (none)
stderr:
fatal: detected dubious ownership in repository at '/workspaces/core'
To add an exception for this directory, call:
git config --global --add safe.directory /workspaces/core
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/pre_commit/error_handler.py", line 73, in error_handler
yield
File "/usr/local/lib/python3.9/site-packages/pre_commit/main.py", line 343, in main
_adjust_args_and_chdir(args)
File "/usr/local/lib/python3.9/site-packages/pre_commit/main.py", line 161, in _adjust_args_and_chdir
toplevel = git.get_root()
File "/usr/local/lib/python3.9/site-packages/pre_commit/git.py", line 64, in get_root
raise FatalError(
pre_commit.errors.FatalError: git failed. Is it installed, and are you in a Git repository directory?
Any suggestions how I can solve this? Git is installed within my system