Re: [viewvc-users] Using viewvc with remote Subversion

Michael Schwager <[email protected]> Thu, 9 Jun 2016 14:44:00 -0500
Newsgroups gmane.comp.version-control.cvs.viewcvs.user
Message-ID <CAPm3rnbiE4ak7acHMnyGtALduoFJ4FE=Y_j5hiN+cD=nau=0Ow@mail.gmail.com>
------=_Part_8205_1562681899.1465501444033
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Well I changed it from $HOME to explicitly setting the full path, and it's
working. I'm not sure if $HOME was recognized as something else. But the
full path did the trick. Note that I tar copied the entire .subversion
directory from a user that had already logged in (and I saved the password
non-encrypted). I then changed ownership to "apache" on the entire thing.

However, then I started getting this error:

An Exception Has OccurredPython Traceback

Traceback (most recent call last):
  File "/usr/local/viewvc-1.1.24/lib/viewvc.py", line 4855, in main
    request.run_viewvc()
  File "/usr/local/viewvc-1.1.24/lib/viewvc.py", line 408, in run_viewvc
    self.view_func(self)
  File "/usr/local/viewvc-1.1.24/lib/viewvc.py", line 2252, in view_directory
    tree_rev = request.repos.created_rev(request.where, rev)
  File "/usr/local/viewvc-1.1.24/lib/vclib/svn/svn_ra.py", line 736,
in created_rev
    lh_rev, c_rev = self._get_last_history_rev(_path_parts(path), rev)
  File "/usr/local/viewvc-1.1.24/lib/vclib/svn/svn_ra.py", line 555,
in _get_last_history_rev
    optrev = _rev2optrev(rev)
  File "/usr/local/viewvc-1.1.24/lib/vclib/svn/svn_repos.py", line
111, in _rev2optrev
    assert type(rev) is int
AssertionError


I dug into the code, and it's here that the problem is:

assert type(rev) is int

I went to svn_ra.py and inserted some print debug code. The type of "rev"
is "long". So I just hacked poor ol' svn_repos.py and changed line 111 to:

assert (type(rev) is int or type(rev) is long)

and it seems to work now.


On Thu, Jun 9, 2016 at 1:37 PM, Michael Schwager <[email protected]> wrote:

> Yes, I explicitly set it to be httpd's home directory
> (/usr/share/httpd/.subversion).
>
>
> On Thu, Jun 9, 2016 at 7:54 AM, C. Michael Pilato <[email protected]>
> wrote:
>
>> On 06/08/2016 06:03 PM, Michael Schwager wrote:
>>
>> I get a ViewVC page up and can see the "svnrepos" link, but when I click
>> on it I get
>>
>> File "/usr/lib64/python2.7/site-packages/libsvn/ra.py", line 533, in svn_ra_open
>>     return _ra.svn_ra_open(*args)
>> SubversionException: 170001 - Unable to connect to a repository at URL 'http://subversion/svn/repos3/configuration/trunk/it/rancid/ch1'
>> 170001 - OPTIONS of 'http://subversion/svn/repos3/configuration/trunk/it/rancid/ch1': authorization failed: Could not authenticate to server: rejected Basic challenge (http://subversion)
>>
>>
>> ...but I'm sure apache can run svn commands because if I change its shell
>> in /etc/passwd from /sbin/nologin to /bin/bash and try some svn commands
>> such as svn log
>> http://subversion/svn/repos3/configuration/trunk/it/rancid/ch1    it
>> works without requiring any credentials. This is because I copied the
>> .subversion directory from the "rancid" user, which is authorized to my
>> svn. I changed ownership of the entire .subversion heirarchy to the apache
>> user.
>>
>> Is there something I missed?
>>
>>
>> Did you set the svn_config_dir option to point to that .subversion
>> directory?  By default, Subversion assumes that the configuration directory
>> lives in $HOME/.subversion, but maybe something about your configuration is
>> causing that calculation to go awry.
>>
>
>
>
> --
> -Mike Schwager
>



-- 
-Mike Schwager

------------------------------------------------------
http://viewvc.tigris.org/ds/viewMessage.do?dsForumId=4255&dsMessageId=3174737

To unsubscribe from this discussion, e-mail: [[email protected]].
------=_Part_8205_1562681899.1465501444033
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Well I changed it from $HOME to explicitly setting the ful=
l path, and it&#39;s working. I&#39;m not sure if $HOME was recognized as s=
omething else. But the full path did the trick. Note that I tar copied the =
entire .subversion directory from a user that had already logged in (and I =
saved the password non-encrypted). I then changed ownership to &quot;apache=
&quot; on the entire thing.<div><br></div><div>However, then I started gett=
ing this error:</div><div><br></div><div><h3 style=3D"color:rgb(0,0,0);font=
-family:&#39;Times New Roman&#39;">An Exception Has Occurred</h3><h4 style=
=3D"color:rgb(0,0,0);font-family:&#39;Times New Roman&#39;;font-size:medium=
">Python Traceback</h4><p style=3D"color:rgb(0,0,0);font-family:&#39;Times =
New Roman&#39;;font-size:medium"></p><pre style=3D"color:rgb(0,0,0)">Traceb=
ack (most recent call last):
  File &quot;/usr/local/viewvc-1.1.24/lib/viewvc.py&quot;, line 4855, in ma=
in
    request.run_viewvc()
  File &quot;/usr/local/viewvc-1.1.24/lib/viewvc.py&quot;, line 408, in run=
_viewvc
    self.view_func(self)
  File &quot;/usr/local/viewvc-1.1.24/lib/viewvc.py&quot;, line 2252, in vi=
ew_directory
    tree_rev =3D request.repos.created_rev(request.where, rev)
  File &quot;/usr/local/viewvc-1.1.24/lib/vclib/svn/svn_ra.py&quot;, line 7=
36, in created_rev
    lh_rev, c_rev =3D self._get_last_history_rev(_path_parts(path), rev)
  File &quot;/usr/local/viewvc-1.1.24/lib/vclib/svn/svn_ra.py&quot;, line 5=
55, in _get_last_history_rev
    optrev =3D _rev2optrev(rev)
  File &quot;/usr/local/viewvc-1.1.24/lib/vclib/svn/svn_repos.py&quot;, lin=
e 111, in _rev2optrev
    assert type(rev) is int
AssertionError
</pre></div><div><br></div><div>I dug into the code, and it&#39;s here that=
 the problem is:</div><div><br></div><div>assert type(rev) is int<br></div>=
<div><br></div><div>I went to svn_ra.py and inserted some print debug code.=
 The type of &quot;rev&quot; is &quot;long&quot;. So I just hacked poor ol&=
#39; svn_repos.py and changed line 111 to:</div><div><br></div><div>assert =
(type(rev) is int or type(rev) is long)<br></div><div><br></div><div>and it=
 seems to work now.</div><div><br></div></div><div class=3D"gmail_extra"><b=
r><div class=3D"gmail_quote">On Thu, Jun 9, 2016 at 1:37 PM, Michael Schwag=
er <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]" target=3D"_b=
lank">[email protected]</a>&gt;</span> wrote:<br><blockquote class=3D"gmai=
l_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left=
:1ex"><div dir=3D"ltr">Yes, I explicitly set it to be httpd&#39;s home dire=
ctory (/usr/share/httpd/.subversion).<div><br></div></div><div class=3D"gma=
il_extra"><div><div class=3D"h5"><br><div class=3D"gmail_quote">On Thu, Jun=
 9, 2016 at 7:54 AM, C. Michael Pilato <span dir=3D"ltr">&lt;<a href=3D"mai=
