JUnit Parser - Too many levels of symbolic links
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Symptoms
JUnit task fails with the following error in Bamboo 4.4.5 and even version 5.1.0 with the following error message:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
simple 10-Sep-2013 15:54:29 Starting task 'Parse test output' of type 'com.atlassian.bamboo.plugins.testresultparser:task.testresultparser.junit'
simple 10-Sep-2013 15:54:29 Parsing test results...
error 10-Sep-2013 15:55:55 Error occurred while running Task 'Parse test' of type com.atlassian.bamboo.plugins.testresultparser:task.testresultparser.junit.
error 10-Sep-2013 15:55:55 com.atlassian.bamboo.task.TaskException: Failed to execute task
error 10-Sep-2013 15:55:55 at com.atlassian.bamboo.plugins.testresultparser.task.JUnitResultParserTask.execute(JUnitResultParserTask.java:56)
error 10-Sep-2013 15:55:55 at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:216)
error 10-Sep-2013 15:55:55 at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:98)
...
error 10-Sep-2013 15:55:55 Caused by: Caught error while checking for symbolic links
error 10-Sep-2013 15:55:55 at org.apache.tools.ant.DirectoryScanner.causesIllegalSymlinkLoop(DirectoryScanner.java:1887)
error 10-Sep-2013 15:55:55 at org.apache.tools.ant.DirectoryScanner.scandir(DirectoryScanner.java:1267)
...
error 10-Sep-2013 15:55:55 Caused by: java.io.IOException: Too many levels of symbolic links
error 10-Sep-2013 15:55:55 at java.io.UnixFileSystem.canonicalize0(Native Method)
error 10-Sep-2013 15:55:55 at java.io.UnixFileSystem.canonicalize(UnixFileSystem.java:172)
error 10-Sep-2013 15:55:55 at java.io.File.getCanonicalPath(File.java:576)
error 10-Sep-2013 15:55:55 at org.apache.tools.ant.util.SymbolicLinkUtils.isSymbolicLink(SymbolicLinkUtils.java:106)
error 10-Sep-2013 15:55:55 at org.apache.tools.ant.DirectoryScanner.causesIllegalSymlinkLoop(DirectoryScanner.java:1858)
...
Cause
When configuring the JUnit Parser task, wildcards(**) are used to specify the directory of test results, and this picks up some symlinks.
Solution
Resolution
Instead of specifying something like **/test-reports/*.xml, try to use test-results/*.xml in the JUnit Parser task configuration page, and store all your test results in the test-results directory under the current working directory of the plan (which contains the JUnit task).
Also, you might need to enable the "Pick up test results that were created outside of this build" option under the Advanced Options of the JUnit task configuration page (available since Bamboo version 5.0.1).
Was this helpful?