Skip to content

Latest commit

 

History

History
148 lines (104 loc) · 6.57 KB

troubleshooting.md

File metadata and controls

148 lines (104 loc) · 6.57 KB

Troubleshooting

Unexpected CI exit status

Symptom What to check
Exit 2, even with --disable-blocking Fix the flags or configuration reported in the logs. Check config-file readability, native boolean/integer values, a positive timeout and the files array. Usage errors are never suppressed.
Exit 3 with no reported findings Check tokens, scopes, baseline lookup and scan-completeness errors. This is a failed evaluation; --exit-code-on-api-error can remap its code.
Ctrl+C is treated as a configuration error Update wrapper/CI rules: Ctrl+C changed from 2 to 130 in 2.13.0.
Exit 0 despite expected blockers Check --disable-blocking, remapping to 0, and whether the run produced a full scan instead of a diff. Full scans do not gate on findings.

See Exit codes in CI for the flag combinations and upgrade guidance for older pipeline rules.

Repository lookup or creation fails

A run that compares scans looks up the repository first, unless --base-scan-id or --base-commit-sha is set. A token missing a repository scope stops there with the infrastructure-error code (3 by default):

Log message Missing scope
Failed to get repository <repo> (HTTP 403). The API token may be missing the repo:list scope. repo:list
API failure while creating repository <repo> (HTTP 403): ..., then A 403 here usually means the API token is missing the repo:create scope. repo:create. Only needed when the repository does not exist yet

Both failures follow --disable-blocking and --exit-code-on-api-error. Before 2.13.0, any failed lookup was treated as a missing repository, so a token without repo:list ended in the repo:create message, and the run exited 2 whatever either flag said.

API token scopes for scan comparisons

PR/MR runs compare the new scan against the repository's head scan. That comparison first uses the diff-scans endpoints, which require an organization token with these scopes in addition to whatever the scan itself needs:

  • diff-scans:create
  • diff-scans:list
  • full-scans:list

full-scans:list also covers the read of the new full scan that --strict-blocking, --enable-gitlab-security and --legal-format fossa use to get alerts on unchanged packages.

If the token is missing them the scan still succeeds, so this is easy to miss. The only signal is a warning, after which the CLI falls back to the older streaming comparison:

Diff scan comparison failed with APIAccessDenied(Insufficient permissions), falling back to the streaming scan comparison

Grant the scopes to use the diff-scans path. It polls with short, bounded requests rather than holding one connection open while the backend computes, which is what lets large comparisons survive network idle timeouts — notably Azure NAT gateways, which reap idle connections after four minutes and surface as an intermittent ConnectionResetError.

The two paths can take noticeably different amounts of time on the same repository, because cached diff-scan responses always embed per-package license details while the streaming comparison requests a lean payload. On a large dependency tree, compare the Diff scan comparison ready in ... timing against the Diff Report Gathered in ... total before assuming either path is at fault.

Common gotchas

  • In diff scope, --strict-blocking uses a stricter alert set (new + unchanged) for blocking checks and diff-based output selection.
  • --sarif-scope full requires --reach.
  • In --sarif-scope full with --sarif-file, SARIF JSON is written to file and stdout JSON is suppressed.
  • --sarif-grouping alert currently applies to --sarif-scope full.

Reachability on a restricted network

  • Failed to run reachability analysis: HTTPSConnectionPool(host='storage.googleapis.com', ...): the engine download is blocked. Allow storage.googleapis.com, or set HTTPS_PROXY. An npm mirror does not cover it.
  • Every vulnerability reported as INSTALL ERROR: the engine could not install your dependencies. Allow the ecosystem's package registry, or install dependencies in the target path before running --reach.
  • See Reachability network access in the CLI reference for the full list of hosts.

Dashboard vs CLI result counts

Differences in result counts can be valid, even when filtering appears similar.

Common reasons:

  • diff vs full data source:
    • --sarif-scope diff is based on diff alerts (typically net-new in the compared scan context).
    • --sarif-scope full is based on full reachability facts data.
  • Consolidation differences:
    • Dashboard and API/CLI can apply different consolidation/grouping rules.
    • --sarif-grouping alert and --sarif-grouping instance intentionally produce different row counts.
  • Policy vs dataset:
    • --strict-blocking only affects diff-scope behavior and does not make diff output equivalent to full dashboard data.
  • Reachability data availability:
    • If reachability analysis partially fails and falls back to precomputed reachability, counts can shift.

Recommended comparison path:

  1. Use full-scope SARIF for parity-oriented comparisons.
  2. Keep grouping fixed (alert for dashboard-style rollups, instance for detailed exports).
  3. Compare reachability filters with the same mode and grouping across runs.

Save submitted file list

Use --save-submitted-files-list to inspect exactly what was sent for scanning.

socketcli --save-submitted-files-list submitted_files.json

Output includes:

  • timestamp
  • total file count
  • total size
  • complete submitted file list

Save manifest archive

Use --save-manifest-tar to export discovered manifest files as .tar.gz.

socketcli --save-manifest-tar manifest_files.tar.gz

Combined example:

socketcli --save-submitted-files-list files.json --save-manifest-tar backup.tar.gz

Octopus merge note

For octopus merges (3+ parents), Git can report incomplete changed-file sets because default diff compares against the first parent.

If needed, force full scan behavior with:

  • --ignore-commit-files

GitLab report troubleshooting

If report is not visible in GitLab Security Dashboard:

  • verify dependency_scanning artifact is configured in .gitlab-ci.yml
  • verify job completed and artifact uploaded
  • verify report file schema is valid

If vulnerabilities array is empty:

  • this can be expected when no actionable security issues are present in the result scope
  • confirm expected scope/flags and compare with Socket dashboard data