Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when adding remote contact #528

Closed
DeadSix27 opened this issue Apr 11, 2015 · 25 comments
Closed

Error when adding remote contact #528

DeadSix27 opened this issue Apr 11, 2015 · 25 comments
Assignees
Labels

Comments

@DeadSix27
Copy link

Everytime I add a buddy via pidgin from a remote server using my server and request a authorization
I get this error and when I try to message that person it gives me a 404 pidgin error.

Does anyone know why this happens and or what it means?

My ejabberd version is: ejabberd 15.03.94
erl version is:
Erlang/OTP 17 [erts-6.4] [source-2e19e2f] [64-bit] [smp:64:2] [async-threads:10] [hipe] [kernel-poll:false]

If you need any more info, tell me.

Here is the log:

2015-04-11 17:48:38.504 [error] <0.551.0> CRASH REPORT Process <0.551.0> with 0 neighbours exited with reason: no function clause matching inet_dns:encode_labels(<<0,5,1,0,0,1,0,0,0,0,0,0,12,95,120,109,112,112,45,115,101,114,118,101,114,4,95,116,99,112,8,102,...>>, {4,{[<<"_xmpp-server">>,<<"_tcp">>,<<"domainHiddenByMe">>,<<"com">>,<<>>],12,{[<<"_tcp">>,<<"domainHiddenByMe">>,...],...},...}}, 42, [<<>>]) line 693 in p1_fsm:terminate/8 line 760
2015-04-11 17:48:38.505 [error] <0.333.0> Supervisor ejabberd_s2s_out_sup had child undefined started with {ejabberd_s2s_out,start_link,undefined} at <0.551.0> exit with reason no function clause matching inet_dns:encode_labels(<<0,5,1,0,0,1,0,0,0,0,0,0,12,95,120,109,112,112,45,115,101,114,118,101,114,4,95,116,99,112,8,102,...>>, {4,{[<<"_xmpp-server">>,<<"_tcp">>,<<"domainHiddenByMe">>,<<"com">>,<<>>],12,{[<<"_tcp">>,<<"domainHiddenByMe">>,...],...},...}}, 42, [<<>>]) line 693 in context child_terminated
@mremond mremond added this to the ejabberd 15.04 milestone Apr 11, 2015
@badlop
Copy link
Member

badlop commented Apr 14, 2015

From what you say, it happens all the times for all the remote servers. Essentially, s2s does not work in your ejabberd server?

Does this work for you?

$ erl
Erlang/OTP 17 [erts-6.2] [source] [smp:2:2] [async-threads:10] [kernel-poll:false]

Eshell V6.2  (abort with ^G)
1> inet_res:getbyname("_xmpp-server._tcp.jabber.org", srv, 2000).
{ok,{hostent,"_xmpp-server._tcp.jabber.org",[],srv,2,
             [{31,30,5269,"hermes2v6.jabber.org"},
              {30,30,5269,"hermes2.jabber.org"}]}}
2> 

@DeadSix27
Copy link
Author

Depends what working means, as I get no response.
And no it seems like it only has issues on servers without a subdomain, I couln't try out much as I only know 2 servers with a user to add on.
But, the server having a domain like: "foo.bar.com" works fine, where as the server with "bar.eu" does not.
Anyway heres the, empty-output of the command u told me to use:
(I tried it once with line breaks, and once without to make sure)

Eshell V6.4  (abort with ^G)
1> inet_res:getbyname("_xmpp-server._tcp.jabber.org", srv, 2000).
{ok,{hostent,"_xmpp-server._tcp.jabber.org",[],srv,2,
             [{31,30,5269,"hermes2v6.jabber.org"},
              {30,30,5269,"hermes2.jabber.org"}]}}
2> {ok,{hostent,"_xmpp-server._tcp.jabber.org",[],srv,2,
2>              [{31,30,5269,"hermes2v6.jabber.org"},
2>               {30,30,5269,"hermes2.jabber.org"}]}}
2>
2> inet_res:getbyname("_xmpp-server._tcp.jabber.org", srv, 2000).{ok,{hostent,"_xmpp-server._tcp.jabber.org",[],srv,2,[{31,30,5269,"hermes2v6.jabber.org"},{30,30,5269,"hermes2.jabber.org"}]}}
2>

@badlop
Copy link
Member

badlop commented Apr 15, 2015

I need some way to reproduce your problem in my machine, if that is possible. You have seen that a manual call to jabber.org works; does jabber.org work when you use ejabberd?

If yes, then try that manual call to another server that doesn't work when you use ejabberd.

How did you install ejabberd: binary package, git version, source package, or some distribution? And what about your erlang?

@DeadSix27
Copy link
Author

EDIT: I tried to add "test@jabber.org", then requested auth a few times, but no error messages, so that seems to work fine.

To the setup:
I cloned the ejabberd official git repo and compiled it with: (Note, i didnt pull the last change, as i doubt its anything related to this bug)

./configure --enable-mysql --enable-zlib --enable-json --enable-iconv

And used the official esl-erlang_17.5-1ubuntuprecise_amd64.deb
from https://www.erlang-solutions.com/downloads/download-erlang-otp

My git version is (via apt-get)

$ git --version
git version 1.9.1

Ubuntu version is:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.2 LTS
Release:        14.04
Codename:       trusty

I then added BasicAsciiUserName@NoSubDomain.eu
Everything works fine, i see the user in my list as "Not authorized"
but he never gets the request, so i pressed "Re-request authorization"
when i then check my error log in ejabberd
it tells me:

2015-04-15 11:51:52.651 [error] <0.9617.0> CRASH REPORT Process <0.9617.0> with 0 neighbours exited with reason: no function clause matching inet_dns:encode_labels(<<0,36,1,0,0,1,0,0,0,0,0,0,12,95,120,109,112,112,45,115,101,114,118,101,114,4,95,116,99,112,8,102,...>>, {4,{[<<"_xmpp-server">>,<<"_tcp">>,<<"NoSubDomain">>,<<"nl">>,<<>>],12,{[<<"_tcp">>,<<"NoSubDomain">>,...],...},...}}, 42, [<<>>]) line 693 in p1_fsm:terminate/8 line 760
2015-04-15 11:51:52.651 [error] <0.333.0> Supervisor ejabberd_s2s_out_sup had child undefined started with {ejabberd_s2s_out,start_link,undefined} at <0.9617.0> exit with reason no function clause matching inet_dns:encode_labels(<<0,36,1,0,0,1,0,0,0,0,0,0,12,95,120,109,112,112,45,115,101,114,118,101,114,4,95,116,99,112,8,102,...>>, {4,{[<<"_xmpp-server">>,<<"_tcp">>,<<"NoSubDomain">>,<<"nl">>,<<>>],12,{[<<"_tcp">>,<<"NoSubDomain">>,...],...},...}}, 42, [<<>>]) line 693 in context child_terminated

PS: Im not sure but, i also tried:

inet_res:getbyname("_xmpp-server._tcp.jabber.org", srv, 2000).{ok,{hostent,"_xmpp-server._tcp.jabber.org",[],srv,2,[{31,30,5269,"hermes2v6.jabber.org"},{30,30,5269,"hermes2.jabber.org"}]}}

and replaced "hermes2.jabber.org" with the host that crashes me
but since there is also hermes2v6 (which i assume is ipv6) I don't know how to reformat it , since i dont have ipv6 on that server.

But anyway, that is all that i can think of to reproduce the error on my end.
Is there anything else you need to know?

@badlop
Copy link
Member

badlop commented Apr 15, 2015

Try to call manually inet_res:getbyname to that server that doesn't work when you use ejabberd:

inet_res:getbyname("_xmpp-server._tcp.NoSubDomain.eu", srv, 2000).

@DeadSix27
Copy link
Author

EDIT:
I also just for curiosity tried:
inet_res:getbyname("_xmpp-server._tcp.NoSubDomain.eu", srv, 2000).
With exactly that FAKE domain, and it gives me the same error,
when i then try:
inet_res:getbyname("_xmpp-server._tcp.Actually.ASubDomain.eu", srv, 2000).
it gives me the same error (unless its formatted different, when it is a sub domain, which i dont know how to format)

Ok I did that, and i got this error:

Eshell V6.4  (abort with ^G)
1> inet_res:getbyname("_xmpp-server._tcp.TheDomain.nl", srv, 2000).
** exception error: no function clause matching inet_dns:encode_labels(<<0,2,1,0,0,1,0,0,0,0,0,0,12,95,120,109,112,112,45,115,
                                                                         101,114,118,101,114,4,95,116,...>>,
                                                                       {4,
                                                                        {[<<"_xmpp-server">>,<<"_tcp">>,<<"TheDomain">>,<<"nl">>,
                                                                          <<>>],
                                                                         12,
                                                                         {[<<"_tcp">>,<<"TheDomain">>,<<"nl">>,<<>>],25,nil,nil},
                                                                         {[<<"TheDomain">>,<<"nl">>,<<>>],
                                                                          30,nil,
                                                                          {[<<"nl">>,<<>>],39,nil,nil}}}},
                                                                       42,
                                                                       [<<>>]) (inet_dns.erl, line 693)
     in function  inet_dns:encode_name/4 (inet_dns.erl, line 674)
     in call from inet_dns:encode_query_section/3 (inet_dns.erl, line 268)
     in call from inet_dns:encode/1 (inet_dns.erl, line 239)
     in call from inet_res:make_query/5 (inet_res.erl, line 669)
     in call from inet_res:make_query/4 (inet_res.erl, line 637)
     in call from inet_res:res_query/6 (inet_res.erl, line 621)
     in call from inet_res:res_getby_query/4 (inet_res.erl, line 588)
2>

@badlop
Copy link
Member

badlop commented Apr 15, 2015

So, you are able to reproduce the problem with just a simple erlang call, and ejabberd is not involved in the problem.

I installed Erlang 17.5 i386 from ESL, and the only way to obtain an error similar to yours is to append dots at the end of the domain string. Notice that after << eu >> there is another <<>> that represents the unexpected .. I had added. In your calls, you get an error that also shows a <<>> in the end, but of course you don't add .. like I did.

If all this is correct, then it seems a problem in your machine, or a problem in the servers you attempt to connect, or a bug in erlang.

See my tests:

$ erl
Erlang/OTP 17 [erts-6.4] [source-2e19e2f] [smp:2:2] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V6.4  (abort with ^G)
1> inet_res:getbyname("_xmpp-server._tcp.aa.Domain.eu", srv, 2000). 
{error,nxdomain}

2> inet_res:getbyname("_xmpp-server._tcp.aa.Domain.eu.", srv, 2000).
{error,nxdomain}

3> inet_res:getbyname("_xmpp-server._tcp.aa.Domain.eu..", srv, 2000).
** exception error: no function clause matching inet_dns:encode_labels(<<0,4,1,0,0,1,0,0,0,0,0,0,12,95,120,109,112,112,45,115,
   101,114,118,101,114,4,95,116,...>>,
 {5,
    {[<<"_xmpp-server">>,<<"_tcp">>,<<"aa">>,<<"Domain">>,<<"eu">>,<<>>], 12,
    {[<<"_tcp">>,<<"aa">>,<<"Domain">>,<<"eu">>,<<>>], 25,
     {[<<"Domain">>,<<"eu">>,<<>>],33,nil,nil},
     nil},
     {[<<"aa">>,<<"Domain">>,<<"eu">>,<<>>], 30,nil,
       {[<<"eu">>,<<>>],40,nil,nil}}}},
        43,
        [<<>>]) (inet_dns.erl, line 693)
     in function  inet_dns:encode_name/4 (inet_dns.erl, line 674)
     in call from inet_dns:encode_query_section/3 (inet_dns.erl, line 268)
     in call from inet_dns:encode/1 (inet_dns.erl, line 239)
     in call from inet_res:make_query/5 (inet_res.erl, line 669)
     in call from inet_res:make_query/4 (inet_res.erl, line 637)
     in call from inet_res:res_query/5 (inet_res.erl, line 608)
     in call from inet_res:res_getby_query/3 (inet_res.erl, line 579)
