You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DNS query for www.google.com failed: too many retries #78
@clue, I tried php 7.0.20 and 7.1.6 (I can't change it. These versions on server)
clue/block-react v1.2.0 Integrate async React PHP components into your blocking environment
evenement/evenement v2.1.0 Événement is a very simple event dispatching library for PHP
guzzlehttp/psr7 1.4.2 PSR-7 message implementation that also provides common utility methods
psr/http-message 1.0.1 Common interface for HTTP messages
psr/log 1.0.2 Common interface for logging libraries
react/cache v0.4.1 Async caching.
react/dns v0.4.9 Async DNS resolver for ReactPHP
react/event-loop v0.4.3 Event loop abstraction layer that libraries can use for evented I/O.
react/http-client v0.5.3 Event-driven, streaming HTTP client for ReactPHP
react/promise v2.5.1 A lightweight implementation of CommonJS Promises/A for PHP
react/promise-timer v1.2.0 Trivial timeout implementation for Promises
react/socket v0.8.1 Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP
react/stream v0.7.0 Event-driven readable and writable streams for non-blocking I/O in ReactPHP
unreal4u/telegram-api v3.0.0 A complete Telegram bot API implementation written in PHP, with support for inline bots!
yoshi2889/collections v0.1.6 Simple Collection class allowing storage of specific data.
yoshi2889/multipart-builder v0.1.1 Stream-independent RFC2388 compliant multipart form data builder.
react/stream = 0.7 or react/dns = 0.4.9 doesn't work
react/stream = 0.6 or react/dns = 0.4.8 doesn't work
It seems problem with php
Yes, i'm using windows, but if i run this script from android it doesn't work too.
OS on server is linux
@Buheda Just to make sure that we don't have to fix something, too. Could you try the example in https://github.com/amphp/dns and report whether that errors out, too?
Thanks for reporting back, unfortunately we'll still have to investigate this further:
Here's what the "DNS query for www.google.com failed: too many retries" error basically means: This component sends a UDP message (DNS query) to your DNS server and waits for a reply. If no answer is received within 5s, it will send a new UDP message and then another one again if no answer is received. If an answer is received, it will verify the response message and resolve the promise. The error shows that no answer has been received.
So this basically means that we did not receive a reply messageg from your DNS server. This could be due to a number of reasons and could very likely be not something this package has control over.
Can you update react/dns to the latest version again and check which DNS server you're using and whether a firewall or intermediary proxy could possibly block access to this server? You may also be able to play around with the timeout values in TimeoutExecutor or the number of retries in RetryExecutor. Which DNS server are you using? Can you verify this is correctly listed in the examples you're executing (it is currently hard-coded to Google's 8.8.8.8 there)? Does this error happen all the time? Can you try running the same example on another machine/network to check whether this is related to the network setup?
@Buheda Yes, that would be the problem here. Can you ask your provider for a DNS server that is reachable from within your network? It's likely that they may provide a custom DNS server in their network that is allowed to forward outgoing DNS requests.
@Buheda This is strange, the dig output looks good to me. I'm currently out of ideas and given that your provider seems to be blocking certain types of connections, I would suggest checking back with them (perhaps they allow some custom whitelist etc.).
Also i've found that their inner DNS ip is absent in /etc/resolv.conf
Does it matter?
This project does not currently use this file (see #29), but it's still strange that this isn't listed on your system. This makes me wonder how DNS works on your system in the first place and where your provider blocks your traffic?
As a temporary work-around you may also be able to simply patch your /etc/hosts file with hard-coded addresses, so that you do no longer rely on DNS in the first place.
#19 is also slightly related here, as we may be able to send a query over TCP/IP in case UDP connections are blocked.
In any case, the example uses the same code as the higher-level Connector which is used by higher-level client implementations. See also its documentation: https://github.com/reactphp/socket#connector
@Buheda I'm not sure I follow… The /etc/resolv.conf should have one or more nameserver X entries, this value should be used for the call to create() in the examples.
Note that the Connector is currently hard-coded to default to 8.8.8.8 (see reactphp/socket#90), which your hoster seems to block. This means that you will have to explicitly pass your DNS details to the Connector if you're using a higher-level protocol, such as HTTP etc.
@Buheda I understand it's frustrating, but at this point there's really little we can do here unfortunately. It looks like your provider is at fault for blocking UDP traffic here. I would suggest telling your provider about this issue and ask to be whitelisted and/or to start looking for another provider.
Once #19 or #80 is in, you may be able to circumvent your provider blocking certain kinds of traffic, but it appears unsound to rely on this only to circumvent your provider.
In the meantime, you may be able to patch your hosts file, even pass a custom hosts file and/or use an internal DNS server as documented above.
I believe this has been answered, so I'm closing this for now. Please come back with more details if this problem persists and we can reopen this 👍
Activity
clue commentedon Sep 9, 2017
Thanks for reporting! Similar issues have been reported before with #63 and #44 and were believed to be fixed with #74 in v0.4.10.
Can you give us some more details about the platform you're using, such as:
Our last investigation in #74 revealed this:
Can you verify this?
Buheda commentedon Sep 9, 2017
@clue, I tried php 7.0.20 and 7.1.6 (I can't change it. These versions on server)
react/stream = 0.7 or react/dns = 0.4.9 doesn't work
react/stream = 0.6 or react/dns = 0.4.8 doesn't work
It seems problem with php
Yes, i'm using windows, but if i run this script from android it doesn't work too.
OS on server is linux
WyriHaximus commentedon Sep 9, 2017
@Buheda out of curiosity have you tried one of the examples and see if that works?
Buheda commentedon Sep 9, 2017
@WyriHaximus I tried it before downgrade versions and after it. See log in first post. Doesn't work
kelunik commentedon Sep 9, 2017
@Buheda Just to make sure that we don't have to fix something, too. Could you try the example in https://github.com/amphp/dns and report whether that errors out, too?
Buheda commentedon Sep 9, 2017
@kelunik eh.. a have an errors
clue commentedon Sep 10, 2017
Thanks for reporting back, unfortunately we'll still have to investigate this further:
Here's what the "DNS query for www.google.com failed: too many retries" error basically means: This component sends a UDP message (DNS query) to your DNS server and waits for a reply. If no answer is received within 5s, it will send a new UDP message and then another one again if no answer is received. If an answer is received, it will verify the response message and resolve the promise. The error shows that no answer has been received.
So this basically means that we did not receive a reply messageg from your DNS server. This could be due to a number of reasons and could very likely be not something this package has control over.
Can you update react/dns to the latest version again and check which DNS server you're using and whether a firewall or intermediary proxy could possibly block access to this server? You may also be able to play around with the timeout values in
TimeoutExecutoror the number of retries inRetryExecutor. Which DNS server are you using? Can you verify this is correctly listed in the examples you're executing (it is currently hard-coded to Google's8.8.8.8there)? Does this error happen all the time? Can you try running the same example on another machine/network to check whether this is related to the network setup?I hope this helps 👍
Buheda commentedon Sep 10, 2017
@clue Yes. DNS server is 8.8.8.8 I've tried also 8.8.4.4
unfortunatly none of changes helped...
I will try run it from local server on my PC
Buheda commentedon Sep 10, 2017
@clue The hoster answered me a few minutes ago that they restricted UDP traffic. May be that is a root of problem?
clue commentedon Sep 10, 2017
@Buheda Yes, that would be the problem here. Can you ask your provider for a DNS server that is reachable from within your network? It's likely that they may provide a custom DNS server in their network that is allowed to forward outgoing DNS requests.
Buheda commentedon Sep 10, 2017
@clue hoster gave me ip adress their inner NS Server - but nothing changes if i use it..
WyriHaximus commentedon Sep 10, 2017
@Buheda Does a
dig @HOSTNSSERVERIPADDRESSHERE +tcp reactphp.orgreturns anything? And what aboutdig @HOSTNSSERVERIPADDRESSHERE +notcp reactphp.org?Buheda commentedon Sep 10, 2017
@WyriHaximus
Buheda commentedon Sep 10, 2017
@WyriHaximus
Buheda commentedon Sep 11, 2017
@clue may be i can try insert their ip in other files, not only into example?
Also i've found that their inner DNS ip is absent in /etc/resolv.conf
Does it matter?
clue commentedon Sep 11, 2017
@Buheda This is strange, the
digoutput looks good to me. I'm currently out of ideas and given that your provider seems to be blocking certain types of connections, I would suggest checking back with them (perhaps they allow some custom whitelist etc.).This project does not currently use this file (see #29), but it's still strange that this isn't listed on your system. This makes me wonder how DNS works on your system in the first place and where your provider blocks your traffic?
As a temporary work-around you may also be able to simply patch your
/etc/hostsfile with hard-coded addresses, so that you do no longer rely on DNS in the first place.#19 is also slightly related here, as we may be able to send a query over TCP/IP in case UDP connections are blocked.
In any case, the example uses the same code as the higher-level
Connectorwhich is used by higher-level client implementations. See also its documentation: https://github.com/reactphp/socket#connectorIf anybody else has any ideas, please share 👍
Buheda commentedon Sep 11, 2017
@clue
answer from hoster: "there is another ip in resolv.conf that is equal mine
all requested to external dns are disallowed on virtual hosting"
So packets go to their inner DNS and after that they have been blocked?
clue commentedon Sep 11, 2017
@Buheda I'm not sure I follow… The
/etc/resolv.confshould have one or morenameserver Xentries, this value should be used for the call tocreate()in the examples.Note that the
Connectoris currently hard-coded to default to8.8.8.8(see reactphp/socket#90), which your hoster seems to block. This means that you will have to explicitly pass your DNS details to theConnectorif you're using a higher-level protocol, such as HTTP etc.Buheda commentedon Sep 11, 2017
@clue all adresses from /etc/resolv.conf gave error
but hoster's second ip exist in resolv.conf
But all adresses from hosts give positive answer.
clue commentedon Sep 12, 2017
@Buheda I understand it's frustrating, but at this point there's really little we can do here unfortunately. It looks like your provider is at fault for blocking UDP traffic here. I would suggest telling your provider about this issue and ask to be whitelisted and/or to start looking for another provider.
Once #19 or #80 is in, you may be able to circumvent your provider blocking certain kinds of traffic, but it appears unsound to rely on this only to circumvent your provider.
In the meantime, you may be able to patch your hosts file, even pass a custom hosts file and/or use an internal DNS server as documented above.
I believe this has been answered, so I'm closing this for now. Please come back with more details if this problem persists and we can reopen this 👍
Buheda commentedon Sep 12, 2017
@clue thank's for helping me.