Two months ago, I started with HA development and contributed to an Integration. For unrelated reasons I later had to uninstall WSL and remove the Docker volumes, images, and containers. Upon reinstalling, I am now unable to build a devcontainer, as I get the error:
An unexpected error has occurred: PermissionError: [Errno 1] Operation not permitted: '.git/hooks/pre-commit'
Specifically, this fails on the line: pre-commit install
After a bit of searching, I saw that this error has been discussed previously and that a suggested workaround was to add sudo -E
to "postCreateCommand": "git config...
in devcontainer.json
. I found that sudo -E
had no effect but just plain sudo
instead resulted in a different error:
An error has occurred: FatalError: git failed. Is it installed, and are you in a Git repository directory?
However, I am suspicious that the configuration files in my build are not at fault. I have merged the latest updates with my repo, and have also tried rolling back to the last working commit two months ago: neither has any effect.
One surprising thing is that When I run lsb_release -a
from within the terminal within VS Code (presumably within that Linux container?), the output is:
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm
But when I run wsl --list --verbose
under Windows, the output is:
NAME STATE VERSION
* Ubuntu Running 2
docker-desktop Running 2
Am I accidentally running Debian instead of Ubuntu, and might that be causing the issue? If so, how is that occurring? Or is there some other reason?