Skip to content

Invalid symlink causes error in the scan #1144

@Jiri-Stary

Description

@Jiri-Stary

Environment

  • ggshield version: 1.43.0
  • Operating system (Linux, macOS, Windows): linux
  • Operating system version: github-action
  • Python version:

Describe the bug

Broken symlink stops the scan

Steps to reproduce:

  1. create broken symlink e.g. .direnv/python-3.12.3/lib64
  2. Run command ggshield secret scan path --exclude '.git/**/*' --exclude '.goldenfrog/**/*' --exclude '**/*.sarif' --recursive --yes --output gitguardian_scan.txt .

Actual result:

  • ggshield secret scan path --exclude '.git//*' --exclude '.goldenfrog//' --exclude '**/.sarif' --recursive --yes --output gitguardian_scan.txt .
    Skipped .direnv/python-3.12.3/bin/python3: content is over 1,048,576 bytes
    Skipped apps/copilot/python/frontend/src/assets/Fonts/McKinseySans-Italic.otf: can't detect encoding
    Skipped apps/copilot/go_lang/frontend/src/assets/Fonts/McKinseySans-Italic.otf: can't detect encoding
    Skipped apps/copilot/go_lang/frontend/src/assets/Fonts/McKinseySans-MediumItalic.otf: can't detect encoding
    Skipped apps/copilot/python/frontend/src/assets/Fonts/McKinseySans-Medium.otf: can't detect encoding
    Skipped apps/copilot/python/frontend/src/assets/Fonts/McKinseySans-MediumItalic.otf: can't detect encoding
    Skipped apps/copilot/go_lang/frontend/src/assets/Fonts/McKinseySans-Light.otf: can't detect encoding
    Skipped .direnv/python-3.12.3/bin/python3.12: content is over 1,048,576 bytes
    Error: [Errno 2] No such file or directory: '.direnv/python-3.12.3/lib64'

Re-run the command with --verbose to get a stack trace.

Warning: A new version of ggshield (v1.44.1) has been released (https://github.com/GitGuardian/ggshield).

Expected result:

ignore the broken symlink, scan the rest

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