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

Federation doesn't play nice with IPv6 (SYN-254) #1279

Closed
matrixbot opened this issue Feb 1, 2015 · 10 comments
Closed

Federation doesn't play nice with IPv6 (SYN-254) #1279

matrixbot opened this issue Feb 1, 2015 · 10 comments
Labels
A-Federation z-bug (Deprecated Label) z-p2 (Deprecated Label)

Comments

@matrixbot
Copy link
Member

Servers with v6 resolvers seem to have problems federating - see synacktik from #matrix:matrix.org:

Feb 1 12:31
http://pastebin.com/giEhadsG

i have ipv6 running on this server, yeah
Feb 1 12:55
dual stack
Feb 1 12:59
well thats interesting
Feb 1 13:00
removed my v6 resolvers

(Imported from https://matrix.org/jira/browse/SYN-254)

(Reported by @ara4n)

@matrixbot
Copy link
Member Author

Jira watchers: @ara4n

@matrixbot
Copy link
Member Author

The problem seems to be that twisted's http agent is hardcoded to ipv4:
http://twistedmatrix.com/pipermail/twisted-python/2012-August/026012.html

-- @ara4n

@matrixbot
Copy link
Member Author

...and our federation endpoint is hardcoded to ipv4 too:

    if ssl_context_factory is None:
        transport_endpoint = TCP4ClientEndpoint
        default_port = 8008
    else:
        transport_endpoint = SSL4ClientEndpoint
        endpoint_kw_args.update(sslContextFactory=ssl_context_factory)
        default_port = 8448

-- @ara4n

@matrixbot
Copy link
Member Author

Twisted uses its own resolver lib, which plays nice with IPv4 addresses, but not with IPv6. Related to twisted ticket #4362.

python -m twisted.conch.stdio

>>> from twisted.names import client
>>> resolver = client.createResolver(servers=[('2001:4860:4860::8888', 53)])
>>> resolver.getHostByName('google.com')
<Deferred at 0x7f9fa9e14908 current result: <twisted.python.failure.Failure <class 'twisted.internet.error.InvalidAddressError'>>>
>>> resolver = client.createResolver(servers=[('8.8.8.8', 53)])
>>> resolver.getHostByName('google.com')
<Deferred at 0x7f9fa9e279e0 waiting on Deferred at 0x7f9fa9e27c68>
>>>

-- Sander Ruitenbeek

@matrixbot matrixbot added A-Federation z-p2 (Deprecated Label) z-bug (Deprecated Label) labels Nov 7, 2016
@matrixbot matrixbot changed the title Federation doesn't play nice with IPv6 (SYN-254) Federation doesn't play nice with IPv6 (https://github.com/matrix-org/synapse/issues/1279) Nov 7, 2016
@matrixbot matrixbot changed the title Federation doesn't play nice with IPv6 (https://github.com/matrix-org/synapse/issues/1279) Federation doesn't play nice with IPv6 (SYN-254) Nov 7, 2016
@PMaynard
Copy link
Contributor

PMaynard commented Dec 7, 2016

Is there any work around, I can't federate my homeserver until this is resolved?
I tried to bind the 8448 listener to my IPv4 address but it did not help.

[edit]
Not using IPv6 resolver is a temporary fix #1002
Though now it does appear to crash randomly.

@ara4n
Copy link
Member

ara4n commented Dec 7, 2016 via email

@kyrias
Copy link
Contributor

kyrias commented Dec 7, 2016

I am working on it, though I can't make any promises on how much freetime I'll have to work on it. And next-gen HS work ey? ;D

@glyph
Copy link
Contributor

glyph commented Dec 11, 2016

See #1689 and #1690

@ara4n
Copy link
Member

ara4n commented Dec 11, 2016

@glyph - many thanks for the PRs here. we'll have a play with them in the morning!

@ara4n
Copy link
Member

ara4n commented Dec 20, 2016

fixed by the above and #1696

@ara4n ara4n closed this as completed Dec 20, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Federation z-bug (Deprecated Label) z-p2 (Deprecated Label)
Projects
None yet
Development

No branches or pull requests

5 participants