Skip to content
Latchkey

TeamCity build failed by "an error message is logged" failure condition in CI

A build failure condition matched text in the log and failed the build. This is intentional: TeamCity can fail a build "if an error message is logged by build runner" or if a specified text appears, independent of exit codes.

What this error means

The build is marked failed with "Failure condition: an error message is logged by build runner" or "the specified text ... is found in the build log", even though every step exited zero.

TeamCity
Build failed. Failure condition:
an error message is logged by build runner (see build log for details)

Common causes

A tool logged an error line that matches the condition

A step wrote an "error"-level message (or text matched by a substring/regex failure condition), which the failure condition treats as a build failure.

An overly broad text-match failure condition

A condition matching a common word flags benign log lines as errors, failing builds that actually succeeded.

How to fix it

Find the matched line and decide intent

  1. Open the build log and search for the error message the condition matched.
  2. If it is a real failure, fix the underlying tool error.
  3. If it is benign, narrow or remove the failure condition so it stops matching it.

Tune the failure condition

In Build Configuration, Failure Conditions, adjust the pattern to match only genuine errors, or disable "fail on error message" if step exit codes already gate failure.

How to prevent it

  • Scope text-match failure conditions to specific, real error patterns.
  • Prefer exit-code-based failure over broad log matching where possible.
  • Review failure conditions when they flag known-good builds.

Frequently asked questions

What causes ""an error message is logged by build runner""?
A step wrote an "error"-level message (or text matched by a substring/regex failure condition), which the failure condition treats as a build failure.
How do I fix "an error message is logged by build runner"?
Find the matched line and decide intent

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card