On 14/08/2025 20:41, Anton Shestakov wrote:
I assume "502 unknown gateway" is how uwsgi or something else in the stack handles "500 Internal Server Error" responses
from hg. Probably is not a problem in itself, but looks a little strange.
yes. I suspect uwsgi does the conversion....
Then you need to look at what happens on the server when the request is done
with actual real data, see below.
I looked on the server & obtained the traceback that was happening.
........
~~~~~~~~~^^^
KeyError: b'nodes'
This is to be expected, considering you didn't give the server all the required
parameters for the command.
If you want to start debugging hg server protocol, you can simply try `hg
serve` locally and then using
"http://127.0.0.1:8000/?cmd=known&nodes="
for an empty response or
"http://127.0.0.1:8000/?cmd=known&nodes=0000000000000000000000000000000000000000"
> (that's 40 zeroes) for a response of a single character "1".
forgive me I'm just a simple mercurial user and readily admit I haven't studied
what goes on under the hood.
........
I checked the result of adding the nodes argument (eg the 40 zeroes) to the request and then the response was '1' as you
suggested.
Looking at the nginx log shows that the request seems to be a GET ie a typical failure looks like (here I am using a
6.6.3 mercurial client).
hostname aa.bb.cc.61 - - [13/Aug/2025:14:46:47 +0000] "GET /hg-xxx/repo/?cmd=capabilities HTTP/1.1"
401 188 "-" "mercurial/proto-1.0 (Mercurial 6.6.3)" 443
hostname aa.bb.cc.62 - remote-user [13/Aug/2025:14:46:48 +0000] "GET /hg-xxx/repo/?cmd=capabilities
HTTP/1.1" 200 518 "-" "mercurial/proto-1.0 (Mercurial 6.6.3)" 443
hostname aa.bb.cc.62 - remote-user [13/Aug/2025:14:46:48 +0000] "GET /hg-xxx/repo/?cmd=batch
HTTP/1.1" 200 85 "-" "mercurial/proto-1.0 (Mercurial 6.6.3)" 443
hostname aa.bb.cc.62 - remote-user [13/Aug/2025:14:46:48 +0000] "GET /hg-xxx/repo/?cmd=known
HTTP/1.1" 502 264 "-" "mercurial/proto-1.0 (Mercurial 6.6.3)" 443
Since I see a GET for the cmd=known request the required nodes= is missing I
will try putting
[experimental]
httppostargs=true
in the config.
--
Robin Becker
_______________________________________________
Mercurial mailing list
Mercurial@lists.mercurial-scm.org
https://lists.mercurial-scm.org/mailman/listinfo/mercurial