Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error obtaining VCS status: exit status 128 #1247

Closed
vbaranov opened this issue Aug 8, 2023 · 3 comments
Closed

error obtaining VCS status: exit status 128 #1247

vbaranov opened this issue Aug 8, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@vbaranov
Copy link

vbaranov commented Aug 8, 2023

Describe the bug

This error message appeared when trying to use gitleaks on pre-commit and gitleaks failed to scan the commit

### version information

pre-commit version: 3.3.3
git --version: git version 2.38.1
sys.version:
    3.11.4 (main, Jul 25 2023, 17:07:07) [Clang 14.0.3 (clang-1403.0.22.14.1)]
sys.executable: /usr/local/Cellar/pre-commit/3.3.3/libexec/bin/python3.11
os.name: posix
sys.platform: darwin

### error information

An unexpected error has occurred: CalledProcessError: command: ('/usr/local/go/bin/go', 'install', './...')
return code: 1
stdout: (none)
stderr:
    go: downloading github.com/gitleaks/go-gitdiff v0.8.0
    go: downloading github.com/rs/zerolog v1.26.1
    go: downloading github.com/spf13/viper v1.8.1
    go: downloading github.com/lucasjones/reggen v0.0.0-20200904144131-37ba4fa293bb
    go: downloading github.com/spf13/cobra v1.2.1
    go: downloading github.com/charmbracelet/lipgloss v0.5.0
    go: downloading github.com/fatih/semgroup v1.2.0
    go: downloading github.com/h2non/filetype v1.1.3
    go: downloading github.com/petar-dambovaliev/aho-corasick v0.0.0-20211021192214-5ab2d9280aa9
    go: downloading golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
    go: downloading github.com/lucasb-eyer/go-colorful v1.2.0
    go: downloading github.com/mattn/go-runewidth v0.0.13
    go: downloading github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68
    go: downloading github.com/muesli/termenv v0.11.1-0.20220204035834-5ac8409525e0
    go: downloading github.com/spf13/pflag v1.0.5
    go: downloading github.com/fsnotify/fsnotify v1.4.9
    go: downloading github.com/hashicorp/hcl v1.0.0
    go: downloading github.com/magiconair/properties v1.8.5
    go: downloading github.com/mitchellh/mapstructure v1.4.1
    go: downloading github.com/pelletier/go-toml v1.9.3
    go: downloading github.com/spf13/afero v1.6.0
    go: downloading github.com/spf13/cast v1.3.1
    go: downloading github.com/spf13/jwalterweatherman v1.1.0
    go: downloading github.com/subosito/gotenv v1.2.0
    go: downloading gopkg.in/ini.v1 v1.62.0
    go: downloading gopkg.in/yaml.v2 v2.4.0
    go: downloading github.com/rivo/uniseg v0.2.0
    go: downloading golang.org/x/sys v0.0.0-20211110154304-99a53858aa08
    go: downloading golang.org/x/text v0.3.6
    go: downloading github.com/mattn/go-isatty v0.0.14
    error obtaining VCS status: exit status 128
    	Use -buildvcs=false to disable VCS stamping.
    error obtaining VCS status: exit status 128
    	Use -buildvcs=false to disable VCS stamping.
Traceback (most recent call last):
  File "/usr/local/Cellar/pre-commit/3.3.3/libexec/lib/python3.11/site-packages/pre_commit/error_handler.py", line 73, in error_handler
    yield
  File "/usr/local/Cellar/pre-commit/3.3.3/libexec/lib/python3.11/site-packages/pre_commit/main.py", line 386, in main
    return hook_impl(
           ^^^^^^^^^^
  File "/usr/local/Cellar/pre-commit/3.3.3/libexec/lib/python3.11/site-packages/pre_commit/commands/hook_impl.py", line 271, in hook_impl
    return retv | run(config, store, ns)
                  ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/pre-commit/3.3.3/libexec/lib/python3.11/site-packages/pre_commit/commands/run.py", line 442, in run
    install_hook_envs(to_install, store)
  File "/usr/local/Cellar/pre-commit/3.3.3/libexec/lib/python3.11/site-packages/pre_commit/repository.py", line 248, in install_hook_envs
    _hook_install(hook)
  File "/usr/local/Cellar/pre-commit/3.3.3/libexec/lib/python3.11/site-packages/pre_commit/repository.py", line 95, in _hook_install
    lang.install_environment(
  File "/usr/local/Cellar/pre-commit/3.3.3/libexec/lib/python3.11/site-packages/pre_commit/languages/golang.py", line 152, in install_environment
    lang_base.setup_cmd(prefix, ('go', 'install', './...'), env=env)
  File "/usr/local/Cellar/pre-commit/3.3.3/libexec/lib/python3.11/site-packages/pre_commit/lang_base.py", line 86, in setup_cmd
    cmd_output_b(*cmd, cwd=prefix.prefix_dir, **kwargs)
  File "/usr/local/Cellar/pre-commit/3.3.3/libexec/lib/python3.11/site-packages/pre_commit/util.py", line 110, in cmd_output_b
    raise CalledProcessError(returncode, cmd, stdout_b, stderr_b)
pre_commit.util.CalledProcessError: command: ('/usr/local/go/bin/go', 'install', './...')
return code: 1
stdout: (none)
stderr:
    go: downloading github.com/gitleaks/go-gitdiff v0.8.0
    go: downloading github.com/rs/zerolog v1.26.1
    go: downloading github.com/spf13/viper v1.8.1
    go: downloading github.com/lucasjones/reggen v0.0.0-20200904144131-37ba4fa293bb
    go: downloading github.com/spf13/cobra v1.2.1
    go: downloading github.com/charmbracelet/lipgloss v0.5.0
    go: downloading github.com/fatih/semgroup v1.2.0
    go: downloading github.com/h2non/filetype v1.1.3
    go: downloading github.com/petar-dambovaliev/aho-corasick v0.0.0-20211021192214-5ab2d9280aa9
    go: downloading golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
    go: downloading github.com/lucasb-eyer/go-colorful v1.2.0
    go: downloading github.com/mattn/go-runewidth v0.0.13
    go: downloading github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68
    go: downloading github.com/muesli/termenv v0.11.1-0.20220204035834-5ac8409525e0
    go: downloading github.com/spf13/pflag v1.0.5
    go: downloading github.com/fsnotify/fsnotify v1.4.9
    go: downloading github.com/hashicorp/hcl v1.0.0
    go: downloading github.com/magiconair/properties v1.8.5
    go: downloading github.com/mitchellh/mapstructure v1.4.1
    go: downloading github.com/pelletier/go-toml v1.9.3
    go: downloading github.com/spf13/afero v1.6.0
    go: downloading github.com/spf13/cast v1.3.1
    go: downloading github.com/spf13/jwalterweatherman v1.1.0
    go: downloading github.com/subosito/gotenv v1.2.0
    go: downloading gopkg.in/ini.v1 v1.62.0
    go: downloading gopkg.in/yaml.v2 v2.4.0
    go: downloading github.com/rivo/uniseg v0.2.0
    go: downloading golang.org/x/sys v0.0.0-20211110154304-99a53858aa08
    go: downloading golang.org/x/text v0.3.6
    go: downloading github.com/mattn/go-isatty v0.0.14
    error obtaining VCS status: exit status 128
    	Use -buildvcs=false to disable VCS stamping.
    error obtaining VCS status: exit status 128
    	Use -buildvcs=false to disable VCS stamping.

To Reproduce
Steps to reproduce the behavior: https://github.com/gitleaks/gitleaks#pre-commit

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Basic Info (please complete the following information):

  • OS: Mac OS 13.5 (22G74)
  • Gitleaks Version: v1.17

Additional context
Add any other context about the problem here.

cc @zricethezav

@vbaranov vbaranov added the bug Something isn't working label Aug 8, 2023
@GarbageYard
Copy link

Same issue here.

OS: Linux fedora 6.4.6-100.fc37.x86_64
GitLeaks: v8.16.1

@GarbageYard
Copy link

Running pre-commit install-hooks worked for me.

pre-commit/pre-commit#2722 (comment)

@vbaranov
Copy link
Author

Running pre-commit install-hooks worked for me.

pre-commit/pre-commit#2722 (comment)

That worked, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants