Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

DNS query error: too many retries #59

Closed
radonthetyrant opened this issue Mar 5, 2017 · 5 comments
Closed

DNS query error: too many retries #59

radonthetyrant opened this issue Mar 5, 2017 · 5 comments

Comments

@radonthetyrant
Copy link

$connection = new Connection();
        $connection
            ->setServerHostname("irc.quakenet.org")
            ->setServerPort(6667)
            ->setNickname("test01010101010")
            ->setUsername("test10101010101")
            ->setOption('allow-self-signed', true)
        ;
        if ($this->config["ssl"])
            $connection->setOption('transport', 'ssl');

        $client = new Client();

        $client->on('irc.received', function ($message, $write, $conn, $logger) use ($io) {
            dump($message);
        });

        $client->run($connection);

leads to:
2017-03-05 15:32:24 ERROR DNS query for irc.quakenet.org failed: too many retries []

Is this an issue on my end?

@elazar
Copy link
Member

elazar commented Mar 5, 2017

I believe so, as I'm not able to replicate it. I'd suggest using a DNS server other than the default (i.e. 8.8.8.8, a Google DNS server), such as some of these other free DNS servers. You can use the setDnsServer() method of the Client instance to do this.

I did notice a few other things in the process of trying to replicate your issue, though.

  1. On my local system, so long as the transport is set to 'ssl', the test script seems to die because, in Client->addSecureConnection(), the then() callback isn't being executed. I'm not sure why this is. @WyriHaximus may be able to provide more insight here.

  2. You are not calling setHostname(), setServername(), or setRealname() on your Connection instance. These are necessary for the USER command to succeed when registering your connection. If they are not included, you can receive an error from the server resembling the following:

2017-03-05 15:48:46 DEBUG [email protected] USER test10101010101 0 :* []
...
2017-03-05 15:48:46 DEBUG [email protected] :portlane.se.quakenet.org 461 * USER :Not enough parameters []
array(8) {
  ["prefix"]=>
  string(25) ":portlane.se.quakenet.org"
  ["servername"]=>
  string(24) "portlane.se.quakenet.org"
  ["command"]=>
  string(3) "461"
  ["params"]=>
  array(5) {
    [1]=>
    string(4) "USER"
    [2]=>
    string(21) "Not enough parameters"
    ["iterable"]=>
    array(1) {
      [0]=>
      string(4) "USER"
    }
    ["tail"]=>
    string(21) "Not enough parameters"
    ["all"]=>
    string(27) "USER :Not enough parameters"
  }
  ["message"]=>
  string(61) ":portlane.se.quakenet.org 461 * USER :Not enough parameters
"
  ["code"]=>
  string(18) "ERR_NEEDMOREPARAMS"
  ["target"]=>
  string(1) "*"
  ["tail"]=>
  string(18) "PING :1991449620
"
}
  1. QuakeNet in particular seems to require more in the way of identification / registration than just USER and NICK commands. See the console output below. The network documentation on IDENT and Trusts and AUTH may be helpful.
2017-03-05 15:48:54 DEBUG [email protected] NOTICE AUTH :*** No ident response []
array(4) {
  ["command"]=>
  string(6) "NOTICE"
  ["params"]=>
  array(3) {
    ["all"]=>
    string(27) "AUTH :*** No ident response"
    ["nickname"]=>
    string(4) "AUTH"
    ["text"]=>
    string(21) "*** No ident response"
  }
  ["message"]=>
  string(36) "NOTICE AUTH :*** No ident response
"
  ["targets"]=>
  array(1) {
    [0]=>
    string(4) "AUTH"
  }
}
2017-03-05 15:50:15 DEBUG [email protected] ERROR :Closing Link: test01010101010 by portlane.se.quakenet.org (Registration Timeout) []
array(3) {
  ["command"]=>
  string(5) "ERROR"
  ["params"]=>
  array(2) {
    ["all"]=>
    string(81) ":Closing Link: test01010101010 by portlane.se.quakenet.org (Registration Timeout)"
    ["message"]=>
    string(80) "Closing Link: test01010101010 by portlane.se.quakenet.org (Registration Timeout)"
  }
  ["message"]=>
  string(89) "ERROR :Closing Link: test01010101010 by portlane.se.quakenet.org (Registration Timeout)
"
}

@WyriHaximus
Copy link
Member

@radonthetyrant are you on windows 10 or server 2012? If so we're working on it: reactphp/dns#44

@elazar
Copy link
Member

elazar commented Mar 5, 2017

That could explain it. I'm using OS X, so that issue wouldn't affect me.

@radonthetyrant
Copy link
Author

radonthetyrant commented Mar 5, 2017

hello,

@WyriHaximus yes indeed, i used this on a windows 8.1 machine with php7.1 because it's easier for me to test the scripts on win before moving them to linux. I use 8.8.8.8 all the time btw.

@elazar thanks for the detailed response. I tried to get the script to connect at all, so a working user command is secondary for now.
The ssl was turned off tho, since 6667 is the default non-ssl port.

since it seems to be related to reactphp, i guess this issue can be closed.

@WyriHaximus
Copy link
Member

@radonthetyrant tested it locally with a resolver of in my local network and with Google's resolver. The issue doesn't persists in Google's but with Windows.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants