Skip to content
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

Error: SocketException: Connection timed out (OS Error: Connection timed out, errno = 110), address = app.myadress, port = 38887 #135495

Closed
eokdev opened this issue Sep 26, 2023 · 10 comments
Labels
in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds

Comments

@eokdev
Copy link

eokdev commented Sep 26, 2023

This project was working fine some weeks ago. but today it started throwing this error - Error: SocketException: Connection timed out (OS Error: Connection timed out, errno = 110), address = app.myadress, port = 38887

Working fine on emulators
I switched from http to use Dio still getting same error.
Its a hosted api.

Please help!!!

Flutter Doctor
`[✓] Flutter (Channel stable, 3.13.6-0.0.pre.2, on Ubuntu 20.04.6 LTS 5.15.0-84-generic, locale en_US.UTF-8)
• Flutter version 3.13.6-0.0.pre.2 on channel stable at /home/olorunshola/snap/flutter/common/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision df40655632 (2 days ago), 2023-09-24 08:24:28 +0100
• Engine revision bd986c5ed2
• Dart version 3.1.2
• DevTools version 2.25.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at /home/olorunshola/Android/Sdk
• Platform android-33, build-tools 33.0.0
• ANDROID_HOME = /home/olorunshola/Android/Sdk
• ANDROID_SDK_ROOT = /home/olorunshola/Android/Sdk
• Java binary at: /snap/android-studio/127/android-studio/jbr/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
• All Android licenses accepted.

[✓] Chrome - develop for the web
• Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
• clang version 10.0.0-4ubuntu1
• cmake version 3.16.3
• ninja version 1.10.0
• pkg-config version 0.29.1

[✓] Android Studio (version 2022.3)
• Android Studio at /snap/android-studio/127/android-studio
• Flutter plugin version 75.1.2
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.76.2)
• VS Code at /usr/share/code
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (3 available)
• SM G532F (mobile) • 4200a999d38f94cb • android-arm • Android 6.0.1 (API 23)
• Linux (desktop) • linux • linux-x64 • Ubuntu 20.04.6 LTS 5.15.0-84-generic
• Chrome (web) • chrome • web-javascript • Google Chrome 111.0.5563.110

[✓] Network resources
• All expected network resources are available.

• No issues found!`

@dam-ease dam-ease added the in triage Presently being triaged by the triage team label Sep 26, 2023
@mahirozdin
Copy link

same here

   try {
        result = await wf.currentWeatherByLocation(position.latitude, position.longitude);
      } on SocketException catch (_) {
        
      }

Not able to catch the exception. And when I click forwards from debugger It works and makes the http request successfully!

Internet connection is live and permission is requested

@dam-ease
Copy link

Hi @eokdev. Thanks for filing this. Initially this seemed to me to be related to the http package and I see there is a similar issue being tracked here dart-lang/http#831 but seeing from original comment that this occurs with Dio as well. Can you please provide more information on this, more specifically,

Thank you!

@dam-ease dam-ease added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 26, 2023
@mahirozdin
Copy link

mahirozdin commented Sep 26, 2023

@dam-ease
This issue is occurs on http package and dio package aswell. And Im also following given issues but on those issues people stongly believe issue is related to flutter. I also strongly believe thats related to dart:io-patch

Here is a http request for github

import 'package:http/http.dart' as http;
void main() async {
 

  var url = Uri.https('github.com', '/');
  var response = await http.get(url);
  print('Response status: ${response.statusCode}');

}

Here is Call Stack

_NativeSocket.lookup.<anonymous closure> (dart:io-patch/socket_patch.dart:520)
<asynchronous gap> (Unknown Source:0)
_NativeSocket.staggeredLookup.<anonymous closure>.lookupAddresses.<anonymous closure> (dart:io-patch/socket_patch.dart:0)
<asynchronous gap> (Unknown Source:0)

@eokdev
Copy link
Author

eokdev commented Sep 26, 2023

Hi @eokdev. Thanks for filing this. Initially this seemed to me to be related to the http package and I see there is a similar issue being tracked here dart-lang/http#831 but seeing from original comment that this occurs with Dio as well. Can you please provide more information on this, more specifically,

* Can you share a [minimal complete reproducible code sample](https://stackoverflow.com/help/minimal-reproducible-example) that doesn’t include 3rd party plugins or complex production code (a single main.dart file)?

* Also, does this only occur on Android? I can see a similar issue currently open here [Udp packet sending generates error when display is turned off on Android devices #115921](https://github.com/flutter/flutter/issues/115921)

Thank you!

Yes it occurs on android.

This is my main.dart file

`void main() async {
WidgetsFlutterBinding.ensureInitialized();
await ScreenUtil.ensureScreenSize();

await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);

runApp(
const ProviderScope(
child: MyApp(),
),
);
}`

but i dont think it has any link to the issue i am having. What do you think?

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 26, 2023
@dam-ease
Copy link

Thanks for your responses @eokdev and @mahirozdin.
I ran the sample provided here and I get a 200 both on Android and iOS. When I turned off the Android device display as well, I got a 200. From the information provided, this seems similar/related to #115921. Can you please check it out?

@dam-ease dam-ease added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 27, 2023
@mahirozdin
Copy link

@dam-ease hey thanks for the tests. Promlem is still occurs even the display is on. And after clicking the continiue button on debugger I can see that data has came already. So data is coming but exception isthrown there is some kind of problem. I wasnt able to solve the issue. When I made a call for google.com there is no problem at all. but for github.com it occurs.

@eokdev
Copy link
Author

eokdev commented Sep 28, 2023

@dam-ease the error i am facing seems like a network error cuz when i downgrade to a 3g network it works and I do not have the timeout issue. But when I am on 4g network the error happen most times. Using VPN too worked...

Seems like the way the administrator configured the domain or something. Do you have a heads up on this?

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 28, 2023
@dam-ease
Copy link

Thanks for your responses. @eokdev. Can you test with the sample #135495 (comment) to see if this varies with network as well, I still can't reproduce at all on my end.

@dam-ease dam-ease added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 29, 2023
@github-actions
Copy link

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
Thanks for your contribution.

Copy link

github-actions bot commented Nov 3, 2023

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds
Projects
None yet
Development

No branches or pull requests

3 participants