palantir / stash-codesearch-plugin

Provides global repository, commit, and file content search for Atlassian Stash instances
Apache License 2.0
62 stars 20 forks source link

Indexing fails with "Error feeding input into cat-file" #12

Closed jeffggardner closed 9 years ago

jeffggardner commented 9 years ago

Compiled the source using java 1.7 and running in Stash 3.7.1.

Any attempt to index results in the following: 08:29:28.423 [io-pump:thread-1818] ERROR c.p.s.c.updater.CatFileInputHandler - Error feeding input into cat-file, aborting java.io.IOException: Broken pipe at java.io.FileOutputStream.writeBytes(Native Method) ~[na:1.7.0_45] at java.io.FileOutputStream.write(FileOutputStream.java:345) ~[na:1.7.0_45] at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82) ~[na:1.7.0_45] at java.io.BufferedOutputStream.write(BufferedOutputStream.java:126) ~[na:1.7.0_45] at java.io.FilterOutputStream.write(FilterOutputStream.java:97) ~[na:1.7.0_45] at com.palantir.stash.codesearch.updater.CatFileInputHandler.process(CatFileInputHandler.java:49) ~[na:na] at com.atlassian.stash.scm.SummarizingProcessHandler$DelegatingOutputStreamHandler.process(SummarizingProcessHandler.java:222) [stash-spi-3.7.1.jar:na] at com.atlassian.stash.scm.SummarizingProcessHandler.provideInput(SummarizingProcessHandler.java:100) [stash-spi-3.7.1.jar:na] at com.atlassian.utils.process.ExternalProcessImpl$InputHandlerRunnable.process(ExternalProcessImpl.java:749) [atlassian-processutils-1.6.0-m2.jar:na] at com.atlassian.utils.process.ExternalProcessImpl$AbstractHandlerRunnable.doTask(ExternalProcessImpl.java:677) [atlassian-processutils-1.6.0-m2.jar:na] at com.atlassian.utils.process.LatchedRunnable.run(LatchedRunnable.java:158) [atlassian-processutils-1.6.0-m2.jar:na] at com.atlassian.stash.internal.concurrent.StateTransferringExecutor$StateTransferringRunnable.run(StateTransferringExecutor.java:71) [stash-platform-3.7.1.jar:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_45] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_45] at java.lang.Thread.run(Thread.java:744) [na:1.7.0_45]

lawnchamp commented 9 years ago

What Version of git are you using? It wasn't working for me while I was using git 1.8.0 because there is a git command used in SearchUpdateJobImpl.java that is "git cat-file --batch=" but in git 1.8.0 that command doesn't exist. In 1.8.0 it was "git cat-file --batch" (no equals sign). Once I updated the version of git I was using it fixed the problem.

jeffggardner commented 9 years ago

We are using 1.8.2. I modified the SearchUpdateJobImpl.java code and replaced the "=" with a " " and rebuilt the jar. That solved my issues. Thanks!

brentm5 commented 9 years ago

To build on what @rjshenk we upgraded to git 2.4.5 from 1.8.?? and that solved the problem

terabyte commented 8 years ago

Yes, I believe the plugin requires git 1.9+ or something int hat range, I forget the exact revision when this changed. The alternative is to build a custom version and change the code to match your git version (but everyone really ought to be on git 2.X+ anyways because there are a few nasty security problems in older gits).