207 error for ssh:// repository URIs when http:// URIs work

121 views
Skip to first unread message

Chris Toomey

unread,
May 16, 2011, 11:59:06 PM5/16/11
to reviewboard
We're running ReviewBoard 1.5.3.1 with Mercurial and are using the "hg
postreview" extension to post reviews to the server. This works fine
for any repository that we've entered via the RB admin UI with a path
(URI) starting with http://, but the RB server replies with a 400
response reporting a 207 error (file not found in the repository) when
we try to configure the same repository to have a ssh:// path. We
want to use ssh:// and not http:// URIs for select repositories for
access-control reasons, but to do an apples to apples comparison I
wanted to try ssh:// for a repository that is known to work via http://.

The server reports 201 on the POST /rb/api/review-requests/ call, 200
on the PUT /rb/api/review-requests/489/draft/, but 400 on the POST /rb/
api/review-requests/489/diffs/ call.

The submitted diff is the same in the call that fails when using an ssh://
repository URI and the one that succeeds with a http:// repository
API.

I've verified that the ssh authentication works -- the sshrepo
validate_repo call succeeds, and there are no errors logged to /var/
log/auth.log.

I've set DEBUG = True in my settings yet the reviewboard log doesn't
log anything about this issue.

Any ideas on why this might be failing, and how to debug it further
(where to add additional logging or where to set breakpoints, etc.)?

thanks,
Chris

Christian Hammond

unread,
May 17, 2011, 12:12:38 AM5/17/11
to revie...@googlegroups.com
Hi Chris,

When you do the HTTP POST and get the 400, what's the result payload like? It should give a hint as to what's failing. At the very least, I'd expect an error message for the path field.

Christian

--
Christian Hammond - chi...@chipx86.com
Review Board - http://www.reviewboard.org
VMware, Inc. - http://www.vmware.com



--
Want to help the Review Board project? Donate today at http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~----------~----~----~----~------~----~------~--~---
To unsubscribe from this group, send email to reviewboard...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/reviewboard?hl=en

Chris Toomey

unread,
May 17, 2011, 1:51:07 AM5/17/11
to reviewboard
Hi Christian,

It just has the info about the file/revision that it says it can't
find:

{"stat": "fail", "err": {"msg": "The file was not found in the
repository", "code": 207}, "file": "webapp/zend/application/
Bootstrap.php", "revision": "89c64afda439"}

If I cd to the repository dir. on the server (the RB server and
mercurial repository are on the same host) and execute "hg cat -r
89c64afda439 webapp/zend/application/Bootstrap.php" I get the contents
of that rev. of the file, which is definitely in the repository. And
again, it's able to access that rev. of the file when I use an http://
repository path in RB.

Chris

On May 16, 9:12 pm, Christian Hammond <chip...@chipx86.com> wrote:
> Hi Chris,
>
> When you do the HTTP POST and get the 400, what's the result payload like?
> It should give a hint as to what's failing. At the very least, I'd expect an
> error message for the path field.
>
> Christian
>
> --
> Christian Hammond - chip...@chipx86.com
> Review Board -http://www.reviewboard.org
> VMware, Inc. -http://www.vmware.com
>
> On Mon, May 16, 2011 at 8:59 PM, Chris Toomey
> <ctdisp-reviewbo...@yahoo.com>wrote:
> > Happy user? Let us know athttp://www.reviewboard.org/users/

Gilles Moris

unread,
May 18, 2011, 1:27:29 AM5/18/11
to revie...@googlegroups.com, Chris Toomey
On Tuesday 17 May 2011 07:51:07 am Chris Toomey wrote:
> Hi Christian,
>
> It just has the info about the file/revision that it says it can't
> find:
>
> {"stat": "fail", "err": {"msg": "The file was not found in the
> repository", "code": 207}, "file": "webapp/zend/application/
> Bootstrap.php", "revision": "89c64afda439"}
>
> If I cd to the repository dir. on the server (the RB server and
> mercurial repository are on the same host) and execute "hg cat -r
> 89c64afda439 webapp/zend/application/Bootstrap.php" I get the contents
> of that rev. of the file, which is definitely in the repository.  And
> again, it's able to access that rev. of the file when I use an http://
> repository path in RB.
>
> Chris

The 'hg cat' command cannot operate remotely through ssh:// repositories. It
works only locally. The http:// repos in RB work around that using the raw
file download from the hgweb interface.
So you cannot configure a HG repo with ssh:// from ReviewBoard.
You have to use local path (or NFS/SMB) or http://. It might be possible to
use https:// as well.

Regards.
Gilles.

Chris Toomey

unread,
May 18, 2011, 7:11:37 PM5/18/11
to reviewboard
Thanks Giles. When I was trying to debug it I saw that it was running
"hg serve" remotely on the target host over ssh, so it looked like it
should thus be able to work w/ the same hgweb interface, but that's
about where I got stuck trying to figure out why it wasn't working.
Was that some work that was started and not completed or was I
misinterpreting how it was trying to work?

Chris

Gilles Moris

unread,
May 19, 2011, 2:10:37 AM5/19/11
to revie...@googlegroups.com, Chris Toomey
AFAIK, the "hg serve --stdio" command does not start hgweb. It just instruct
HG to start the wire protocol to listen on SSH stdin instead of a HTTP
socket. But the HG wire protocol has no command to retrieve a file revision
content.

So the solution would be to either:
- Implement a new wire command to retrieve a file revision on the HG side.
There has always been some push back for such requests, so I don't see that
happen.
- Implement a specialized HGSSHClient class in the hg.py of the ReviewBoard
scmtools to would run remotely run "hg cat" command and dump the result over
the SSH link, instead of trying to run the HG wire protocol over SSH.
The Pros is that this would work with any mercurial version.
The drawback of this solution is that you can't protect SSH accesses with the
hg-ssh script. You would have to use a different wrapper.

Regards.
Gilles.

Chris Toomey

unread,
May 19, 2011, 12:39:01 PM5/19/11
to reviewboard
Thanks Gilles. We'll look at switching the repository to http then.

Chris

Wolfgang Hottgenroth

unread,
Mar 24, 2016, 6:55:54 PM3/24/16
to reviewboard, ctdisp-re...@yahoo.com
This is a rather old thread, so I hope the people discussing here are still in the group.
My question: reading this says to me, that reviewboard simply can not be used with Mercurial over ssh. And still not in 2016. Am I right here?

Thanks and Cheers, Wolfgang

Chris Toomey

unread,
Mar 24, 2016, 11:05:54 PM3/24/16
to Wolfgang Hottgenroth, reviewboard
I've since switched companies and am no longer using RB nor Mercurial so I can't confirm either way, sorry.

Chris

Reply all
Reply to author
Forward
0 new messages