On Thu, Nov 19, 2020 at 02:53:25PM +0200, Dimitios Moustos wrote:
> Hello,

Dimitios, thanks for your report.

> I failed to clone the tryton-env repository after enabling subrepos.
> I have confirmation it works on the same network config under Linux.

mercurial subrepos shouldn't be the problem here.

to resume a bit the problem: mercurial fails to clone a repository,
the connection is aborted with ECONNRESET (Connection reset by peer).

To reproduce:

$ hg -v --traceback --config subrepos.allowed=true clone 
https://hg.tryton.org/tryton-env


The issue is reproductible on OpenBSD, but not on others OS:

- cedk (tryton developer) reproduced it on OpenBSD and not on Linux on
  the same network (not a network problem)

- I tested it on ipv4 and ipv6 network (both failed)

- juanfra@ already looked at it too, and confirmed that dragonfly
  (with libressl) doesn't have the problem


as us mercurial port has no patches, it moves the problem on OpenBSD
side.

>From analysis with wireshark of the network connection, it seems that
the tcp stream is a bit "chaotic" (ipv6 here):

- wireshark complains:
  - regulary with "New fragment overlaps old data (retransmission?)"
  - some "TCP Previous segment not captured" (so I assume not received as it is 
during the capture and not at start)
  - few "TCP Dup ACK"

- received frame len of 1506 (whereas my local re0 mtu is 1500 / on router 
pppoe0 mtu 1492, vlan mtu 1500, re0 mtu 1504)
  - ipv6 payload len 1452
  - tcp segment len 1420

and just before ECONNRESET:
- receive a packet: wireshark note that "TCP Window Full"
- my host ACK with Win=0 "TCP ZeroWindow"
- some exchange "TCP Keep-Alive" received and "TCP ZeroWindow" sent during 
~5-6second
- receive RST,ACK packet



