aws-amplify / amplify-flutter

A declarative library with an easy-to-use interface for building Flutter applications on AWS.
https://docs.amplify.aws
Apache License 2.0
1.32k stars 248 forks source link

AmplifyStorageS3 Time Out - ClientException: Connection closed before full header was received #1123

Closed Lorenzohidalgo closed 1 year ago

Lorenzohidalgo commented 2 years ago

Describe the bug Some S3 Downloads will error out with ClientException: Connection closed before full header was received.

I'm retrieving the url like:

    final Duration expiration = const Duration(days: 7);
    final GetUrlOptions options = GetUrlOptions(expires: expiration.inSeconds); //Expirations due to url cacheing
    url = (await Amplify.Storage.getUrl(key: imageKey, options: options)).url;

I'm displaying/downloading the images from S3 with:

                CachedNetworkImage(
                    imageUrl: url,
                    fit: BoxFit.cover,
                    progressIndicatorBuilder:
                        (context, url, downloadProgress) =>
                            CircularProgressIndicator(
                      value: downloadProgress.progress,
                      backgroundColor: PrimaryColors.Blue1,
                    ),
                    errorWidget: (context, url, error) {
                      // Handle errors and default error Widget
                    },
                  )

I found a similar unsolved issue for NetworkImage class but I'm not able to reproduce/figure out if this is a Flutter or AmplifyStorageS3 issue, but @dnys1 recommended me to open this for further investigation.

Maybe it has something to do with concurrent downloads since the users are downloading and caching multiple images at once or with low/bad internet connection.

To Reproduce Steps to reproduce the behavior:

  1. Upload images to S3
  2. Download/Cache multiple images with a CachedNetworkImage widget
  3. Repeat until the error appears

Expected behavior Download should succeed / dev should be able to modify the timeouts

Screenshots If applicable, add screenshots to help explain your problem.

Platform Amplify Flutter current supports iOS and Android. This issue is reproducible in (check all that apply): [X] Android [X] iOS

Output of flutter doctor -v ``` [√] Flutter (Channel stable, 2.5.3, on Microsoft Windows [Versión 10.0.19043.1348], locale es-ES) • Flutter version 2.5.3 at C:\DEVELOPMENT\SRC\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 18116933e7 (5 weeks ago), 2021-10-15 10:46:35 -0700 • Engine revision d3ea636dc5 • Dart version 2.14.4 [√] Android toolchain - develop for Android devices (Android SDK version 31.0.0) • Android SDK at C:\Users\Lorenzo HG\AppData\Local\Android\sdk • Platform android-31, build-tools 31.0.0 • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) • All Android licenses accepted. [√] Chrome - develop for the web • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe [√] Android Studio (version 4.1) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01) [√] VS Code, 64-bit edition (version 1.62.2) • VS Code at C:\Program Files\Microsoft VS Code • Flutter extension version 3.28.0 [√] Connected device (3 available) • ONEPLUS A5010 (mobile) • 9070076c • android-arm64 • Android 10 (API 29) • Chrome (web) • chrome • web-javascript • Google Chrome 96.0.4664.45 • Edge (web) • edge • web-javascript • Microsoft Edge 95.0.1020.30 • No issues found! ```
Dependencies (pubspec.lock) ``` # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: amplify_analytics_pinpoint: dependency: "direct main" description: name: amplify_analytics_pinpoint url: "https://pub.dartlang.org" source: hosted version: "0.2.8" amplify_analytics_plugin_interface: dependency: transitive description: name: amplify_analytics_plugin_interface url: "https://pub.dartlang.org" source: hosted version: "0.2.8" amplify_api: dependency: "direct main" description: name: amplify_api url: "https://pub.dartlang.org" source: hosted version: "0.2.8" amplify_api_plugin_interface: dependency: transitive description: name: amplify_api_plugin_interface url: "https://pub.dartlang.org" source: hosted version: "0.2.8" amplify_auth_cognito: dependency: "direct main" description: name: amplify_auth_cognito url: "https://pub.dartlang.org" source: hosted version: "0.2.8" amplify_auth_plugin_interface: dependency: transitive description: name: amplify_auth_plugin_interface url: "https://pub.dartlang.org" source: hosted version: "0.2.8" amplify_core: dependency: transitive description: name: amplify_core url: "https://pub.dartlang.org" source: hosted version: "0.2.8" amplify_datastore: dependency: "direct main" description: name: amplify_datastore url: "https://pub.dartlang.org" source: hosted version: "0.2.8" amplify_datastore_plugin_interface: dependency: transitive description: name: amplify_datastore_plugin_interface url: "https://pub.dartlang.org" source: hosted version: "0.2.8" amplify_flutter: dependency: "direct main" description: name: amplify_flutter url: "https://pub.dartlang.org" source: hosted version: "0.2.8" amplify_storage_plugin_interface: dependency: transitive description: name: amplify_storage_plugin_interface url: "https://pub.dartlang.org" source: hosted version: "0.2.8" amplify_storage_s3: dependency: "direct main" description: name: amplify_storage_s3 url: "https://pub.dartlang.org" source: hosted version: "0.2.8" args: dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted version: "2.3.0" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted version: "2.8.1" bloc: dependency: transitive description: name: bloc url: "https://pub.dartlang.org" source: hosted version: "7.2.1" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted version: "2.1.0" build_config: dependency: transitive description: name: build_config url: "https://pub.dartlang.org" source: hosted version: "1.0.0" cached_network_image: dependency: "direct main" description: name: cached_network_image url: "https://pub.dartlang.org" source: hosted version: "3.1.0+1" cached_network_image_platform_interface: dependency: transitive description: name: cached_network_image_platform_interface url: "https://pub.dartlang.org" source: hosted version: "1.0.0" cached_network_image_web: dependency: transitive description: name: cached_network_image_web url: "https://pub.dartlang.org" source: hosted version: "1.0.1" carousel_slider: dependency: "direct main" description: name: carousel_slider url: "https://pub.dartlang.org" source: hosted version: "4.0.0" characters: dependency: transitive description: name: characters url: "https://pub.dartlang.org" source: hosted version: "1.1.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted version: "1.3.1" checked_yaml: dependency: transitive description: name: checked_yaml url: "https://pub.dartlang.org" source: hosted version: "2.0.1" clock: dependency: transitive description: name: clock url: "https://pub.dartlang.org" source: hosted version: "1.1.0" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted version: "1.15.0" cross_file: dependency: transitive description: name: cross_file url: "https://pub.dartlang.org" source: hosted version: "0.3.2" crypto: dependency: transitive description: name: crypto url: "https://pub.dartlang.org" source: hosted version: "3.0.1" csslib: dependency: transitive description: name: csslib url: "https://pub.dartlang.org" source: hosted version: "0.17.1" date_time_format: dependency: transitive description: name: date_time_format url: "https://pub.dartlang.org" source: hosted version: "2.0.1" date_util: dependency: "direct main" description: name: date_util url: "https://pub.dartlang.org" source: hosted version: "0.1.4" dbus: dependency: transitive description: name: dbus url: "https://pub.dartlang.org" source: hosted version: "0.5.6" dependency_validator: dependency: "direct dev" description: name: dependency_validator url: "https://pub.dartlang.org" source: hosted version: "3.1.0" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted version: "1.2.0" ffi: dependency: transitive description: name: ffi url: "https://pub.dartlang.org" source: hosted version: "1.1.2" file: dependency: transitive description: name: file url: "https://pub.dartlang.org" source: hosted version: "6.1.2" firebase: dependency: transitive description: name: firebase url: "https://pub.dartlang.org" source: hosted version: "9.0.2" firebase_analytics: dependency: "direct main" description: name: firebase_analytics url: "https://pub.dartlang.org" source: hosted version: "8.3.4" firebase_analytics_platform_interface: dependency: transitive description: name: firebase_analytics_platform_interface url: "https://pub.dartlang.org" source: hosted version: "2.0.1" firebase_analytics_web: dependency: transitive description: name: firebase_analytics_web url: "https://pub.dartlang.org" source: hosted version: "0.3.0+1" firebase_core: dependency: "direct main" description: name: firebase_core url: "https://pub.dartlang.org" source: hosted version: "1.10.0" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface url: "https://pub.dartlang.org" source: hosted version: "4.1.0" firebase_core_web: dependency: transitive description: name: firebase_core_web url: "https://pub.dartlang.org" source: hosted version: "1.2.0" firebase_messaging: dependency: "direct main" description: name: firebase_messaging url: "https://pub.dartlang.org" source: hosted version: "11.1.0" firebase_messaging_platform_interface: dependency: transitive description: name: firebase_messaging_platform_interface url: "https://pub.dartlang.org" source: hosted version: "3.0.9" firebase_messaging_web: dependency: transitive description: name: firebase_messaging_web url: "https://pub.dartlang.org" source: hosted version: "2.1.0" firebase_performance: dependency: "direct main" description: name: firebase_performance url: "https://pub.dartlang.org" source: hosted version: "0.7.1+4" firebase_performance_platform_interface: dependency: transitive description: name: firebase_performance_platform_interface url: "https://pub.dartlang.org" source: hosted version: "0.0.1+7" firebase_performance_web: dependency: transitive description: name: firebase_performance_web url: "https://pub.dartlang.org" source: hosted version: "0.0.2" firebase_remote_config: dependency: "direct main" description: name: firebase_remote_config url: "https://pub.dartlang.org" source: hosted version: "0.11.0+2" firebase_remote_config_platform_interface: dependency: transitive description: name: firebase_remote_config_platform_interface url: "https://pub.dartlang.org" source: hosted version: "0.3.0+7" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" flutter_bloc: dependency: "direct main" description: name: flutter_bloc url: "https://pub.dartlang.org" source: hosted version: "7.3.3" flutter_blurhash: dependency: transitive description: name: flutter_blurhash url: "https://pub.dartlang.org" source: hosted version: "0.6.0" flutter_cache_manager: dependency: transitive description: name: flutter_cache_manager url: "https://pub.dartlang.org" source: hosted version: "3.1.3" flutter_local_notifications: dependency: "direct main" description: name: flutter_local_notifications url: "https://pub.dartlang.org" source: hosted version: "9.1.2" flutter_local_notifications_linux: dependency: transitive description: name: flutter_local_notifications_linux url: "https://pub.dartlang.org" source: hosted version: "0.3.0" flutter_local_notifications_platform_interface: dependency: transitive description: name: flutter_local_notifications_platform_interface url: "https://pub.dartlang.org" source: hosted version: "5.0.0" flutter_localizations: dependency: "direct main" description: flutter source: sdk version: "0.0.0" flutter_markdown: dependency: "direct main" description: name: flutter_markdown url: "https://pub.dartlang.org" source: hosted version: "0.6.8" flutter_plugin_android_lifecycle: dependency: transitive description: name: flutter_plugin_android_lifecycle url: "https://pub.dartlang.org" source: hosted version: "2.0.4" flutter_speed_dial: dependency: "direct main" description: name: flutter_speed_dial url: "https://pub.dartlang.org" source: hosted version: "4.6.6" flutter_svg: dependency: "direct main" description: name: flutter_svg url: "https://pub.dartlang.org" source: hosted version: "0.23.0+1" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" flutter_web_plugins: dependency: transitive description: flutter source: sdk version: "0.0.0" getwidget: dependency: "direct main" description: name: getwidget url: "https://pub.dartlang.org" source: hosted version: "2.0.4" glob: dependency: transitive description: name: glob url: "https://pub.dartlang.org" source: hosted version: "2.0.2" graphs: dependency: transitive description: name: graphs url: "https://pub.dartlang.org" source: hosted version: "2.1.0" html: dependency: transitive description: name: html url: "https://pub.dartlang.org" source: hosted version: "0.15.0" http: dependency: transitive description: name: http url: "https://pub.dartlang.org" source: hosted version: "0.13.4" http_parser: dependency: transitive description: name: http_parser url: "https://pub.dartlang.org" source: hosted version: "4.0.0" image_cropper: dependency: "direct main" description: name: image_cropper url: "https://pub.dartlang.org" source: hosted version: "1.4.1" image_picker: dependency: "direct main" description: name: image_picker url: "https://pub.dartlang.org" source: hosted version: "0.8.4+4" image_picker_for_web: dependency: transitive description: name: image_picker_for_web url: "https://pub.dartlang.org" source: hosted version: "2.1.4" image_picker_platform_interface: dependency: transitive description: name: image_picker_platform_interface url: "https://pub.dartlang.org" source: hosted version: "2.4.1" import_sorter: dependency: "direct dev" description: name: import_sorter url: "https://pub.dartlang.org" source: hosted version: "4.6.0" intl: dependency: "direct main" description: name: intl url: "https://pub.dartlang.org" source: hosted version: "0.17.0" io: dependency: transitive description: name: io url: "https://pub.dartlang.org" source: hosted version: "1.0.3" jiffy: dependency: "direct main" description: name: jiffy url: "https://pub.dartlang.org" source: hosted version: "4.1.0" js: dependency: transitive description: name: js url: "https://pub.dartlang.org" source: hosted version: "0.6.3" json_annotation: dependency: transitive description: name: json_annotation url: "https://pub.dartlang.org" source: hosted version: "4.3.0" local_auth: dependency: "direct main" description: name: local_auth url: "https://pub.dartlang.org" source: hosted version: "1.1.8" logging: dependency: transitive description: name: logging url: "https://pub.dartlang.org" source: hosted version: "1.0.2" mailer: dependency: "direct main" description: name: mailer url: "https://pub.dartlang.org" source: hosted version: "5.0.2" markdown: dependency: transitive description: name: markdown url: "https://pub.dartlang.org" source: hosted version: "4.0.0" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted version: "0.12.10" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted version: "1.7.0" mime: dependency: transitive description: name: mime url: "https://pub.dartlang.org" source: hosted version: "1.0.1" nested: dependency: transitive description: name: nested url: "https://pub.dartlang.org" source: hosted version: "1.0.0" new_version: dependency: "direct main" description: name: new_version url: "https://pub.dartlang.org" source: hosted version: "0.2.3" octo_image: dependency: transitive description: name: octo_image url: "https://pub.dartlang.org" source: hosted version: "1.0.0+1" overlay_support: dependency: "direct main" description: name: overlay_support url: "https://pub.dartlang.org" source: hosted version: "1.2.1" package_config: dependency: transitive description: name: package_config url: "https://pub.dartlang.org" source: hosted version: "2.0.2" package_info: dependency: "direct main" description: name: package_info url: "https://pub.dartlang.org" source: hosted version: "2.0.2" package_info_plus: dependency: transitive description: name: package_info_plus url: "https://pub.dartlang.org" source: hosted version: "1.3.0" package_info_plus_linux: dependency: transitive description: name: package_info_plus_linux url: "https://pub.dartlang.org" source: hosted version: "1.0.3" package_info_plus_macos: dependency: transitive description: name: package_info_plus_macos url: "https://pub.dartlang.org" source: hosted version: "1.3.0" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface url: "https://pub.dartlang.org" source: hosted version: "1.0.2" package_info_plus_web: dependency: transitive description: name: package_info_plus_web url: "https://pub.dartlang.org" source: hosted version: "1.0.4" package_info_plus_windows: dependency: transitive description: name: package_info_plus_windows url: "https://pub.dartlang.org" source: hosted version: "1.0.4" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted version: "1.8.0" path_drawing: dependency: transitive description: name: path_drawing url: "https://pub.dartlang.org" source: hosted version: "0.5.1+1" path_parsing: dependency: transitive description: name: path_parsing url: "https://pub.dartlang.org" source: hosted version: "0.2.1" path_provider: dependency: "direct main" description: name: path_provider url: "https://pub.dartlang.org" source: hosted version: "2.0.7" path_provider_android: dependency: transitive description: name: path_provider_android url: "https://pub.dartlang.org" source: hosted version: "2.0.7" path_provider_ios: dependency: transitive description: name: path_provider_ios url: "https://pub.dartlang.org" source: hosted version: "2.0.7" path_provider_linux: dependency: transitive description: name: path_provider_linux url: "https://pub.dartlang.org" source: hosted version: "2.1.2" path_provider_macos: dependency: transitive description: name: path_provider_macos url: "https://pub.dartlang.org" source: hosted version: "2.0.3" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface url: "https://pub.dartlang.org" source: hosted version: "2.0.1" path_provider_windows: dependency: transitive description: name: path_provider_windows url: "https://pub.dartlang.org" source: hosted version: "2.0.4" pedantic: dependency: transitive description: name: pedantic url: "https://pub.dartlang.org" source: hosted version: "1.11.1" percent_indicator: dependency: "direct main" description: name: percent_indicator url: "https://pub.dartlang.org" source: hosted version: "3.4.0" petitparser: dependency: transitive description: name: petitparser url: "https://pub.dartlang.org" source: hosted version: "4.4.0" platform: dependency: transitive description: name: platform url: "https://pub.dartlang.org" source: hosted version: "3.0.2" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface url: "https://pub.dartlang.org" source: hosted version: "2.0.2" process: dependency: transitive description: name: process url: "https://pub.dartlang.org" source: hosted version: "4.2.4" provider: dependency: transitive description: name: provider url: "https://pub.dartlang.org" source: hosted version: "6.0.1" pub_semver: dependency: transitive description: name: pub_semver url: "https://pub.dartlang.org" source: hosted version: "2.1.0" pubspec_parse: dependency: transitive description: name: pubspec_parse url: "https://pub.dartlang.org" source: hosted version: "1.1.0" rive: dependency: "direct main" description: name: rive url: "https://pub.dartlang.org" source: hosted version: "0.7.33" rxdart: dependency: transitive description: name: rxdart url: "https://pub.dartlang.org" source: hosted version: "0.27.2" sentry: dependency: transitive description: name: sentry url: "https://pub.dartlang.org" source: hosted version: "6.1.2" sentry_flutter: dependency: "direct main" description: name: sentry_flutter url: "https://pub.dartlang.org" source: hosted version: "6.1.2" shared_preferences: dependency: "direct main" description: name: shared_preferences url: "https://pub.dartlang.org" source: hosted version: "2.0.8" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux url: "https://pub.dartlang.org" source: hosted version: "2.0.3" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos url: "https://pub.dartlang.org" source: hosted version: "2.0.2" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface url: "https://pub.dartlang.org" source: hosted version: "2.0.0" shared_preferences_web: dependency: transitive description: name: shared_preferences_web url: "https://pub.dartlang.org" source: hosted version: "2.0.2" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows url: "https://pub.dartlang.org" source: hosted version: "2.0.3" sky_engine: dependency: transitive description: flutter source: sdk version: "0.0.99" source_span: dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted version: "1.8.1" sqflite: dependency: transitive description: name: sqflite url: "https://pub.dartlang.org" source: hosted version: "2.0.0+4" sqflite_common: dependency: transitive description: name: sqflite_common url: "https://pub.dartlang.org" source: hosted version: "2.0.1+1" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted version: "1.1.0" synchronized: dependency: transitive description: name: synchronized url: "https://pub.dartlang.org" source: hosted version: "3.0.0" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted version: "1.2.0" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted version: "0.4.2" timezone: dependency: transitive description: name: timezone url: "https://pub.dartlang.org" source: hosted version: "0.8.0" tint: dependency: transitive description: name: tint url: "https://pub.dartlang.org" source: hosted version: "2.0.0" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted version: "1.3.0" url_launcher: dependency: "direct main" description: name: url_launcher url: "https://pub.dartlang.org" source: hosted version: "6.0.13" url_launcher_linux: dependency: transitive description: name: url_launcher_linux url: "https://pub.dartlang.org" source: hosted version: "2.0.2" url_launcher_macos: dependency: transitive description: name: url_launcher_macos url: "https://pub.dartlang.org" source: hosted version: "2.0.2" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface url: "https://pub.dartlang.org" source: hosted version: "2.0.4" url_launcher_web: dependency: transitive description: name: url_launcher_web url: "https://pub.dartlang.org" source: hosted version: "2.0.4" url_launcher_windows: dependency: transitive description: name: url_launcher_windows url: "https://pub.dartlang.org" source: hosted version: "2.0.2" uuid: dependency: transitive description: name: uuid url: "https://pub.dartlang.org" source: hosted version: "3.0.5" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted version: "2.1.0" win32: dependency: transitive description: name: win32 url: "https://pub.dartlang.org" source: hosted version: "2.3.0" xdg_directories: dependency: transitive description: name: xdg_directories url: "https://pub.dartlang.org" source: hosted version: "0.2.0" xml: dependency: transitive description: name: xml url: "https://pub.dartlang.org" source: hosted version: "5.3.1" yaml: dependency: transitive description: name: yaml url: "https://pub.dartlang.org" source: hosted version: "3.1.0" sdks: dart: ">=2.14.0 <3.0.0" flutter: ">=2.5.0" ```

