Skip to content

Commit f531cc1

Browse files
committed
Document the repository lookup failures and the full-scan read
Troubleshooting now shows the two messages a missing repository scope produces in 2.13.0, which scope each one points at, and that both follow the exit-code flags. It also says full-scans:list covers the full-scan read that --strict-blocking, --enable-gitlab-security and --legal-format fossa use for alerts on unchanged packages.
1 parent d44febf commit f531cc1

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

‎docs/troubleshooting.md‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,22 @@
1212
See [Exit codes in CI](ci-cd.md#exit-codes-in-ci) for the flag combinations and
1313
[upgrade guidance](../README.md#upgrading-to-2130) for older pipeline rules.
1414

15+
## Repository lookup or creation fails
16+
17+
A run that compares scans looks up the repository first, unless `--base-scan-id` or
18+
`--base-commit-sha` is set. A token missing a repository scope stops there with the
19+
infrastructure-error code (`3` by default):
20+
21+
| Log message | Missing scope |
22+
|-------------|---------------|
23+
| `Failed to get repository <repo> (HTTP 403). The API token may be missing the repo:list scope.` | `repo:list` |
24+
| `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 |
25+
26+
Both failures follow `--disable-blocking` and `--exit-code-on-api-error`. Before
27+
2.13.0, any failed lookup was treated as a missing repository, so a token without
28+
`repo:list` ended in the `repo:create` message, and the run exited `2` whatever
29+
either flag said.
30+
1531
## API token scopes for scan comparisons
1632

1733
PR/MR runs compare the new scan against the repository's head scan. That comparison
@@ -22,6 +38,10 @@ scopes in addition to whatever the scan itself needs:
2238
- `diff-scans:list`
2339
- `full-scans:list`
2440

41+
`full-scans:list` also covers the read of the new full scan that `--strict-blocking`,
42+
`--enable-gitlab-security` and `--legal-format fossa` use to get alerts on unchanged
43+
packages.
44+
2545
If the token is missing them the scan still succeeds, so this is easy to miss. The only
2646
signal is a warning, after which the CLI falls back to the older streaming comparison:
2747

0 commit comments

Comments
 (0)