Ansible: git clone fails with "fatal: Out of memory, realloc failed"

Viewed 34

I'm using Ansible with a Windows host (VM). I'm trying to git clone a large content (actually using git lfs). It's around 15Go in total

I'm using git for windows (https://github.com/git-for-windows/git/releases/tag/v2.37.2.windows.2).

I have the following Ansible task:

- name: Clone repository
  ansible.windows.win_command: >
    <path/to/git.exe> clone <git-repo>

The problem is that it always fails with the error:

fatal: Out of memory, realloc failed

I tried to increase the windows VM memory, or to play with git config settings, as explained in several posts, for example:

But none of these solutions work for me. It always failed at the same points:

"Filtering content:  48% (440/902), 2.11 GiB | 6.70 MiB/s",
"fatal: Out of memory, realloc failed",
"Error downloading object: xxxxxxx: Smudge error: Error reading from media file: write /dev/stdout: The pipe is being closed.: write /dev/stdout: The pipe is being closed.",
"",
"Errors logged to 'xxxx.log'.",
"Use `git lfs logs last` to view the log.",
"warning: Clone succeeded, but checkout failed.",
"You can inspect what was checked out with 'git status'",
"and retry with 'git restore --source=HEAD :/'"

The weird things is that this error only happen using Ansible. If I connect to the VM and manually run exactly the same git clone command, everything goes well.

Do you have any idea to help me? Thanks

0 Answers
Related