Docs › Troubleshooting

Troubleshooting

Start with mrsentry doctor. It checks configuration, tools, GitLab access and token scopes, the LLM, and AWS/ECR in one pass.

mrsentry doctor

mrsentry doctor            # everything
mrsentry doctor --offline  # config + local tools only
mrsentry doctor --no-llm   # skip the test prompt

✔ means the check passed, ✘ means a required check failed, and ! marks an optional item that's missing, such as a toolchain you don't use.

Exit codes

CodeMeaningWhat to do
0OKNothing.
1A finding or vulnerability is at or above --fail-on / output.fail_onIntended when you gate merges.
2The MR head moved during the runRe-run on the new head. The next pipeline does this automatically.
3Git or GitLab errorCheck reachability, the project path and the clone logs.
4Configuration errormrsentry config validate.
5Authentication or permission errorCheck token scopes and role. See below.
6LLM error: every profile and fallback failedCheck keys, model name and quota. mrsentry doctor.
7ECR findings stale and ecr.on_stale=failRescan, or switch to local.
8The fix couldn't be appliedSee mrsentry-report.json → fix.

Outputs

Everything goes to mrsentry-out/ (output.dir). Choose formats with output.formats.

FileContents
mrsentry-report.jsonFindings, dropped candidates with reasons, scan, dependency mapping, fix result, LLM usage.
mrsentry-overview.mdThe overview note as Markdown.
gl-code-quality-report.jsonGitLab Code Quality report, shown in the MR widget.
mrsentry.sarifSARIF 2.1.0 (add sarif to output.formats).
mrsentry.envdotenv: MRSENTRY_REVIEW_FINDINGS, MRSENTRY_REVIEW_MAX_SEVERITY, MRSENTRY_HEAD_IS_BOT_FIX, MRSENTRY_FIXABLE, MRSENTRY_FIXABLE_COUNT, MRSENTRY_SCAN_STALE, MRSENTRY_SCAN_TYPE, MRSENTRY_SCAN_FREQUENCY, MRSENTRY_IMAGE_DIGEST, MRSENTRY_FIX_DELIVERED and more.
fix-pipeline.ymlThe generated child pipeline (run mr).
llm-transcripts/Every prompt and response, when output.save_llm_transcripts is on.

Common problems

401 / 403 from GitLab

The token is missing the api scope, has a role below Developer, or is CI_JOB_TOKEN, which can't post notes. mrsentry doctor prints the token's identity, scopes and access level for the project.

"GitLab token is not configured"

Set GITLAB_TOKEN or MRSENTRY_GITLAB_TOKEN. If your CI uses its own variable name, set MRSENTRY_GITLAB__TOKEN_ENV to that name.

Comments land in the overview instead of inline

GitLab rejected the line position, for example because the line is outside the diff. mrsentry falls back to a file-level comment, then to the overview. The reason is in mrsentry-report.json.

"draft notes unavailable"

Older GitLab versions don't support draft notes. mrsentry posts the discussions directly instead, with no action needed.

Someone pushed while the review ran. mrsentry never posts on stale lines. The pipeline for the new commit reviews it.

"maven dependency tree unavailable"

Maven or Gradle isn't installed in the job image. Use the full image. For private repositories, provide settings.xml / init.gradle and list the credential variables in fix.build_env_passthrough.

npm E401 while regenerating lockfiles

The runner's .npmrc refers to a token that isn't available. Pass NPM_TOKEN through fix.build_env_passthrough, or point npm_config_registry at your mirror.

Stale ECR data on scan-on-push repositories

This is expected: on-push scans are only as fresh as the last push. Use ecr.on_stale: local with the full image (Trivy included), or ask the registry owner to enable enhanced continuous scanning.

"No module named 'mcp'"

Some LiteLLM releases import an optional package for every call that uses tools. mrsentry detects this and retries without that code path, so upgrade mrsentry if you see it.

Install fails building tiktoken or hf-xet on Amazon Linux 2

Upgrade to the current installer. It detects glibc older than 2.28 and installs only prebuilt binaries.