devcontainers / devcontainers/images
"Fatal error: git failed" in postCreateCommand on python3.11
- Dominant language
- Shell
- Stars
- 2.1k
- Forks
- 963
- Avg merge
- 7h 48m
- Merged PRs (30d)
- 11
Description
I am honestly not sure if this is an error with the images, Dev Containers extension, or CLI, but am starting here.
In the past week, I've gotten reports on two repositories of errors from my postCreateCommand script that worked fine before. The script calls "pre-commit install" which sets up pre-commit hooks for the current git repository. In both cases, the developer opening the dev container was indeed opening it from a git repository, so it should have worked.
Here are the reports:
https://github.com/Azure-Samples/ai-rag-chat-evaluator/issues/2
https://github.com/pamelafox/simple-fastapi-container/issues/42
The error is:
"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 [18551 ms] postCreateCommand failed with exit code 1. Skipping any further user-provided commands."
The postCreateCommand is "pip install -r requirements-dev.txt && pre-commit install"
Both repositories are using "mcr.microsoft.com/devcontainers/python:3.11" although the second one is using "-bullseye" pin specifically.
Did anything change with the images in terms of their git support in the last 1-2 weeks? If not, then I'll ask the extension team if something changed on their side.
I do not believe it's an issue with pre-commit as they haven't had a recent release. Thanks!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.