Skip to content

Crash in common_decorators.py #1086

@Jiri-Stary

Description

@Jiri-Stary

Environment

  • ggshield version: 1.38.1
  • Operating system (Linux, macOS, Windows):
  • Operating system version: linux
  • Python version:

Describe the bug

ggshield crashed with the follwowing error

Steps to reproduce:

  1. checkout github repository
  2. run ggshield secret scan path --output gitguardian_scan.txt --exclude **/.git/** --exclude **/.goldenfrog/** --recursive --yes --all-secrets --verbose .

Actual result:

Starting scan

Skipped .goldenfrog/.github/actions/aggregate-report/sample_openscap.sarif: content is over 1,048,576 bytes
Skipped .goldenfrog/.github/actions/aggregate-report/sample_grype.sarif: content is over 1,048,576 bytes
Skipped .goldenfrog/.github/actions/aggregate-report/sample_trivy.sarif: content is over 1,048,576 bytes
Error:

Traceback (most recent call last):
File "/opt/pipx/venvs/ggshield/lib/python3.12/site-packages/ggshield/cmd/utils/common_decorators.py", line 17, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/opt/pipx/venvs/ggshield/lib/python3.12/site-packages/ggshield/cmd/secret/scan/path.py", line 93, in path_cmd
return output_handler.process_scan(scan)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/pipx/venvs/ggshield/lib/python3.12/site-packages/ggshield/verticals/secret/output/secret_output_handler.py", line 39, in process_scan
text = self._process_scan_impl(scan)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/pipx/venvs/ggshield/lib/python3.12/site-packages/ggshield/verticals/secret/output/secret_text_output_handler.py", line 63, in _process_scan_impl
processed_scan_results = self.process_scan_results(scan)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/pipx/venvs/ggshield/lib/python3.12/site-packages/ggshield/verticals/secret/output/secret_text_output_handler.py", line 96, in process_scan_results
current_result_buf.write(self.process_result(result))
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/pipx/venvs/ggshield/lib/python3.12/site-packages/ggshield/verticals/secret/output/secret_text_output_handler.py", line 126, in process_result
result.censor()
File "/opt/pipx/venvs/ggshield/lib/python3.12/site-packages/ggshield/verticals/secret/secret_scan_collection.py", line 147, in censor
cast(ExtendedMatch, extended_match).censor()
File "/opt/pipx/venvs/ggshield/lib/python3.12/site-packages/ggshield/verticals/secret/extended_match.py", line 114, in censor
assert len(self.match) == len_match
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
Error: Process completed with exit code 128.

Expected result:

If applicable, add logs or screenshots to help explain your problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:newThis issue needs to be reviewedtype:bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions