Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Federation tries to use ipv6 even if ipv6 is not available #2850

Closed
turt2live opened this issue Feb 6, 2018 · 9 comments
Closed

Federation tries to use ipv6 even if ipv6 is not available #2850

turt2live opened this issue Feb 6, 2018 · 9 comments
Labels
z-bug (Deprecated Label) z-major (Deprecated Label)

Comments

@turt2live
Copy link
Member

turt2live commented Feb 6, 2018

Description

2018-02-05 19:14:51,585 - synapse.access.http.8008 - 59 - INFO - GET-131021- - - 8008 - Received request: GET /_matrix/client/r0/directory/room/%23test%3Amatrix.org?access_token=<redacted>
2018-02-05 19:14:51,589 - synapse.http.outbound - 154 - INFO - GET-131021- {GET-O-1317} [matrix.org] Sending request: GET matrix://matrix.org/_matrix/federation/v1/query/directory?room_alias=%23test%3Amatrix.org
2018-02-05 19:14:51,590 - synapse.http.endpoint - 264 - INFO - - Connecting to 2a04:3541:1000:500:6866:a4ff:fe4c:21ac:8448
2018-02-05 19:14:51,592 - twisted - 131 - INFO - - Starting factory _HTTP11ClientFactory(<function quiescentCallback at 0x7f9d7826ad70>, <synapse.http.endpoint._WrappingEndpointFac object at 0x7f9d9c993190>)
2018-02-05 19:14:51,593 - twisted - 131 - INFO - - Stopping factory _HTTP11ClientFactory(<function quiescentCallback at 0x7f9d7826ad70>, <synapse.http.endpoint._WrappingEndpointFac object at 0x7f9d9c993190>)
2018-02-05 19:14:51,892 - synapse.http.matrixfederationclient - 212 - WARNING - GET-131021- {GET-O-1317} Sending request failed to matrix.org: GET matrix://matrix.org/_matrix/federation/v1/query/directory?room_alias=%23test%3Amatrix.org: NoRouteError('Network is unreachable',)
2018-02-05 19:14:51,892 - synapse.http.outbound - 236 - INFO - GET-131021- {GET-O-1317} [matrix.org] Result: NoRouteError('Network is unreachable',)
2018-02-05 19:14:51,893 - synapse.http.server - 183 - ERROR - GET-131021- Failed handle request synapse.http.server._async_render on <synapse.rest.ClientRestResource object at 0x7f9dae55b590>: <XForwardedForRequest at 0x7f9d78220bd8 method=GET uri=/_matrix/client/r0/directory/room/%23test%3Amatrix.org?access_token=<redacted> clientproto=HTTP/1.1 site=8008>: Traceback (most recent call last): Failure: twisted.internet.error.NoRouteError: No route to host: 101: Network is unreachable.
2018-02-05 19:14:51,895 - synapse.access.http.8008 - 93 - INFO - GET-131021- - - 8008 - {None} Processed request: 309ms (4ms, 0ms) (1ms/1ms/1) 69B 500 "GET /_matrix/client/r0/directory/room/%23test%3Amatrix.org?access_token=<redacted> HTTP/1.1" "curl/7.47.0"

The homeserver that received this request doesn't have ipv6 enabled, and failed to reach matrix.org. Instead of automatically falling back to ipv4, it returned a 500 error at the client. After 5 or so requests for the same alias, synapse eventually started relying on the ipv4 address of matrix.org though.

Version information

  • Homeserver: dev.t2bot.io
  • Version: 0.26.0
  • Install method: pip
  • Platform: Ubuntu 16.04 VM
@ara4n
Copy link
Member

ara4n commented Feb 6, 2018

this sounds like federation in general trying to connect to v6 even if the box has no v6 :/

@ara4n ara4n added z-bug (Deprecated Label) p1 z-major (Deprecated Label) labels Feb 6, 2018
@turt2live
Copy link
Member Author

fwiw, the federation_sender has a similar problem: it fails endlessly trying to reach ipv6 addresses until it eventually decides to use ipv4 for a while.

@turt2live turt2live changed the title Room directory lookups can fail if the homeserver doesn't use ipv6 Federation tries to use ipv6 even if ipv6 is not available Mar 12, 2018
@turt2live
Copy link
Member Author

I've managed to confirm this for more than the room directory by simply scrolling through the logs. Backfilling, getting missing events, and everything else tries ipv6 first.

@ara4n
Copy link
Member

ara4n commented Mar 28, 2018

i'm getting this too on arasphere.net atm; very annoying.

@git-minix
Copy link

2018-04-01 10:57:21,243 - synapse.http.endpoint - 264 - INFO - - Connecting to 2400:cb00:2048:1::6818:cf1b:8443
...
2018-04-01 10:57:21,545 - synapse.http.matrixfederationclient - 223 - WARNING - None- {PUT-O-1} Sending request failed to matrix.org: PUT matrix://matrix.org/_matrix/federation/v1/send/????????????/: ConnectBindError('Address family not supported by protocol',)
2018-04-01 10:57:25,058 - synapse.handlers.presence - 328 - INFO - - Handling presence timeouts
2018-04-01 10:57:25,059 - synapse.handlers.typing - 78 - INFO - - Checking for typing timeouts
2018-04-01 10:57:25,060 - synapse.handlers.presence - 243 - INFO - - Performing _persist_unpersisted_changes. Persisting 1 unpersisted changes

Same here.

@ansorg
Copy link

ansorg commented May 15, 2018

Slightly different error message but actually the same issue?

018-05-15 15:00:33,863 - synapse.http.matrixfederationclient - 223 - WARNING - POST-101 - {GET-O-2} Sending request failed to matrix.org: GET matrix://matrix.org/_matrix/federation/v1/publicRooms?include_all_networks=true&limit=20: ConnectError('Cannot assign requested address',)

@ara4n
Copy link
Member

ara4n commented Jun 5, 2018

i thought this was fixed by #3016? i think @ansorg's issue might be different (or might have been on an old synapse?)

@ansorg
Copy link

ansorg commented Jun 6, 2018

@ara4n My issue seems gone. server was on 0.2x and is up to 0.30 by now.

@turt2live
Copy link
Member Author

Yea... I'm going to go ahead and close this because I haven't seen the issue since 0.28 landed (with #3016). If someone is still seeing this, please mention it here so this issue can be reopened or open a new issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
z-bug (Deprecated Label) z-major (Deprecated Label)
Projects
None yet
Development

No branches or pull requests

4 participants