Smartphone (please complete the following information):

value | times_seen -- | -- iPhone12 | 8 iPhone11 | 8 iPhone13 | 4 iPhone14 | 4 iPhone12 | 3 SM-A325F | 3 iPhone9 | 3 BBE100-1 | 3 iPhone14 | 2 iPhone13 | 2 SM-A405FN | 2 SM-G975F | 2 SM-G986B | 1 SM-G991B | 1 GM1913 | 1 SM-A415F | 1 SM-G996B | 1 ELE-L29 | 1 iPhone8 | 1 SM-G950F | 1 iPhone12 | 1

value | times_seen -- | -- Android 11 | 12 iOS 15.0.2 | 11 iOS 14.6 | 3 Android 8.1.0 | 3 iOS 14.8.1 | 2 iOS 14.4 | 2 iOS 15.1 | 2 Android 9 | 2 iOS 14.7.1 | 2 iOS 14.8 | 2 iOS 15.0.1 | 1

Additional context Add any other context about the problem here.

latheeshvm commented 2 years ago

Yeah I am also facing the same issue. Even thought the error still showing up in the console extended_image package helps to handling it without messing up the UI

HuiSF commented 2 years ago

Hi @Lorenzohidalgo The exception should be thrown from Flutter package, so it's out of the control of amplify-flutter. I was curious about the cause though, and found this https://stackoverflow.com/a/65642602 I think it's relevant.

Jordan-Nelson commented 2 years ago

@Lorenzohidalgo @latheeshvmv - Did you get a chance to look at the link above shared by @HuiSF?

It would be helpful to have a more specific set of reproduction steps. Are there a very large number of images be rendered in the app at once when this occurs?

latheeshvm commented 2 years ago

@Lorenzohidalgo No, it happens even few number of images. It's totally random, not sure how to replicate it.

Lorenzohidalgo commented 2 years ago

@Jordan-Nelson I've checked and implemented a similar solution. The issue still persists.

I'm not able to reproduce it myself, since this only happens in the production environment, but in my case, there can be up to 20 images rendering simultaneously.

Jordan-Nelson commented 2 years ago

@Lorenzohidalgo @latheeshvmv - Could you share your Amplify configs (with sensitive info masked)? Were the projects created with the CLI?

Lorenzohidalgo commented 2 years ago

@Jordan-Nelson the project was created with the amplify CLI. Here is the config file:

const amplifyconfig = ''' {
    "UserAgent": "aws-amplify-cli/2.0",
    "Version": "1.0",
    "analytics": {
        "plugins": {
            "awsPinpointAnalyticsPlugin": {
                "pinpointAnalytics": {
                    "appId": "my-app-id",
                    "region": "eu-central-1"
                },
                "pinpointTargeting": {
                    "region": "eu-central-1"
                }
            }
        }
    },
    "api": {
        "plugins": {
            "awsAPIPlugin": {
                "my-api-name-1": {
                    "endpointType": "GraphQL",
                    "endpoint": "https://my-api-url.appsync-api.eu-central-1.amazonaws.com/graphql",
                    "region": "eu-central-1",
                    "authorizationType": "AMAZON_COGNITO_USER_POOLS",
                    "apiKey": "random-api-key"
                },
                "my-api-name-2": {
                    "endpointType": "REST",
                    "endpoint": "https://some-rando-api.execute-api.eu-central-1.amazonaws.com/prod",
                    "region": "eu-central-1",
                    "authorizationType": "AWS_IAM"
                }
            }
        }
    },
    "auth": {
        "plugins": {
            "awsCognitoAuthPlugin": {
                "UserAgent": "aws-amplify-cli/0.1.0",
                "Version": "0.1.0",
                "IdentityManager": {
                    "Default": {}
                },
                "CredentialsProvider": {
                    "CognitoIdentity": {
                        "Default": {
                            "PoolId": "eu-central-1:pool-id",
                            "Region": "eu-central-1"
                        }
                    }
                },
                "CognitoUserPool": {
                    "Default": {
                        "PoolId": "eu-central-1_pool-id",
                        "AppClientId": "my-app-id",
                        "Region": "eu-central-1"
                    }
                },
                "Auth": {
                    "Default": {
                        "authenticationFlowType": "USER_SRP_AUTH",
                        "loginMechanisms": [
                            "EMAIL"
                        ],
                        "signupAttributes": [
                            "EMAIL"
                        ],
                        "passwordProtectionSettings": {
                            "passwordPolicyMinLength": 8,
                            "passwordPolicyCharacters": []
                        },
                        "mfaConfiguration": "OFF",
                        "mfaTypes": [
                            "SMS"
                        ],
                        "verificationMechanisms": [
                            "EMAIL"
                        ],
                        "socialProviders": [],
                        "usernameAttributes": [
                            "EMAIL"
                        ]
                    }
                },
                "PinpointAnalytics": {
                    "Default": {
                        "AppId": "my-app-id",
                        "Region": "eu-central-1"
                    }
                },
                "PinpointTargeting": {
                    "Default": {
                        "Region": "eu-central-1"
                    }
                },
                "AppSync": {
                    "Default": {
                        "ApiUrl": "https://my-api-url.appsync-api.eu-central-1.amazonaws.com/graphql",
                        "Region": "eu-central-1",
                        "AuthMode": "AMAZON_COGNITO_USER_POOLS",
                        "ClientDatabasePrefix": "myrandoprefix_AMAZON_COGNITO_USER_POOLS"
                    },
                    "myrandoprefix_API_KEY": {
                        "ApiUrl": "https://my-api-url.appsync-api.eu-central-1.amazonaws.com/graphql",
                        "Region": "eu-central-1",
                        "AuthMode": "API_KEY",
                        "ApiKey": "some-rando-key",
                        "ClientDatabasePrefix": "myrandoprefix_API_KEY"
                    },
                    "myrandoprefix_AWS_IAM": {
                        "ApiUrl": "https://my-api-url.appsync-api.eu-central-1.amazonaws.com/graphql",
                        "Region": "eu-central-1",
                        "AuthMode": "AWS_IAM",
                        "ClientDatabasePrefix": "myrandoprefix_AWS_IAM"
                    }
                },
                "S3TransferUtility": {
                    "Default": {
                        "Bucket": "bucket-name",
                        "Region": "eu-central-1"
                    }
                }
            }
        }
    },
    "storage": {
        "plugins": {
            "awsS3StoragePlugin": {
                "bucket": "bucket-name",
                "region": "eu-central-1",
                "defaultAccessLevel": "guest"
            }
        }
    }
}''';
cwomack commented 1 year ago

@Lorenzohidalgo, are you still experiencing this issue? If so, can you try upgrading to the latest version of Amplify Flutter to see if it still occurs?

Jordan-Nelson commented 1 year ago

I am going to close this out since we have not heard back. Let us know if you are still experiencing this issue.