4> 

@DeadSix27
Copy link
Author

EDIT3:
Tried inet_res:getbyname("_xmpp-server._tcp.TestServer.nl", srv, 2000).
gives {error,nxdomain}, like before
then i tried: Tried inet_res:getbyname("_xmpp-server._tcp.TestServer.nl.", srv, 2000).
(with dot on end), gives {error,nxdomain}, then i tried with ".." (2 dots)
and then it gave the error from before.
So ye I don't know what to do, weird is just that apparently it works in the erlang shell of v18, but not in ejabberd?

EDIT2:

But yet i still get:

2015-04-15 13:18:33.742 [error] <0.603.0> CRASH REPORT Process <0.603.0> with 0 neighbours exited with reason: no function clause matching inet_dns:encode_labels(<<0,7,1,0,0,1,0,0,0,0,0,0,12,95,120,109,112,112,45,115,101,114,118,101,114,4,95,116,99,112,8,102,...>>, {4,{[<<"_xmpp-server">>,<<"_tcp">>,<<"DomainName">>,<<"nl">>,<<>>],12,{[<<"_tcp">>,<<"DomainName">>,...],...},...}}, 42, [<<>>]) line 693 in p1_fsm:terminate/8 line 760
2015-04-15 13:18:33.743 [error] <0.396.0> Supervisor ejabberd_s2s_out_sup had child undefined started with {ejabberd_s2s_out,start_link,undefined} at <0.603.0> exit with reason no function clause matching inet_dns:encode_labels(<<0,7,1,0,0,1,0,0,0,0,0,0,12,95,120,109,112,112,45,115,101,114,118,101,114,4,95,116,99,112,8,102,...>>, {4,{[<<"_xmpp-server">>,<<"_tcp">>,<<"DomainName">>,<<"nl">>,<<>>],12,{[<<"_tcp">>,<<"DomainName">>,...],...},...}}, 42, [<<>>]) line 693 in context child_terminated

EDIT: I for curiosity upgraded erlang to 18 RC1
and now i tried:

$ erl
Erlang/OTP 18 [RELEASE CANDIDATE 1] [erts-7.0] [source-757dfc5] [64-bit] [smp:64:2] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V7.0  (abort with ^G)
1> inet_res:getbyname("_xmpp-server._tcp.TestServer.nl", srv, 2000).
{error,nxdomain}
2>

What do you recommend i should try? Downgrading erlang?

@badlop
Copy link
Member

badlop commented Apr 15, 2015

So now the problem with a certain domain appears only when using ejabberd, not in plain erlang? Then make sure you recompile all ejabberd with the new erlang, and that the new erlang is used to run ejabberd.
Other things to try is to use a different machine to make the tests. And to connect to different remote servers.

@DeadSix27
Copy link
Author

EDIT: And yes, now its just in ejabberd, but like you see below, now i struggle compiling it.

Compilation fails now, telling me:

Compiled src/stun_app.erl
/ejabberd.git/deps/p1_stun/src/stun_listener.erl:39: type dict() undefined
ERROR: compile failed while processing /ejabberd.git/deps/p1_stun: rebar_abort
make: *** [deps/.built] Error 1

any idea?

@mremond
Copy link
Member

mremond commented Apr 15, 2015

How to you build it ?

@DeadSix27
Copy link
Author

Define "how", i built it via ssh on my ubuntu VM using git to get the ejabberd source from this repo
then i ran autogen.sh then i ran configure (see one of the above comments for details) and then i ran "make", which then returned that error once it hit the compilation of the dep. "p1_stun"

@mremond
Copy link
Member

mremond commented Apr 15, 2015

You did not tell which version you are using, but I guess you are using R18. R18 has not yet been released as an official production release. You will need to adapt the code for compliance with R18. In such case this is as easy as replacing dict() with dict:dict(), but you may run into more issue on different places. Please, stay with production Erlang release.

@DeadSix27
Copy link
Author

You didn't read the previous comments, yes i am using a non stable release, because the stable release gives crashes in ejabbed.
I'm just trying around to fix the issues I have.
I will try to edit the source to make it use dict:dict() (Edit: worked, compiled fine)

EDIT (for badlop):
I successfully compiled with R18 as ERL version and tried the
following:
i ran this in erl shell:

1> inet_res:getbyname("_xmpp-server._tcp.TestServer.nl", srv, 2000).
{error,nxdomain}

So that works? I guess it does.

Then i tried again, to add a remote contact in ejabbed
but i still get:

2015-04-15 15:34:19.835 [error] <0.598.0> gen_fsm <0.598.0> in state open_socket terminated with reason: no function clause matching inet_dns:encode_labels(<<0,4,1,0,0,1,0,0,0,0,0,0,12,95,120,109,112,112,45,115,101,114,118,101,114,4,95,116,99,112,8,102,...>>, {4,{[<<"_xmpp-server">>,<<"_tcp">>,<<"TestServer">>,<<"nl">>,<<>>],12,{[<<"_tcp">>,<<"TestServer">>,...],...},...}}, 42, [<<>>]) line 693
2015-04-15 15:34:19.836 [error] <0.598.0> CRASH REPORT Process <0.598.0> with 0 neighbours exited with reason: no function clause matching inet_dns:encode_labels(<<0,4,1,0,0,1,0,0,0,0,0,0,12,95,120,109,112,112,45,115,101,114,118,101,114,4,95,116,99,112,8,102,...>>, {4,{[<<"_xmpp-server">>,<<"_tcp">>,<<"TestServer">>,<<"nl">>,<<>>],12,{[<<"_tcp">>,<<"TestServer">>,...],...},...}}, 42, [<<>>]) line 693 in p1_fsm:terminate/8 line 760
2015-04-15 15:34:19.836 [error] <0.392.0> Supervisor ejabberd_s2s_out_sup had child undefined started with {ejabberd_s2s_out,start_link,undefined} at <0.598.0> exit with reason no function clause matching inet_dns:encode_labels(<<0,4,1,0,0,1,0,0,0,0,0,0,12,95,120,109,112,112,45,115,101,114,118,101,114,4,95,116,99,112,8,102,...>>, {4,{[<<"_xmpp-server">>,<<"_tcp">>,<<"TestServer">>,<<"nl">>,<<>>],12,{[<<"_tcp">>,<<"TestServer">>,...],...},...}}, 42, [<<>>]) line 693 in context child_terminated

@mremond
Copy link
Member

mremond commented Apr 15, 2015

I perfectly read your comment. Badlop said that the problem is not with ejabberd but with Erlang + your server environment configuration. That said, it does not mean we are committed to do any work on r18 before it is released in June. Compliance will come higher priority at that time.

@mremond mremond removed this from the ejabberd 15.04 milestone Apr 15, 2015
@DeadSix27
Copy link
Author

Alright. I just followed what he said.
Not to mention he also said:
"So now the problem with a certain domain appears only when using ejabberd, not in plain erlang?"
Which is exactly the case now...

@badlop
Copy link
Member

badlop commented Apr 16, 2015

Notice: the problem appears when using, which does not mean the problem is in. I still suspect it's related to DNS configuration of your machine or the remote servers, but as I don't know any of that part of your setup, I'm half-blind in this ticket.

Apply this patch to ejabberd:

diff --git a/src/ejabberd_s2s_out.erl b/src/ejabberd_s2s_out.erl
index 9716432..4a307bc 100644
--- a/src/ejabberd_s2s_out.erl
+++ b/src/ejabberd_s2s_out.erl
@@ -1204,6 +1204,9 @@ srv_lookup(_Server, _Timeout, Retries)
     when Retries < 1 ->
     {error, timeout};
 srv_lookup(Server, Timeout, Retries) ->
+    ?INFO_MSG("Calling inet_res:getbyname(\"_xmpp-server._tcp.\" ++ ~p, srv, ~p) ... ", [Server, Timeout]),
+    RR = inet_res:getbyname("_xmpp-server._tcp." ++ Server, srv, Timeout),
+    ?INFO_MSG("... result is: ~p.", [RR]),
     case inet_res:getbyname("_xmpp-server._tcp." ++ Server,
                            srv, Timeout)
        of

Then trigger the problem, and let's see what do you get in the logs. I get this:

11:46:03.380 [info] New s2s connection started <0.506.0>
11:46:03.381 [info] Trying to open s2s connection: localhost -> localhost.com with TLS=false
11:46:03.404 [info] Calling inet_res:getbyname("_xmpp-server._tcp." ++ "localhost.com", srv, 10000) ... 
11:46:03.541 [info] ... result is: {error,nxdomain}.
11:46:13.615 [info] s2s connection: localhost -> localhost.com (remote server not found)
11:46:28.393 [info] Reconnect delay expired: Will now retry to connect to localhost.com when needed.

@DeadSix27
Copy link
Author

EDIT2: I can show you whatever you need to see, about the dns configs, its mostly default ubuntu and what my reseller defined.

EDIT:
Okay here are the results:

2015-04-16 13:40:26.345 [info] <0.593.0>@ejabberd_s2s:new_connection:456 New s2s connection started <0.622.0>
2015-04-16 13:40:26.345 [info] <0.622.0>@ejabberd_s2s_out:log_s2s_out:1318 Trying to open s2s connection: serv1.test.eu -> serv2.nl with TLS=true
2015-04-16 13:40:26.346 [info] <0.622.0>@ejabberd_s2s_out:srv_lookup:1207 Calling inet_res:getbyname("_xmpp-server._tcp." ++ "serv2.nl", srv, 10000) ...
2015-04-16 13:40:26.348 [error] <0.622.0> gen_fsm <0.622.0> in state open_socket terminated with reason: no function clause matching inet_dns:encode_labels(<<0,10,1,0,0,1,0,0,0,0,0,0,12,95,120,109,112,112,45,115,101,114,118,101,114,4,95,116,99,112,8,102,...>>, {4,{[<<"_xmpp-server">>,<<"_tcp">>,<<"serv2">>,<<"nl">>,<<>>],12,{[<<"_tcp">>,<<"serv2">>,...],...},...}}, 42, [<<>>]) line 693
2015-04-16 13:40:26.348 [error] <0.622.0> CRASH REPORT Process <0.622.0> with 0 neighbours exited with reason: no function clause matching inet_dns:encode_labels(<<0,10,1,0,0,1,0,0,0,0,0,0,12,95,120,109,112,112,45,115,101,114,118,101,114,4,95,116,99,112,8,102,...>>, {4,{[<<"_xmpp-server">>,<<"_tcp">>,<<"serv2">>,<<"nl">>,<<>>],12,{[<<"_tcp">>,<<"serv2">>,...],...},...}}, 42, [<<>>]) line 693 in p1_fsm:terminate/8 line 760
2015-04-16 13:40:26.349 [error] <0.386.0> Supervisor ejabberd_s2s_out_sup had child undefined started with {ejabberd_s2s_out,start_link,undefined} at <0.622.0> exit with reason no function clause matching inet_dns:encode_labels(<<0,10,1,0,0,1,0,0,0,0,0,0,12,95,120,109,112,112,45,115,101,114,118,101,114,4,95,116,99,112,8,102,...>>, {4,{[<<"_xmpp-server">>,<<"_tcp">>,<<"serv2">>,<<"nl">>,<<>>],12,{[<<"_tcp">>,<<"serv2">>,...],...},...}}, 42, [<<>>]) line 693 in context child_terminated

Okay, ill do that, and come back and edit my post with the results.

@badlop
Copy link
Member

badlop commented Apr 17, 2015

Great, so you got exactly what call ejabberd does to erlang and fails. If you perform that call manually, does it fail too? And does that happen 100% of the times (I mean, the same call done by ejabberd fails, and done manually by you succeeds)?

@DeadSix27
Copy link
Author

I assume i have to append a dot? lIke so:
inet_res:getbyname("_xmpp-server._tcp." ++ "serv2.nl", srv, 10000). <-- dot
I did that and get this result:

Erlang/OTP 18 [RELEASE CANDIDATE 1] [erts-7.0] [source-757dfc5] [64-bit] [smp:64:2] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V7.0  (abort with ^G)
1> inet_res:getbyname("_xmpp-server._tcp." ++ "fahrplan.nl", srv, 10000).
{error,nxdomain}
2>

Just for completeness, without dot:

Erlang/OTP 18 [RELEASE CANDIDATE 1] [erts-7.0] [source-757dfc5] [64-bit] [smp:64:2] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V7.0  (abort with ^G)
1> inet_res:getbyname("_xmpp-server._tcp." ++ "fahrplan.nl", srv, 10000)
1>

@mremond
Copy link
Member

mremond commented Apr 17, 2015

Can you please paste the content of your /etc/hosts file ? ejabberd is letting you add local hints in /etc/hosts for DNS resolution, but that content could interfer.
Thanks.

@DeadSix27
Copy link
Author

Here you go (note i hid my domain/ip):

$ cat /etc/hosts
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

127.0.0.1 localhost.localdomain localhost

# Auto-generated hostname. Please do not remove this comment.

xxx.xxx.xx.x subDomain.Domain.tld  subDomain

::1 localhost ip6-localhost ip6-loopback

@zinid
Copy link
Contributor

zinid commented Apr 17, 2015

Seems like the only way to reproduce the bug is to add dots to the end of the domain name being resolved:

5> inet_res:getbyname("_xmpp-server._tcp." ++ "serv2.nl..", srv, 10000).
** exception error: no function clause matching inet_dns:encode_labels(<<0,4,1,0,0,1,0,0,0,0,0,0,12,95,120,109,112,112,45,115,
                                                                         101,114,118,101,114,4,95,116,...>>,
                                                                       {4,
                                                                        {[<<"_xmpp-server">>,<<"_tcp">>,<<"serv2">>,<<"nl">>,<<>>],
                                                                         12,
                                                                         {[<<"_tcp">>,<<"serv2">>,<<"nl">>,<<>>],25,nil,nil},
                                                                         {[<<"serv2">>,<<"nl">>,<<>>],
                                                                          30,
                                                                          {[<<"nl">>,<<>>],36,nil,nil},
                                                                          nil}}},
                                                                       39,
                                                                       [<<>>]) (inet_dns.erl, line 693)
     in function  inet_dns:encode_name/4 (inet_dns.erl, line 674)
     in call from inet_dns:encode_query_section/3 (inet_dns.erl, line 268)
     in call from inet_dns:encode/1 (inet_dns.erl, line 239)
     in call from inet_res:make_query/5 (inet_res.erl, line 669)
     in call from inet_res:make_query/4 (inet_res.erl, line 637)
     in call from inet_res:res_query/5 (inet_res.erl, line 608)
     in call from inet_res:res_getby_query/3 (inet_res.erl, line 579)

This comes from this line: https://github.com/erlang/otp/blob/maint/lib/kernel/src/inet_dns.erl#L688. According to the code, I don't see other possibilities.

@DeadSix27
Copy link
Author

Ye, its weird, as i'm not adding any dots.

@DeadSix27 DeadSix27 reopened this Apr 17, 2015
erszcz pushed a commit to erszcz/ejabberd that referenced this issue Nov 7, 2015
…ick-run

generate app.config for `make quickrun`
@badlop badlop closed this as completed May 17, 2017
@lock
Copy link

lock bot commented Jun 10, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants