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:
Upload images to S3
Download/Cache multiple images with a CachedNetworkImage widget
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
Describe the bug Some S3 Downloads will error out with
ClientException: Connection closed before full header was received
.I'm retrieving the url like:
I'm displaying/downloading the images from S3 with:
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:
CachedNetworkImage
widgetExpected 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 (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! ```flutter doctor -v
Dependencies (
``` # 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" ```pubspec.lock
)Smartphone (please complete the following information):