Skip to content

fails to git-clone Yelp/kafka-utils with exit code 128 #67

@calvinli

Description

@calvinli

We encountered the following traceback using this to scan https://github.com/Yelp/kafka-utils:

  File "/code/virtualenv_run/lib/python3.6/site-packages/detect_secrets_server/__main__.py", line 30, in main
    actions.add_repo(args)
  File "/code/virtualenv_run/lib/python3.6/site-packages/detect_secrets_server/actions/initialize.py", line 25, in add_repo
    _clone_and_save_repo(repo)
  File "/code/virtualenv_run/lib/python3.6/site-packages/detect_secrets_server/actions/initialize.py", line 125, in _clone_and_save_repo
    repo.storage.clone()
  File "/code/virtualenv_run/lib/python3.6/site-packages/detect_secrets_server/storage/base.py", line 80, in clone
    self._repo_location,
  File "/code/virtualenv_run/lib/python3.6/site-packages/detect_secrets_server/storage/core/git.py", line 47, in clone_repo_to_location
    ], stderr=subprocess.STDOUT)
  File "/usr/lib/python3.6/subprocess.py", line 336, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['git', 'clone', 'https://github.com/Yelp/kafka-utils', '[...truncated...]', '--bare']' returned non-zero exit status 128.

Manual testing showed that the error message from git is:

Cloning into bare repository '[...truncated...]'...
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly

The issue can be reproduced by running git clone https://github.com/Yelp/kafka-utils some_test_dir/ --bare >./test_stdout 2>&1 (simulating what subprocess.check_output is doing).

We also found that adding --progress makes it work, for unclear reasons:

$ git clone https://github.com/Yelp/kafka-utils some_test_dir/ --bare --progress >./test_stdout 2>&1
$ echo $?
0

Reproduced on git versions 2.16.2, 2.22.0, 2.25.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions