Open escamoteur opened 7 months ago
Seems client doesnt have authorization from the server, since 400 usually returned authentication related errors. Can u make sure that u have appropriate access to the server (for ex: Authorization header)
Also, what URL are you loading?
we see it on our normal backend URL watchcrunch.com which is routed via CF. and its no authorization issue because that returns a clear 401 or 403. The current error message is clearly not very helpful
I believe dart would give enough information when a http calls fails, but here the reason u are not getting enough information is flutter_svg
is not handling errors properly ( i took a glance at the implementation). Well i will get deeper in the dart http error handling and flutter_svg error handling.
But Sentry does not receive more information in the underlying exception which means Dart does not forward any additional information Am 1. Feb. 2024, 16:29 +0100 schrieb Aravind @.***>:
I believe dart would give enough information when a http calls fails, but here the reason u are not getting enough information is flutter_svg is not handling errors properly ( i took a glance at the implementation). Well i will get deeper in the dart http error handling and flutter_svg error handling. β Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
@escamoteur I'm not sure how to diagnose this. The title of the bug is "OS Error: No address associated with hostname, errno = 7" but I can't see that error anywhere in the text of your issue. Are you seeing more 400 responses in the logs of your servers? Because the "OS Error..." suggests that you can't connect to the server at all.
I see different 400s regularly. I think in reality these are connection problems but then I would expect that in an exception and not a message about no adress associated with hostname Am 1. Feb. 2024, 19:11 +0100 schrieb Brian Quinlan @.***>:
@escamoteur I'm not sure how to diagnose this. The title of the bug is "OS Error: No address associated with hostname, errno = 7" but I can't see that error anywhere in the text of your issue. Are you seeing more 400 responses in the logs of your servers? Because the "OS Error..." suggests that you can't connect to the server at all. β Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
Seems flutter has different implementation of http than dart's http, because dart's http dint throw error when it receives a 400
status code but flutter's http impl is throwing, still looking for the flutter's http implementation
Edit: The above statement is wrong, both flutter and dart using same HTTP Client Implementation which is from dart
Hey @escamoteur, i cant reproduce the issue since Flutter Svg throw different error when it receives 400
HttpException (HttpException: Could not get network asset, uri = http://example.com/)
I believe OS err no = 7
could be returned when the app (in emulator) fails to resolve your local IP, do u got these while u are running ur app in emulator and having your svgs in ur backend which is running locally in ur machine?
Nope, we get that from Sentry from released versions from our customers
So it doesnt seem ur server is returning 400 status code, actually request is not reached ur server so considering that can i know whther these requests being logged in ur server? And also can i know whether ur server is easily reachable? The reason for the whole question the app cant initiate the request to ur server.
Common reasons could be ur client cant resolve ur address, could be ur server url may broken?
Nope, that's definitely not the case. IMHO it happens while the app is going into the background or early when resuming or when not network connection exists in all that cases the server isn't reached but the error doesn't say the real reason.
To be clear you are seeing 400 number of errors reported in ur sentry and i confused that 400 is a status code of the response actually π (i believe @brianquinlan also thought the same), and @escamoteur i think this is the standard error which is been similar across multiple languages, i believe no language would explicitly say "there is no internet connected" while it try to connect to some network. π€· And we can just assume these type of errors mostly throwed due to "no internet connection".
U may check first is the device is connected to internet, by this https://stackoverflow.com/a/49648870/16690329 π€· but seems it was very unusual, or u might filter these types of error to being sent to sentry and can save ur sentry limit
I get this error from time to time as well, both in production and on local emulator. But after upgrade to latest Flutter the (Android) app stopped working (in debug, on emulator) and just reported this issue to Sentry like crazy, 100 events per minute or more.
I ran flutter downgrade
and reverted some dependency upgrades and now I only get the error now and then, like before. This is what I'm using now.
Doctor summary (to see all details, run flutter doctor -v):
[β] Flutter (Channel stable, 3.13.2, on Pop!_OS 22.04 LTS 6.6.10-76060610-generic, locale en_US.UTF-8)
[β] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc1)
[β] Chrome - develop for the web
[β] Linux toolchain - develop for Linux desktop
[β] Android Studio (version 2022.2)
[β] VS Code (version 1.87.2)
[β] Connected device (3 available)
[β] Network resources
β’ No issues found!
One thing I noted in Sentry was that the Dart runtime was reported as 3.1.0 even when I used Flutter SDK 3.3.0. I don't know what that means.
3.1.0 (stable) (Tue Aug 15 21:33:36 2023 +0000) on \"android_arm\
Anyway, next step will be to upgrade dependencies and test again. If it works, I will update Flutter again and see if the error comes back.
@tengl , i suspect this error is happening because of user is accessing some resource (which might be svg) from internet but user may offline and obviously it would throw error, and these errors been stored locally by sentry and being transmitted to sentry console once internet is available.
Can u try to reproduce and check whether this is the problem?
@tengl , i suspect this error is happening because of user is accessing some resource (which might be svg) from internet but user may offline and obviously it would throw error, and these errors been stored locally by sentry and being transmitted to sentry console once internet is available.
Can u try to reproduce and check whether this is the problem?
Sure, I'm accessing our APIs with http.get
etc. Sentry caches errors and sends them when network is available. I've downgraded to Flutter 3.13.2, it worked on a real device. And then updated to 3.19.4 again and it still seems to work. I will update dependencies again and check if it still works.
I will also test the emulator again, it shouldn't have had any connection issues because I didn't have any issues on my dev machine, but you never know.
@tengl sorry, can i know what meant "works" u are saying.
@tengl sorry, can i know what meant "works" u are saying.
With works I mean that the previous error (errno=7) hasn't appeared again, at least not in the frequency I saw before. I guess it must have entered some error state somehow and wasn't able to get out of it. I still get the error when I enable all exceptions, but it doesn't report to Sentry anymore. I think I get it on every request, but the call stack doesn't reveal any useful information. And the requests seems to go through to the API and back, I don't see any issues in the app anymore.
I'll get back to you if I find out more details about when it occurs.
To be clear you are seeing 400 number of errors reported in ur sentry and i confused that 400 is a status code of the response actually π (i believe @brianquinlan also thought the same), and @escamoteur i think this is the standard error which is been similar across multiple languages, i believe no language would explicitly say "there is no internet connected" while it try to connect to some network. π€· And we can just assume these type of errors mostly throwed due to "no internet connection".
actually it is a 400 status code which is the default client error. the DNS reference on the error message just doesn't make any sense as our domain is clearly reachable. Still thinking that the reported error is wrong. Have you checked where the error message OS Error: No address associated with hostname, errno = 7
is coming from?
OK, I got it this time with the excact location where it happens
the app is running on an Android emulator on a PC with LAN connection.
I can ping this address just fine
When I try the same host in chrome on the emulator I get an Xml response that clearly shows the address can be resolved, so why do I keep getting theses exceptions?
Because of these exceptions it's impossible to leave break on all exceptions
active which makes debugging really annoying.
@lrhn this seems indeed like a bug
I forgot to add , this is absolutely reproducible
Our current Flutter version is
Flutter (Channel stable, 3.19.3, on Microsoft Windows [Version 10.0.19045.4291], locale de-DE)
Interesting, while running the app on Windows I got a little different error that might give a hint to the underlying cause
From what I found this might happen if there is a DNS entry but not the expected DNS record is there.
The Domain we use has an A and AAAA record. Does the current Dart implementation require any other record types?
@brianquinlan maybe this would be better on the HTTP repository? We still get a lot of these even after switching to connet
The fact that this makes it impossible to use the break on all exceptions
makes this bug really annoying @kevmoo could you please look into this?
@escamoteur βΒ what kind of fix are you looking for?
I have no idea why te socket implementation throws at at all an exception because the DNS totally valid. I mean it's legit to use an exception for some control flow but it clashes with the option to "break on all exceptions" so as soon as our app does any network calls I cannot enable "break on all exceptions" which is pretty annoying when you try to pinpoint some async exception. So either socket_patch should not throw at all or this part of the SDK should be excluded from the break on all exceptions Am 8. Aug. 2024, 22:18 +0100 schrieb Kevin Moore @.***>:
@escamoteur β what kind of fix are you looking for? β Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
We see an increasing number of 400 client errors connected with DNS resolution in out Flutter app. Here an example:
unfortunately this type of exception doesn't contain any useful information what the underlying reason for that problem is. it would be good if we could get more information if there is no network connection or what could be the problem.
Wie are on latest Flutter verison