Psalm "ERROR: ... N errors found" in CI
Psalm analyzed the codebase against its configured errorLevel and found issues it reports as errors, so it exits non-zero. Each issue names a type (PossiblyNullReference, InvalidArgument) with the file and line.
What this error means
The Psalm step ends with issue blocks and "ERROR: ... ------------------ N errors found", failing CI. The errorLevel in psalm.xml controls how strict the check is.
ERROR: PossiblyNullReference - src/Report.php:48:16 - Cannot call method format
on possibly null value
------------------------------
3 errors found
------------------------------Common causes
Type issues reported at the configured errorLevel
Psalm flags possibly-null references, invalid arguments, or undefined methods at the errorLevel set in psalm.xml.
A stricter level or new code surfaced issues
Lowering errorLevel (stricter) or adding code introduces findings Psalm now reports as errors.
How to fix it
Resolve the reported issues
- Read each issue type, file, and line Psalm prints.
- Add the missing null guard or correct the argument type.
- Re-run
psalmuntil no errors are reported.
vendor/bin/psalm --no-progressBaseline existing issues
Record current issues in a baseline so only new ones fail the build during incremental adoption.
vendor/bin/psalm --set-baseline=psalm-baseline.xmlHow to prevent it
- Tighten Psalm
errorLevelgradually with a baseline. - Fix new findings before they accumulate.
- Run Psalm locally before pushing to catch issues early.