You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When starting up a clean environment for HA core development using VSCode DevContainers, I get the following error during the postCreate phase:
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
[81665 ms] postCreateCommand failed with exit code 1. Skipping any further user-provided commands.
What version of Home Assistant Core has the issue?
2022.12.x
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Core
Integration causing the issue
No response
Link to integration documentation on our website
No response
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Here's the content of the log output during devcontainer startup:
vscode ➜ /workspaces/home-assistant-core $ cat /home/vscode/.cache/pre-commit/pre-commit.log
### version information
pre-commit version: 2.20.0
git --version: git version 2.38.1
sys.version:
3.9.15 (main, Nov 15 2022, 21:37:24)
[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/home-assistant-core'
To add an exception for this directory, call:
git config --global --add safe.directory /workspaces/home-assistant-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?
### Additional information
I'm running on Windows without anything funky going on.
Looks like the fix should be straight forward. More problematic is that this can occur out of the box and the error message provided is not really all that usefull for newbie aspiring contributors.
The text was updated successfully, but these errors were encountered:
RoboMagus
changed the title
Devcontainer bootstrap script fails
Devcontainer postCreateCommand fails
Dec 11, 2022
The problem
When starting up a clean environment for HA core development using VSCode DevContainers, I get the following error during the postCreate phase:
What version of Home Assistant Core has the issue?
2022.12.x
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Core
Integration causing the issue
No response
Link to integration documentation on our website
No response
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
error information
The text was updated successfully, but these errors were encountered: