-
Notifications
You must be signed in to change notification settings - Fork 268
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
DNS error #25
Comments
|
I think this has something to do with how ReactPHP resolves the dns, as this is implemented in PHP as well. |
I agree that this error message is somewhat confusing and doesn't provide the necessary information. That's why I've filed reactphp/socket#230 a few weeks ago in the underlying component to improve error reporting. I'm planning to release this in the next couple of days if everything goes according to plan. This should give us much better insights to see what's going on. In the meantime, you can also try installing this component from |
@clue I just sent a test build with dev-master to someone that can reproduce the problem. Here's the result:
But pinging the host works just fine for him:
|
@mpociot Thanks, this makes it much easier to debug:
This means the client side can't connect to the DNS server, so this is likely a system configuration or firewall issue. Perhaps you can try running one of the included DNS examples here: https://github.com/reactphp/dns/tree/master/examples This is very close to what's being used internally by the socket component. We're not aware of any issues in our DNS component and these examples should work out of the box. If it doesn't work on your system, you can also try checking the |
@clue Thanks, adding 1.1.1.1 dns works for me. Then i remove this dns let only google's dns and still works. I'm in Brazil, maybe was some slow dns propagation. |
Running the first example from https://github.com/reactphp/dns/tree/master/examples returns this:
|
@themsaid Thanks for providing this exception trace. Can you file an issue in the upstream repo https://github.com/reactphp/dns with some details about your platform (PHP version, OS, We're not currently aware of any issues in our DNS component and people have been using this on a wide variety of platforms for years, so I'm really curious what could cause this issue. The only thing I have in mind might be if your system has a broken DNS configuration (primary DNS broken, but secondary DNS works), this is not currently implemented (reactphp/dns#6). In the meantime, you should be able to work around this by explicitly defining another DNS server like given above. As an alternative, you can also temporarily add an entry to your
Expose will also somehow use a $connector = new React\Socket\Connector($loop, array(
'dns' => '127.0.1.1'
)); |
@clue I was talking with @themsaid about this today and he was able to fix this. I think the best way to fix this in the Expose codebase, is to give users the ability to manually override/configure the DNS server that should be used when connecting. |
@mpociot I don't agree that Expose should have explicit DNS configuration by default. Any application should take advantage of the system configuration and just work. If your Adding explicit DNS configuration options could be useful in some more advanced scenarios, but this probably shouldn't be the default. In particular, Expose should not override the system settings by default because the system DNS configuration could configure a company-internal DNS server which resolves different addresses than a publicly available one such as Couldflare's or Google's (let alone possible privacy implications). I'd really like to understand what's causing this problem as it clearly seems to affect multiple users. We just need some more information and a fix probably shouldn't be too hard 👍 |
@themsaid I have no idea what's the causing the issue :) Could be the ISP indeed :) |
In the cases where this problem is occurring ... If so, then sometimes explicitly configuring to use 127.0.0.1 as the primary DNS service is helpful. dnsmasq does honor But with dnsmasq I would suggest not editing resolv.conf but instead to edit the dnsmasq settings (with Valet you can put custom configs in |
I also experienced this issue right now on expose Could not connect to the server.
Connection to sharedwithexpose.com:443 failed during DNS lookup: fwrite(): send of 38 bytes failed with errno=65 No route to host |
This clearly seems to affect more people, so we need some help to track this down! 🪲 It looks like this is an error in the underlying DNS component rather than Expose itself. We're not aware of any issues in the underlying DNS component and so far we haven't been able to reproduce this in the underlying DNS component. The error means the client side has issues communicating with the DNS server, so this is likely a system configuration or firewall issue. If this affects you, please try running one of the included DNS examples here: https://github.com/reactphp/dns/tree/master/examples If you can reproduce this error in the DNS component, please report an issue upstream in https://github.com/reactphp/dns/issues so we can isolate and track this down. Please include details about your platform (PHP version, OS, |
I just had this problem and maybe my observations can help: I'm in a corporate network that blocks anything but ports 80, 443 and 500 (for ipsec). So to be able to work I use a WireGuard VPN on port 500. The VPN works wonderfully, except for when I use expose. In those cases I simply deactivate the VPN and expose works as expected. |
If you can reproduce this problem locally, please show the output of the following commands:
The $ php -r "var_dump(fsockopen('udp://127.0.0.1:53'));" |
@dakira This is an interesting one. It's my understanding this should also forward port 53 so you can connect to your DNS server. Can you run the above commands and see how this is different from the above observations? |
My error is: "DNS query for X failed: too many retries" Related to:
When I do
Where X is redacted. If I change it (MacOS -> System Preferences -> Network -> Wifi -> Advanced -> DNS) to:
The problem goes away. I think this is because I'm working from home, 172.16.X.X is internal to the office which I am not connected to right now, expose is not doing a fallback to the second IP? |
Hey @clue, sorry for the late reply. Your commands don't quite work because expose is bundling react/dns in its executable phar. Anyway.. here are the results: php -v
php -r ....
100.64.3.4 is an authorative nameserver for internal-only domains that does not do any recursion. This can be confirmed using dig. dig @100.64.3.4 my.domain
So react/dns only seems to try the first DNS and then stop. Changing the order of DNS servers in my WireGuard config and moving 100.64.3.4 to the end of the list solves the problem. |
@dakira Thanks for helping analyze this problem and confirming my previous assumptions! It does indeed look like the problem here is a misconfigured/unreachable primary DNS server plus the fact that ReactPHP does not currently try a secondary DNS server (reactphp/dns#6). Fortunately, this means there are a number of work arounds that can be employed to avoid running into this problem:
With the recent additions I've done in the DNS component, we've already achived some much better error reporting which helped pinpointing this issue. Now, the longer term goal here is definitely to add support for secondary DNS servers in ReactPHP as discussed in reactphp/dns#6. This is definitely on the roadmap, but at the moment I'm buried in work, so I won't be able to make any commitments for this at the moment. In other words, there are currently no immediate plans to build this from my end (no demand at the moment and more important outstanding issues currently), but I would be really happy to accept and/or help with any PRs 👍 If you need this for a commercial project and if you want to help sponsor this feature, feel free to reach out and send me an email. Perhaps we can also find a couple of new GitHub sponsors to allow me spending some time on this? 🤝 (sorry for the plug) |
@mpociot I think this issue can be closed. |
It seems that I have the same problem.
I read all the above comments but I cannot find a solution to this. |
I checked my |
I had this error when I tried to set |
Now its back with the error... Could not connect to the server.
Connection to tls://sharedwithexpose.com:443 timed out after 20 seconds |
Yes...IPv6 is the problem. |
Can confirm disabling IPv6 resolves this :( |
Can someone help me reproduce this? My
So it's using an IPv6 DNS, but I'm still able to connect to Expose. It would be great if someone with this issue could try the following:
This updates the internal ReactPHP component dependencies, so maybe this fixes it for you? As I can't verify the fix, I could use some help. |
I tested but it gives me the same error:
|
If I change the order of DNS and set the IPv6 to be the last in the
to this:
|
@mpociot It's actually only not working when IPv6 or DNS over IPv6 is improperly configured, be it by the user or more probably the ISP. At that point the problem I discussed above with @clue kicks in. ReactPHP doesn't try a second DNS server if the first doesn't work (while the OS does and people don't notice their IPv6 DNS config is borked). Just my wild guess after doing some testing on this.. |
TLDR: Send a couple of sponsors my way (https://github.com/sponsors/clue) and I'm happy to solve this. 💸 This requires a feature addition in @reactphp which Expose builds on top of. Expose does not need any changes once this is built into @reactphp. Here's a recap of what's going on:
Here's what needs to be implemented in @reactphp to make sure this error no longer shows up even when people have invalid nameserver entries:
As you can see, this is a non-trivial amount of work. I've layed out this plan to show this is very much actionable and could be solved in a couple of days. As much as I'd love to work on this, I won't be able to commit to this right now: I'm rather busy working on a bunch of others projects at the moment. Perhaps we can find a couple of new GitHub sponsors to allow me spending some time on this? Put your money where your mouth is? 💸 |
@clue BTW I had the same problem in PHPStan Pro and I solved it by hardcoding the DNS server to 1.1.1.1 for everyone. Can you think of any downside with this approach? Do you think that someone can have this server blocked by their corporate firewall or something? |
@ondrejmirtes Yes, this can be problematic. Hard-coding a public DNS server as the primary DNS server might be an option for some use cases (which is why this is indeed supported by @reactphp). This was briefly discussed in #25 (comment):
As per #25 (comment), some public DNS servers are also blocked in some more restrictive legislations (think country-wide blocks / firewalls implemented at the DNS level). From a developer's perspective, I think this could perhaps be the more important reason why DNS fallback servers should be supported in ReactPHP itself:
|
@clue I see, it's funny how me and @mpociot had the same train of thought - I planned that if it turned out that I'm kind of used to that people's systems are broken in all kinds of ways, so it's better not to rely on it. For example in one instance the client crashed because the user had some non-sense in the But I'll trust you on this one :) |
@clue Do we have issues for all of this on the respected @reactphp repositories for tracking? P.S. I'd be happy to pick those up, but it's not super high on my own priority list, like @clue says a one or more sponsors can help with that. |
I got the following error as others
Then looking through the above i did the following as others recommended @chiribuc thanks edit my
to
and all run ok. |
Using |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
while running
expose share
this the error i am getting
Could not connect to the server.
Connection to sharedwithexpose.com:443 failed during DNS lookup: DNS error
The text was updated successfully, but these errors were encountered: