GitHub user Ethanlm opened a pull request:
https://github.com/apache/storm/pull/2432
[STORM-2829] fix logviewer deepSearch direct self-reference leading to
cycle exception
https://issues.apache.org/jira/browse/STORM-2829
```
2017-11-21 21:06:19.369 o.e.j.s.HttpChannel qtp1471948789-17 [WARN]
/api/v1/deepSearch/wc-1-1511188542
javax.servlet.ServletException: java.lang.RuntimeException:
com.fasterxml.jackson.databind.JsonMappingException: Direct self-reference
leading to cycle (through reference chain:
org.apache.storm.daemon.logviewer.handler.Matched["matches"]->java.util.ArrayList[0]->java.util.HashMap["port"]->sun.nio.fs.UnixPath["fileSystem"]->sun.nio.fs.LinuxFileSystem["rootDirectories"]->sun.nio.fs.UnixPath["root"])
```
We are having the above exception because
`truncatePathToLastElements(firstLogAbsPath, 2).getName(0)` returns a Path
object. Then `OBJECT_MAPPER.writeValueAsString()` (in `Matched`
`toJSONString()`) somehow interprets the path to
`sun.nio.fs.UnixPath["fileSystem"]` and etc... which causes the exception.
Tested it manually. With this patch, the deepSearch should works fine.

You can merge this pull request into a Git repository by running:
$ git pull https://github.com/Ethanlm/storm STORM-2829
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/storm/pull/2432.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #2432
----
commit 860fe46b96a078767f667560217a582962a3f3cd
Author: Ethan Li <[email protected]>
Date: 2017-11-21T21:42:55Z
[STORM-2829] fix logviewer deepSearch direct self-reference leading to
cycle exception
----
---