プロジェクト

全般

プロフィール

Vote #68583

完了

svn: Write error: Broken pipe when browsing repository

Admin Redmine さんがほぼ2年前に追加. ほぼ2年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
SCM_3
対象バージョン:
開始日:
2010/11/10
期日:
進捗率:

100%

予定工数:
category_id:
3
version_id:
26
issue_org_id:
6860
author_id:
3906
assigned_to_id:
0
comments:
18
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
25
ステータス-->[Closed]

説明

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


journals

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":http://www.mail-archive.com/users@subversion.apache.org/msg03981.html

If above is incorrect, how is SVN set up?
--------------------------------------------------------------------------------
> svn: Write error: Broken pipe when browsing repository

message#2995 might be interesting too in your situation...

Please let me know if my fix workes for you too...
--------------------------------------------------------------------------------
Mischa The Evil wrote:
> > svn: Write error: Broken pipe when browsing repository
>
> message#2995 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":http://www.mail-archive.com/users@subversion.apache.org/msg03981.html
>
> 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)
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------

Could you try to change @io.gets@ to @io.read@ at source:/tags/1.0.3/lib/redmine/scm/adapters/subversion_adapter.rb#L39 ?

<pre>
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

</pre>

Mercurial adapter changed @io.gets@ to @io.read@ at r3722.

--------------------------------------------------------------------------------
http://www.redmine.org/projects/redmine/repository/show/trunk?rev=1672 does not show property.

--------------------------------------------------------------------------------
This is a image after patch applied of r4000.

<pre>
* svk:merge: e93f8b46-1217-0410-a6f0-8f06a7374b81:/trunk:1751
* svn:ignore: coverage
</pre>

http://www.redmine.org/projects/redmine/repository/show/trunk?rev=4000 does not show.
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
Toshi MARUYAMA wrote:
> Could you try to change @io.gets@ to @io.read@ at source:/tags/1.0.3/lib/redmine/scm/adapters/subversion_adapter.rb#L39 ?
>
> [...]
>
> Mercurial adapter changed @io.gets@ to @io.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.
--------------------------------------------------------------------------------
What should I do?
Should I create unit test such as #5117 ?
I notice a patch of #5117 use @io.gets@.

--------------------------------------------------------------------------------

Following is test result with script/console.

<pre>
$ 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/).

</pre>

Before applied patch

<pre>
$ 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
=> []
>>
</pre>

After applied patch

<pre>
$ 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]
>>
</pre>

--------------------------------------------------------------------------------
I update a patch to read only first line of "svn --version" and I attach it.

--------------------------------------------------------------------------------
This patch changes #gets for #read with less changes. Can you give it a try?

<pre>
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
</pre>

--------------------------------------------------------------------------------
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 version#26...
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
As I described at "note-10":http://www.redmine.org/issues/5096#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".

--------------------------------------------------------------------------------
Fix committed in r4419.

Toshi, I think #gets is ok as long as every lines are read.
--------------------------------------------------------------------------------
Jean-Philippe Lang wrote:
> Fix committed in r4419.

Thanks a lot!

--------------------------------------------------------------------------------

Admin Redmine さんがほぼ2年前に更新

  • カテゴリSCM_3 にセット
  • 対象バージョン1.0.4_26 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0