Error output doesn't display file name and line number everywhere
Author: arnaldopCreated Aug 27, 2026Updated Sep 1, 2026
Labelsbugfixed
Description
This seems to be a regression from V1, because I used to get the information I needed in all 3 places. In the error output below (run with mvn test), I only get the file name and line number in the top logs, not the subsequent 2.
Steps to Reproduce
Run feature with error. The actual line is not represented in all reports.
karate-config.js
...
var consoleOutput = System.getProperty('consoleOutput') === 'true'
karate.configure('logging', {
console: consoleOutput ? 'debug' : 'info',
report: 'debug',
pretty: true
})
...In this case, consoleOutput = false.
Expected Behavior
See the actual file and line number in each of the reported error blocks.
Actual Behavior
The file name and line number only appear once.
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.myproject.StandaloneKarateTest
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::allocateMemory has been called by io.netty.util.internal.PlatformDependent0$2 (file:/Users/myrootdir/.m2/repository/io/netty/netty-common/4.1.132.Final/netty-common-4.1.132.Final.jar)
WARNING: Please consider reporting this to the maintainers of class io.netty.util.internal.PlatformDependent0$2
WARNING: sun.misc.Unsafe::allocateMemory will be removed in a future release
---------------------------------------------------------
feature: com/myproject/bulk/bulk-client-change.feature
scenarios: 12 | passed: 11 | 1 failed | time: 6.2060
=========================================================
failed features:
/Users/myrootdir/dev/myproject/work/2571-karate-v2-fresh/backend/target/test-classes/com/myproject/bulk/bulk-client-change.feature
- 25 rows to group
/Users/myrootdir/dev/myproject/work/2571-karate-v2-fresh/backend/target/test-classes/com/myproject/bulk/bulk-client-change.feature:350
And match each response.content[*].individualId !contains individualIds
match failed: EACH_NOT_CONTAINS
$ | match each failed at indices [0, 1, 2, 3, 4] (stopped after 5 failures) (LIST:LIST)
[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null]
["35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35"]
$[4] | data types don't match (NULL:LIST)
null
["35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35"]
$[3] | data types don't match (NULL:LIST)
null
["35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35"]
$[2] | data types don't match (NULL:LIST)
null
["35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35"]
$[1] | data types don't match (NULL:LIST)
null
["35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35"]
$[0] | data types don't match (NULL:LIST)
null
["35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35"]
============================================================
elapsed: 6.44s | threads: 15 | efficiency: 0.06
features: 1 | passed: 0 | 1 failed
scenarios: 12 | passed: 11 | 1 failed
------------------------------------------------------------
Karate 2.1.2 | HTML report:
file:///Users/myrootdir/dev/myproject/work/2571-karate-v2-fresh/backend/target/karate-reports/karate-summary.html
==========================================================================================================================
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 46.98 s <<< FAILURE! -- in com.myproject.StandaloneKarateTest
[ERROR] com.myproject.StandaloneKarateTest.runKarateTests -- Time elapsed: 6.659 s <<< FAILURE!
org.opentest4j.AssertionFailedError:
[match failed: EACH_NOT_CONTAINS
$ | match each failed at indices [0, 1, 2, 3, 4] (stopped after 5 failures) (LIST:LIST)
[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null]
["35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35"]
$[4] | data types don't match (NULL:LIST)
null
["35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35"]
$[3] | data types don't match (NULL:LIST)
null
["35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35"]
$[2] | data types don't match (NULL:LIST)
null
["35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35"]
$[1] | data types don't match (NULL:LIST)
null
["35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35"]
$[0] | data types don't match (NULL:LIST)
null
["35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35"]
]
expected: 0
but was: 1
at com.myproject.StandaloneKarateTest.runKarateTests(StandaloneKarateTest.java:82)
at java.base/java.lang.reflect.Method.invoke(Method.java:565)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] StandaloneKarateTest.runKarateTests:82 [match failed: EACH_NOT_CONTAINS
$ | match each failed at indices [0, 1, 2, 3, 4] (stopped after 5 failures) (LIST:LIST)
[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null]
["35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35"]
$[4] | data types don't match (NULL:LIST)
null
["35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35"]
$[3] | data types don't match (NULL:LIST)
null
["35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35"]
$[2] | data types don't match (NULL:LIST)
null
["35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35"]
$[1] | data types don't match (NULL:LIST)
null
["35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35"]
$[0] | data types don't match (NULL:LIST)
null
["35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35","35"]
]
expected: 0
but was: 1
[INFO]
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 54.256 s
[INFO] Finished at: 2026-08-27T15:54:15-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.5:test (default-test) on project myproject-backend: There are test failures.
[ERROR]
[ERROR] See /Users/myrootdir/dev/myproject/work/2571-karate-v2-fresh/backend/target/surefire-reports for the individual test results.
[ERROR] See dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Karate Version
2.1.2
Java Version
25.0.1
Operating System
macOS
Source: karatelabs/karate