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

Software caused connection abort #421

Closed
Goolpe opened this issue Sep 24, 2019 · 10 comments
Closed

Software caused connection abort #421

Goolpe opened this issue Sep 24, 2019 · 10 comments
Labels
🐛 bug Something isn't working

Comments

@Goolpe
Copy link

Goolpe commented Sep 24, 2019

I need to upload logs, for example every 1 minute, if i have the internet everything is fine, but if i lose connection, i get this error:
Снимок экрана 2019-09-24 в 8 39 29
try...catch, catchError don't catch error and app just stops.

Code example:

Future<void> _uploadLogs() async{
  try{
    final QueryResult result = await GraphQLProvider.of(context).value.mutate(
      MutationOptions(
        document: document,
        variables: <String, List<dynamic>>{
          'input': logs
        }
      ));
    if(result.hasErrors){
      throw result.errors;
    }
    if(result.data != null){
      print(result.data);
    }
  }
  catch(error){
    print(error);
  }
}

Doctor -v:

[✓] Flutter (Channel dev, v1.10.5, on Mac OS X 10.14.6 18G95, locale ru-RU)
    • Flutter version 1.10.5 at /Users/ads/Library/flutter
    • Framework revision 3cf88fed6d (5 days ago), 2019-09-18 23:09:41 -0400
    • Engine revision 33ad6757e8
    • Dart version 2.6.0 (build 2.6.0-dev.0.0 cb80ea7ba9)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/ads/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /Users/ads/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
    • All Android licenses accepted.

 
[✓] Xcode - develop for iOS and macOS (Xcode 10.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.2.1, Build version 10E1001
    • CocoaPods version 1.6.1

[✓] Android Studio (version 3.4)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 37.1.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[✓] VS Code (version 1.38.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.4.1

[✓] Connected device (1 available)
    • ZTE BLADE A0622 • 320376181424 • android-arm • Android 7.1.1 (API 25)
@mainawycliffe
Copy link
Collaborator

Can you try the beta version, I think this PR on reconnecting to a WebSocket when offline might have solved your issue.

If that's the case, the other option is to monitor connection state and maintain a queue for mutations, once the user is online, the perform the mutations. This is tracked by this issue here.

@Goolpe
Copy link
Author

Goolpe commented Sep 30, 2019

@mainawycliffe i'm using graphql_flutter: ^2.1.1-beta.2

@mainawycliffe
Copy link
Collaborator

@Goolpe I see, I will look into this, probably error handling in this section needs improvement.

@micimize you were working on improving error handling on your last PR, have you fixed this or can I take a look at it.

@mainawycliffe mainawycliffe added the 🐛 bug Something isn't working label Oct 2, 2019
@micimize
Copy link
Collaborator

micimize commented Oct 2, 2019

right - #393 will likely solve this issue

@mainawycliffe
Copy link
Collaborator

@Goolpe does the issue still exist on the current beta?

@Goolpe
Copy link
Author

Goolpe commented Nov 6, 2019

I'm trying to reproduce error now, i think that issue is gone, thank you

@micimize micimize closed this as completed Nov 6, 2019
@GeylanKalafMohe
Copy link

I still see this error in Firebase Crashlytics

OperationException Software caused connection abort StackTrace: #0 IOClient.send (package:http/src/io_client.dart:90) <asynchronous suspension> #1 HttpLink._executeRequest (package:gql_http_link/src/link.dart:131) <asynchronous suspension> #2 HttpLink.request (package:gql_http_link/src/link.dart:76) <asynchronous suspension> #3 Stream.first.<anonymous closure> (dart:async/stream.dart:1586) <asynchronous suspension> }

@JaspreetDev
Copy link

@GeylanKalafMohe were you able to find a solution?

@GeylanKalafMohe
Copy link

@JaspreetDev Nope. This issue should be opened again.

@utkuvrs
Copy link

utkuvrs commented Nov 20, 2024

DioException [unknown]: null Error: HttpException: Software caused connection abort, uri

while trying to hot-restart app, I've got this exception but from Dio package version 5.4.1

I hope it helps.

Edit:

[√] Flutter (Channel stable, 3.24.3, on Microsoft Windows [Version 10.0.22631.4460], locale en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.10.1)
[!] Android Studio (not installed)
[√] VS Code (version 1.95.3)
[√] Connected device (4 available)
[√] Network resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants