Defect #6860
closedsvn: Write error: Broken pipe when browsing repository
100%
Description
I don't know how this error is getting caused, however I've been trying to track down it's origin forever. This error appears in my default error log, not in the error log for it's associated VHost for some reason. I did some testing, and after I let the activity die down to nothing for maybe 10 minutes, then I go and browse the repository and open a file in redmine, I go back to my log and I can see another "svn: Write error: Broken pipe" error. It's semi-consistent to get this error to re-occur for me.
Redmine 1.0.3
Rails 2.3.5
Ruby 1.8.7
svn 1.6.6
Files
Updated by Xiwen Cheng about 14 years ago
Sounds like SVN is being accessed over SSH? If so you'll probably see that error when you do `svn log | head`. See this thread
If above is incorrect, how is SVN set up?
Updated by Mischa The Evil about 14 years ago
svn: Write error: Broken pipe when browsing repository
might be interesting too in your situation...
Please let me know if my fix workes for you too...
Updated by Ве Fio about 14 years ago
Mischa The Evil wrote:
svn: Write error: Broken pipe when browsing repository
might be interesting too in your situation...
Please let me know if my fix workes for you too...
I came across this earlier, and didn't think it had anything to do with me. However, after looking through my repository, it indeed does look like SVN properties aren't showing up. Weird... In this case your fix should be the correct one. This didn't happen to my last installation.. Which is very odd. It looks like that fix was committed to trunk awhile ago, so then, why am I experiencing it? It appears that this could be a re-occurrence of it somehow. I'll do some more testing, with your fix and whatnot, and I'll let you know.
Xiwen Cheng wrote:
Sounds like SVN is being accessed over SSH? If so you'll probably see that error when you do `svn log | head`. See this thread
If above is incorrect, how is SVN set up?
It's being accessed via the default method, which is of course executing the binary directly with Redmine's SCM SVN adapter. No errors or problems appear on Redmine, other than this error in my log (except maybe that noted just above this)
Updated by Ве Fio about 14 years ago
Mischa The Evil,
I applied your fix and all my SVN properties are now appearing. I didn't check my error log, but as I already know that your fix fixed those broken pipe errors too, we now know the cause. Is there anything we can do to fix this on a more global scale, e.g. a commit to trunk? If you need anything more from me, let me know, I'll be happy to help you squash this bug.
Updated by Toshi MARUYAMA about 14 years ago
Could you try to change io.gets
to io.read
at source:/tags/1.0.3/lib/redmine/scm/adapters/subversion_adapter.rb#L39 ?
diff --git a/lib/redmine/scm/adapters/subversion_adapter.rb b/lib/redmine/scm/adapters/subversion_adapter.rb --- a/lib/redmine/scm/adapters/subversion_adapter.rb +++ b/lib/redmine/scm/adapters/subversion_adapter.rb @@ -36,7 +36,7 @@ module Redmine version = nil shellout(cmd) do |io| # Read svn version in first returned line - if m = io.gets.to_s.match(%r{((\d+\.)+\d+)}) + if m = io.read.to_s.match(%r{((\d+\.)+\d+)}) version = m[0].scan(%r{\d+}).collect(&:to_i) end end
Mercurial adapter changed io.gets
to io.read
at r3722.
Updated by Toshi MARUYAMA about 14 years ago
http://www.redmine.org/projects/redmine/repository/show/trunk?rev=1672 does not show property.
Updated by Toshi MARUYAMA about 14 years ago
- File redmine-rev-4000.png redmine-rev-4000.png added
This is a image after patch applied of r4000.
* svk:merge: e93f8b46-1217-0410-a6f0-8f06a7374b81:/trunk:1751 * svn:ignore: coverage
http://www.redmine.org/projects/redmine/repository/show/trunk?rev=4000 does not show.
Updated by Ве Fio about 14 years ago
Confirmed, I just removed Mischa The Evil's patch, and added yours in, and it works. Still shows the properties, and I see no broken pipe errors.
Updated by Mischa The Evil about 14 years ago
Toshi MARUYAMA wrote:
Could you try to change
io.gets
toio.read
at source:/tags/1.0.3/lib/redmine/scm/adapters/subversion_adapter.rb#L39 ?[...]
Mercurial adapter changed
io.gets
toio.read
at r3722.
That patch solves the issue at it's root AFAICS. So it seems to be caused by the specific differences between the two different methods.
Updated by Toshi MARUYAMA about 14 years ago
Updated by Toshi MARUYAMA about 14 years ago
Following is test result with script/console.
$ LANG=C svn --version svn, version 1.6.13 (r1002816) compiled Oct 11 2010, 08:18:53 Copyright (C) 2000-2009 CollabNet. Subversion is open source software, see http://subversion.tigris.org/ This product includes software developed by CollabNet (http://www.Collab.Net/).
Before applied patch
$ LANG=C RAILS_ENV=test ruby script/console Loading test environment (Rails 2.3.5) /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement >> v = Redmine::Scm::Adapters::SubversionAdapter.client_version svn: Write error: Broken pipe => [] >>
After applied patch
$ LANG=C RAILS_ENV=test ruby script/console Loading test environment (Rails 2.3.5) /usr/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement >> v = Redmine::Scm::Adapters::SubversionAdapter.client_version => [1, 6, 13] >>
Updated by Toshi MARUYAMA about 14 years ago
- File svn-version.diff svn-version.diff added
- % Done changed from 0 to 100
I update a patch to read only first line of "svn --version" and I attach it.
Updated by Jean-Philippe Lang about 14 years ago
This patch changes #gets for #read with less changes. Can you give it a try?
Index: lib/redmine/scm/adapters/subversion_adapter.rb =================================================================== --- lib/redmine/scm/adapters/subversion_adapter.rb (revision 4392) +++ lib/redmine/scm/adapters/subversion_adapter.rb (working copy) @@ -36,8 +36,8 @@ version = nil shellout(cmd) do |io| # Read svn version in first returned line - if m = io.gets.to_s.match(%r{((\d+\.)+\d+)}) - version = m[0].scan(%r{\d+}).collect(&:to_i) + if m = io.read.to_s.match(%r{\A(.*?)((\d+\.)+\d+)}) + version = m[2].scan(%r{\d+}).collect(&:to_i) end end return nil if $? && $?.exitstatus != 0
Updated by Mischa The Evil about 14 years ago
Jean-Philippe Lang wrote:
This patch changes #gets for #read with less changes. Can you give it a try?
[...]
J-PL,
Thanks for looking at this (old) issue. It seemed to me like nobody else encountered it... Regarding your change-proposal: it works flawlessly. I vote (+1) for inclusion into Redmine 1.0.4...
Updated by Toshi MARUYAMA about 14 years ago
As I described at note-10 of #5096, Redmine git adapter use "io.gets".
And Darcs adpter use "io.gets" at source:tags/1.0.3/lib/redmine/scm/adapters/darcs_adapter.rb#L38 .
It maybe we should use "io.each_line" instead of "io.gets".
Updated by Jean-Philippe Lang about 14 years ago
- Status changed from New to Closed
- Resolution set to Fixed
Fix committed in r4419.
Toshi, I think #gets is ok as long as every lines are read.