Issue423

Title Report server-side error on remote http operations
Priority bug Status chatting
Superseder Nosy List Phil, ThomasAH, djc, mathieu.clabaut, tonfa
Assigned To Topics http_proto, ssh_proto

Created on 2006-11-19.18:31:11 by mathieu.clabaut, last changed 2008-02-11.12:16:41 by djc.

Messages
msg2704 (view) Author: ThomasAH Date: 2007-01-15.07:45:30
The only chance to cleanly send errors is at the start of a chunk. So what about
using something like

try:
    prepare chunk
except StandardError:
    log error
    send error
    (see 769be3c57564 for an example)
else:
    try:
        send chunk
    except StandardError:
        log verbosely, ring alarm bell, whatever
        (and try the best on the client side, as before)

Clients not understanding these error chunks are as (un)happy as before, but
newer clients can provide a better error message to the user.
msg2702 (view) Author: Phil Date: 2007-01-14.23:49:33
> Most of the other errors can be seen by pointing a browser to the repo
Not the ones where you have to push some content.
msg2701 (view) Author: tonfa Date: 2007-01-14.23:30:04
The biggest problem is for the changegroup command (the one that sends a stream
on clone/pull), if a traceback happen during this command it will be "embedded"
in the stream. Detecting this is quite hard. (Most of the other errors can be
seen by pointing a browser to the repo)
msg2700 (view) Author: Phil Date: 2007-01-14.23:11:30
what about an additional header that will give a mercurial error number that the
client would know about:
HTTP/1.1 200 Script output follows
Date: Sun, 14 Jan 2007 23:22:30 GMT
Server: Apache
X-Mercurial-ErrorCode: 42
Transfer-Encoding: chunked
Content-Type: text/html; charset=ANSI_X3.4-1968
...
msg2620 (view) Author: tonfa Date: 2006-12-30.16:29:47
Someone (sorry don't remember who) proposed using some kind of multipart content
type, and send the error message in another part.

I don't know if it's possible as I'm not familiar with mime types.
msg2372 (view) Author: mathieu.clabaut Date: 2006-11-19.18:31:10
Currently a server-side error (like a bad permission) produces the following
error on the client side when cloning by http (apache server) :
abort: consistency error adding group!
transaction abort!

Such permissions error may not be an uncommon error and as such, it would be
good to raise some informative error on the client side. 
It may perhaps be possible, when  RevlogError(_("consistency error adding
group")) is raised to have a look at the incoming chunk of data to check if the
client get a backtrace, and then inform the user...
History
Date User Action Args
2008-02-11 12:16:41djcsetnosy: + djc
2007-01-15 07:45:32ThomasAHsetnosy: ThomasAH, tonfa, mathieu.clabaut, Phil
messages: + msg2704
2007-01-14 23:49:33Philsetnosy: ThomasAH, tonfa, mathieu.clabaut, Phil
messages: + msg2702
2007-01-14 23:30:04tonfasetnosy: ThomasAH, tonfa, mathieu.clabaut, Phil
messages: + msg2701
2007-01-14 23:11:30Philsetnosy: ThomasAH, tonfa, mathieu.clabaut, Phil
messages: + msg2700
2007-01-14 22:31:55tonfasetnosy: + Phil
2007-01-14 22:31:30tonfalinkissue479 superseder
2006-12-30 16:29:48tonfasetstatus: unread -> chatting
nosy: + tonfa
messages: + msg2620
2006-11-19 21:17:21ThomasAHsettopic: + http_proto, ssh_proto
nosy: + ThomasAH
2006-11-19 18:31:11mathieu.clabautcreate