> My machine(s) are running 6.8 on amd64, tested my main machine and a vps from 
> openbsd.amsterdam. No syspatch-es were applied at the time of testing.
> 
> I started with this info:
> https://www.tryton.org/develop
> 
> I discussed the issue here:
> https://discuss.tryton.org/t/problem-doing-hg-clone-tryton-env/3464/12
> 
> Sebastien Marie suggested I use this command:
> hg clone -v --config subrepos.allowed=true --stream \
>  https://hg.tryton.org/tryton-env
> which worked. Now I can hg update.
> 
> I tested both the mercurial installed by pkg_add (ports) and one installed by 
> pip, same result on both of them.
> 
> Please have a look at this only if it has the potential to improve the 
> port/mercurial, I have managed to solve my problem with Sebastien's help.
> 
> Please see a some commandline output below:
> 
> dot$ hg -v clone https://hg.tryton.org/tryton-env
> destination directory: tryton-env
> applying clone bundle from 
> https://downloads-cdn.tryton.org/bundles/tryton-env-bzip2-v1
> adding changesets
> adding manifests
> transaction abort!                                                            
>   
>                                                                               
>  
> rollback completed
> (sent 2 HTTP requests and 434 bytes; received 1102 bytes in responses)
> abort: error: None
> dot$ echo $?
> 255
> 
> 
> dot$ hg -v --traceback clone https://hg.tryton.org/tryton-env
> destination directory: tryton-env
> applying clone bundle from 
> https://downloads-cdn.tryton.org/bundles/tryton-env-bzip2-v1
> adding changesets
> adding manifests
> transaction abort!                                                            
>   
>                                                                               
>  
> rollback completed
> (sent 2 HTTP requests and 434 bytes; received 1102 bytes in responses)
> Traceback (most recent call last):
>   File "/usr/local/lib/python3.8/site-packages/mercurial/scmutil.py", line 
> 152, 
> in callcatch
>     return func()
>   File "/usr/local/lib/python3.8/site-packages/mercurial/dispatch.py", line 
> 469, in _runcatchfunc
>     return _dispatch(req)
>   File "/usr/local/lib/python3.8/site-packages/mercurial/dispatch.py", line 
> 1232, in _dispatch
>     return runcommand(
>   File "/usr/local/lib/python3.8/site-packages/mercurial/dispatch.py", line 
> 917, in runcommand
>     ret = _runcommand(ui, options, cmd, d)
>   File "/usr/local/lib/python3.8/site-packages/mercurial/dispatch.py", line 
> 1244, in _runcommand
>     return cmdfunc()
>   File "/usr/local/lib/python3.8/site-packages/mercurial/dispatch.py", line 
> 1230, in <lambda>
>     d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
>   File "/usr/local/lib/python3.8/site-packages/mercurial/util.py", line 1867, 
> in check
>     return func(*args, **kwargs)
>   File "/usr/local/lib/python3.8/site-packages/mercurial/commands.py", line 
> 1904, in clone
>     r = hg.clone(
>   File "/usr/local/lib/python3.8/site-packages/mercurial/hg.py", line 901, in 
> clone
>     exchange.pull(
>   File "/usr/local/lib/python3.8/site-packages/mercurial/exchange.py", line 
> 1823, in pull
>     _maybeapplyclonebundle(pullop)
>   File "/usr/local/lib/python3.8/site-packages/mercurial/exchange.py", line 
> 2905, in _maybeapplyclonebundle
>     if trypullbundlefromurl(repo.ui, repo, url):
>   File "/usr/local/lib/python3.8/site-packages/mercurial/exchange.py", line 
> 3144, in trypullbundlefromurl
>     bundle2.applybundle(repo, cg, tr, b'clonebundles', url)
>   File "/usr/local/lib/python3.8/site-packages/mercurial/bundle2.py", line 
> 371, 
> in applybundle
>     _processchangegroup(op, unbundler, tr, source, url, **kwargs)
>   File "/usr/local/lib/python3.8/site-packages/mercurial/bundle2.py", line 
> 490, 
> in _processchangegroup
>     ret = cg.apply(op.repo, tr, source, url, **kwargs)
>   File "/usr/local/lib/python3.8/site-packages/mercurial/changegroup.py", 
> line 
> 343, in apply
>     self._unpackmanifests(repo, revmap, trp, progress)
>   File "/usr/local/lib/python3.8/site-packages/mercurial/changegroup.py", 
> line 
> 258, in _unpackmanifests
>     repo.manifestlog.getstorage(b'').addgroup(deltas, revmap, trp)
>   File "/usr/local/lib/python3.8/site-packages/mercurial/manifest.py", line 
> 1843, in addgroup
>     return self._revlog.addgroup(
>   File "/usr/local/lib/python3.8/site-packages/mercurial/revlog.py", line 
> 2410, 
> in addgroup
>     for data in deltas:
>   File "/usr/local/lib/python3.8/site-packages/mercurial/changegroup.py", 
> line 
> 480, in deltaiter
>     for chunkdata in iter(lambda: self.deltachunk(chain), {}):
>   File "/usr/local/lib/python3.8/site-packages/mercurial/changegroup.py", 
> line 
> 480, in <lambda>
>     for chunkdata in iter(lambda: self.deltachunk(chain), {}):
>   File "/usr/local/lib/python3.8/site-packages/mercurial/changegroup.py", 
> line 
> 199, in deltachunk
>     headerdata = readexactly(self._stream, self.deltaheadersize)
>   File "/usr/local/lib/python3.8/site-packages/mercurial/util.py", line 3522, 
> in readexactly
>     s = stream.read(n)
>   File 
> "/usr/local/lib/python3.8/site-packages/mercurial/utils/compression.py", 
> line 376, in read
>     chunk = self._reader(65536)
>   File "/usr/local/lib/python3.8/site-packages/mercurial/keepalive.py", line 
> 465, in read
>     data = self._raw_read(amt)
>   File "/usr/local/lib/python3.8/http/client.py", line 458, in read
>     n = self.readinto(b)
>   File "/usr/local/lib/python3.8/site-packages/mercurial/keepalive.py", line 
> 604, in readinto
>     got = self._raw_readinto(mv[have:total])
>   File "/usr/local/lib/python3.8/http/client.py", line 502, in readinto
>     n = self.fp.readinto(b)
>   File "/usr/local/lib/python3.8/socket.py", line 669, in readinto
>     return self._sock.recv_into(b)
>   File "/usr/local/lib/python3.8/ssl.py", line 1241, in recv_into
>     return self.read(nbytes, buffer)
>   File "/usr/local/lib/python3.8/ssl.py", line 1099, in read
>     return self._sslobj.read(len, buffer)
> ssl.SSLError: Connection reset by peer (_ssl.c:2627)
> abort: error: None
> 
> 
> Dimitrios
> 

-- 
Sebastien Marie

Reply via email to