-
Notifications
You must be signed in to change notification settings - Fork 1.7k
SocketException: Failed host lookup #53331
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
Comments
Possible reason: flutter/flutter#132912 (comment) |
The behavior changed between 3.10.x (3.10.5 precisely) and 3.13.0 without an announcement about breaking changes so it shouldn't be a migration on the developer side to fix it. Especially since you can't change the configuration of certain servers when you don't have control over them. I've found this comment which details in a more precise way the problem: issue #4695 |
This seems related to #53334 |
@NeroThroN are you seeing this only on Windows? |
@NeroThroN do you observe this exception only when running under the debugger or do you see it even on a regular run outside the debugger ? |
Yes indeed, I think it is indeed related
Based on my scenarios, I have the issue in multiple scenarios: (Development OS > Target Device => result)
I only had the problem while in debug mode. Without debugger mode or even in release mode, the application works fine. |
I have same issue on window + android studio in debug. Running Android 13 at emulator. |
I can repro this issue with
The exception is thrown and the debugger stops when making an https (secure) request to a IPv4-only internet (public) host, not supporting IPv6. The debugger does not stop (meaning the exception is not thrown?) when making an http request to an IPv4-only LAN (not internet) host. I understand that the dart:io code tries IPv4 connections first, based on this reply from Brian Quinlan @brianquinlan :
(I am assuming that the http package has identical behavior (on Android and iOS)). Because of this, it is a bit surprising that the debugger stops when dealing with IPv4-only internet addresses. |
Based on this I am marking this as a duplicate of #53334 |
any solution yet? |
@cetindogu this issue is closed, if you are encountering an issue please open a new issue with instructions on how to reproduce the problem you are encountering. |
i have faced this problem in all my projects for a long time, which work with the API. I can't uncheck "all exceptions" because I need to see app exceptions inside try catch |
@astheras a fix for the above problem was landed a while back which problem are you still facing ? |
I am still facing the same issue, flutter version : 3.10.6. It is not easy to reproduce, but the way I was able to do it was, by minimizing the application for a while, re-opening it, and trying to perform any 'http calls' inside of the app for some time. I am using Dio Package, and whenever this problem occurs, my interceptors are not getting hit and all HTTP calls automatically get 401 without going into the interceptors where I inject the auth token. it only works again If I stop the app and restart it. |
I think I am seeing an issue related to this. I have a Global external application load balancer exposing a HTTP ip v4 url. My Flutter app connects to this using NetworkImage to load images. This is working well for most users most of the time. I have some users somehow getting into a state where all images stop loading. These are very small images (~10KB) which cannot be loaded on a very fast cell signal. When the user switches over to WIFI the images start loading again. |
I have users too who got failed lookup |
I recently encountered an error like this where the problem was with the server's digital certificate. The certificate I was using appeared as ok in the browser but the app wouldn't connect. I renewed the server's certificate and the app started connecting again. I only realized this because the error started appearing after the server's certificate was changed. |
Thanks, I always forget I need to uncheck "All Exceptions" when running the tests. |
Copied from flutter issue #132912
Steps to reproduce
Just make a network request.
For example, using the basic http package.
Also relevant when using other packages, such as Dio.
The same error, and in the same versions of Flutter.
Therefore, I think they have the same root.
The bug is very critical, as already many communities of various applications complain about it.
I have given the simplest code example below.
The main essence is in the line:
This request throws an exception:
SocketException (SocketException: Failed host lookup: 'flutter.dev' (OS Error: ... , errno = 11004))
This error appears on ANY host of the many that I have tried.
That is, the problem is not in a particular host.
This problem is relevant for Windows (which discards many other similar problems that can be found on the Internet and which are associated with missing permissions on the Android system). It's not that problem.
I've reproduced this bug in the latest master as well as in the latest stable release.
On the Internet people advise to downgrade Flutter to version 3.10.5, where this problem does not reproduce. I personally haven't tried it yet, but I suspect that all versions after 3.10.5 have this bug.
But downgrading to that version is not an option for me anyway.
Please fix this bug as soon as possible.
Yes, this exception is skippable, but it creates debugging inconvenience in many cases.
Moreover, this problem is relevant for many.
Thank you!
Expected results
No exception
Actual results
This request throws an exception:
SocketException (SocketException: Failed host lookup: 'flutter.dev' (OS Error: ... , errno = 11004))
Code sample
Code sample
Screenshots or Video
No response
Logs
No response
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: