Ruben Laguna's blog

Mar 29, 2007 - 2 minute read - broken cvs error linux loginfo pipe troubleshoot viewvc

cvs [xxxxx]: received broken pipe signal

Today I received this error message when issuing a cvs import to the cvs repository

cvs [import failed]: received broken pipe signal

after googling a little bit I found this mail thread that led me to the following entry in the cvs manual about loginfo:

Note that the filter program must read all of the log information or CVS may fail with a broken pipe signal.

so I took a look to the CVSROOT/loginfo and the line there was

ALL /usr/local/viewvc-1.0.0/bin/loginfo-handler %{sVv}

so I figured out that loginfo-handler from viewvc must be causing the problem. I went to the viewvc repository and find out the following comment on Revision 1518 of loginfo-handler:

  • bin/loginfo-handler Add some more debugging, and consume stdin so CVS’s pipe doesn’t back up (which causes an abort()).

I downloaded the latest version of loginfo-handler and tried to use it instead of the old one but I doesn’t work. You must upgrade to latest version of viewvc. So I tried another solution I modified a little bit the 1.0.0 loginfo-handler

***** loginfo-handler 2007-03-29 18:26:18.000000000 +0200
--- loginfo-handler-patched 2007-03-29 18:25:49.000000000 +0200

*** 266,271**
--- 266,274 ----
if len(sys.argv) > 3:
error('Bad arguments')

+ debug('Discarded from stdin:')
+ debug(map(lambda x: ' ' + x, sys.stdin.readlines())) # consume stdin
repository = cvsdb.CleanRepository(repository)
directory, files = fun(arg, repository)

and now it seems to work.

UPDATE:: There is another way (easier) to solve this problem without editing loginfo-handler just change the line

ALL /usr/local/viewvc-1.0.0/bin/loginfo-handler %{sVv}

in your /CVSROOT/loginfo file with

ALL (/usr/local/viewvc-1.0.0/bin/loginfo-handler %{sVv};cat) >/dev/null

this also consumes all stdin data upon completion avoiding the received broken pipe signal.