lto:[email protected]" target=3D"_blank">[email protected]</a>&gt;</spa=
n> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;b=
order-left:1px #ccc solid;padding-left:1ex">
 =20
   =20
 =20
  <div bgcolor=3D"#FFFFFF" text=3D"#000000"><span>
    On 06/08/2016 06:03 PM, Michael Schwager wrote:<br>
    <blockquote type=3D"cite">
     =20
      <div dir=3D"ltr">I get a ViewVC page up and can see the &quot;svnrepo=
s&quot;
        link, but when I click on it I get
        <div>
          <div>
            <pre style=3D"color:rgb(0,0,0)">File &quot;/usr/lib64/python2.7=
/site-packages/libsvn/ra.py&quot;, line 533, in svn_ra_open
    return _ra.svn_ra_open(*args)
SubversionException: 170001 - Unable to connect to a repository at URL &#39=
;<a href=3D"http://subversion/svn/repos3/configuration/trunk/it/rancid/ch1"=
 target=3D"_blank">http://subversion/svn/repos3/configuration/trunk/it/ranc=
id/ch1</a>&#39;
170001 - OPTIONS of &#39;<a href=3D"http://subversion/svn/repos3/configurat=
ion/trunk/it/rancid/ch1" target=3D"_blank">http://subversion/svn/repos3/con=
figuration/trunk/it/rancid/ch1</a>&#39;: authorization failed: Could not au=
thenticate to server: rejected Basic challenge (<a href=3D"http://subversio=
n" target=3D"_blank">http://subversion</a>)
</pre>
          </div>
          <div><br>
          </div>
          <div>...but I&#39;m sure apache can run svn commands because if I
            change its shell in /etc/passwd from /sbin/nologin to
            /bin/bash and try some svn commands such as svn log=C2=A0<span =
style=3D"color:rgb(0,0,0)"><a href=3D"http://subversion/svn/repos3/configur=
ation/trunk/it/rancid/ch1" target=3D"_blank">http://subversion/svn/repos3/c=
onfiguration/trunk/it/rancid/ch1</a>
              =C2=A0 =C2=A0it works without requiring any credentials. This=
 is
              because I copied the .subversion directory from the
              &quot;rancid&quot; user, which is authorized to my svn. I cha=
nged
              ownership of the entire .subversion heirarchy to the
              apache user.</span></div>
          <div><br>
          </div>
          <div>Is there something I missed?</div>
        </div>
      </div>
    </blockquote>
    <br></span>
    Did you set the svn_config_dir option to point to that .subversion
    directory?=C2=A0 By default, Subversion assumes that the configuration
    directory lives in $HOME/.subversion, but maybe something about your
    configuration is causing that calculation to go awry.<br>
  </div>

</blockquote></div><br><br clear=3D"all"><div><br></div></div></div><span c=
lass=3D"HOEnZb"><font color=3D"#888888">-- <br><div data-smartmail=3D"gmail=
_signature">-Mike Schwager</div>
</font></span></div>
</blockquote></div><br><br clear=3D"all"><div><br></div>-- <br><div class=
=3D"gmail_signature" data-smartmail=3D"gmail_signature">-Mike Schwager</div=
>
</div>

------=_Part_8205_1562681899.1465501444033--