firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.67k stars 3.97k forks source link

[remote_config] internal remote config fetch error #6196

Closed rubenvereecken closed 1 year ago

rubenvereecken commented 3 years ago

Bug report

Describe the bug Before we upgraded, I've never had this not happen to me. Strangely, my colleague never gets this on his device. Firebase throws every single time we call fetchAndActivate().

Here's the whole stacktrace

Task <C134C25B-109D-43EF-8FC5-CC663AB1CBD7>.<1> finished with error [-999] Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLStringKey=https://firebaseremoteconfig.googleapis.com/v1/projects/lessgo-dev/namespaces/firebase:fetch?key=AIzaSyAVEBJyZXrLWDTAHK5j092NMesJ-v1K9FY, NSLocalizedDescription=cancelled, NSErrorFailingURLKey=https://firebaseremoteconfig.googleapis.com/v1/projects/lessgo-dev/namespaces/firebase:fetch?key=AIzaSyAVEBJyZXrLWDTAHK5j092NMesJ-v1K9FY}
7.11.0 - [Firebase/RemoteConfig][I-RCN000026] RCN Fetch failure: Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLStringKey=https://firebaseremoteconfig.googleapis.com/v1/projects/lessgo-dev/namespaces/firebase:fetch?key=AIzaSyAVEBJyZXrLWDTAHK5j092NMesJ-v1K9FY, NSLocalizedDescription=cancelled, NSErrorFailingURLKey=https://firebaseremoteconfig.googleapis.com/v1/projects/lessgo-dev/namespaces/firebase:fetch?key=AIzaSyAVEBJyZXrLWDTAHK5j092NMesJ-v1K9FY}. No cached config result.
7.11.0 - [Firebase/RemoteConfig][I-RCN000026] RCN Fetch failure. Response http error code: 0
Task <C134C25B-109D-43EF-8FC5-CC663AB1CBD7>.<1> HTTP load failed, 0/0 bytes (error code: -999 [1:89])
flutter: ┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
flutter: │ [firebase_remote_config/internal] internal remote config fetch error
flutter: │
flutter: │ #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:581:7)
flutter: │ #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:158:18)
flutter: │ <asynchronous suspension>
flutter: │ #2      MethodChannelFirebaseRemoteConfig.fetchAndActivate (package:firebase_remote_config_platform_interface/src/method_channel/method_channel_firebase_remote_config.dart:145:29)
flutter: │ <asynchronous suspension>
flutter: │ #3      RemoteConfig.fetchAndActivate (package:firebase_remote_config/src/remote_config.dart:86:26)
flutter: │ <asynchronous suspension>
flutter: │ #4      RemoteConfigRepository._fetchRemoteConfig (package:woushe_refactored/src/repositories/remote_config_repository.dart:48:7)
flutter: │ <asynchronous suspension>
flutter: │
flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
flutter: │ #0   MethodChannelFirebaseRemoteConfig.fetchAndActivate (package:firebase_remote_config_platform_interface/src/method_channel/method_channel_firebase_remote_config.dart:155:7)
flutter: │ #1   <asynchronous suspension>
flutter: │ #2   RemoteConfig.fetchAndActivate (package:firebase_remote_config/src/remote_config.dart:86:26)
flutter: │ #3   <asynchronous suspension>
flutter: │ #4   RemoteConfigRepository._fetchRemoteConfig (package:woushe_refactored/src/repositories/remote_config_repository.dart:48:7)
flutter: │ #5   <asynchronous suspension>
flutter: ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
flutter: │ 12:51:54.482 (+0:00:00.502445)

Steps to reproduce

final remoteConfig = RemoteConfig.instance;
await remoteConfig.setConfigSettings(RemoteConfigSettings(
  fetchTimeout: const Duration(seconds: 20),
  minimumFetchInterval: const Duration(minutes: 20),
));
await remoteConfig.fetchAndActivate(); // This bad boy throws

Additional context

This only started happening after we upgraded to Flutter 2 and adopted new Firebase package versions.

Flutter doctor

Click To Expand ``` Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 2.0.6, on Mac OS X 10.15.7 19H524 darwin-x64, locale en-GB) [!] Android toolchain - develop for Android devices (Android SDK version 30.0.2) ✗ Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses [✓] Xcode - develop for iOS and macOS [✓] Chrome - develop for the web [✓] Android Studio (version 4.0) [✓] VS Code (version 1.55.2) [✓] Connected device (2 available) ! Doctor found issues in 1 category. ```

Flutter dependencies

Click To Expand ``` Dart SDK 2.12.3 Flutter SDK 2.0.6 woushe_refactored 1.0.42+118 dependencies: - add_2_calendar 2.1.0 [flutter] - auto_size_text 3.0.0-nullsafety.0 [flutter] - cached_network_image 3.0.0 [flutter flutter_cache_manager octo_image] - chewie 1.0.0 [cupertino_icons flutter video_player wakelock] - circular_check_box 1.0.4 [flutter] - collection 1.15.0 - confetti 0.6.0-nullsafety [flutter random_color vector_math] - contacts_service 0.6.1 [flutter collection quiver] - cupertino_icons 1.0.3 - date_time_format 2.0.1 - device_info 2.0.0 [flutter device_info_platform_interface] - devicelocale 0.4.1 [flutter flutter_web_plugins] - dio 4.0.0 [http_parser path] - equatable 2.0.0 [collection meta] - firebase_analytics 8.0.4 [firebase_analytics_platform_interface firebase_analytics_web firebase_core flutter meta] - firebase_auth 1.1.4 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta] - firebase_core 1.1.1 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_crashlytics 2.0.3 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace] - firebase_dynamic_links 2.0.3 [firebase_core flutter] - firebase_messaging 9.1.4 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta] - firebase_remote_config 0.10.0-dev.3 [firebase_core firebase_core_platform_interface firebase_remote_config_platform_interface flutter] - flutter 0.0.0 [characters collection meta typed_data vector_math sky_engine] - flutter_datetime_picker 1.5.1 [flutter] - flutter_image_compress 1.0.0 [flutter] - flutter_libphonenumber 1.0.3 [flutter] - flutter_linkify 5.0.2 [flutter linkify] - flutter_markdown 0.6.1 [flutter markdown meta path] - flutter_native_timezone 1.0.10 [flutter] - flutter_speed_dial 3.0.5 [flutter] - font_awesome_flutter 9.0.0 [flutter] - google_maps_flutter 2.0.3 [flutter flutter_plugin_android_lifecycle google_maps_flutter_platform_interface] - hive 2.0.4 [meta crypto] - hive_flutter 1.0.0 [flutter hive path_provider path] - horizontal_blocked_scroll_physics 3.0.0 [flutter pedantic] - image_cropper 1.4.0 [flutter] - image_picker 0.7.4 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface image_picker_for_web] - in_app_review 2.0.2 [flutter in_app_review_platform_interface] - in_app_update 2.0.0 [flutter] - infinite_scroll_pagination 3.0.1 [flutter sliver_tools] - intl 0.17.0 [clock path] - intl_phone_number_input 0.7.0+2 [flutter meta libphonenumber_plugin equatable collection] - introduction_screen 2.1.0 [flutter dots_indicator] - jiffy 4.1.0 [intl] - json_serializable 4.1.1 [analyzer build build_config collection json_annotation meta path source_gen] - location 4.1.1 [flutter location_platform_interface location_web meta] - logger 1.0.0 - multi_image_picker 4.8.00 [flutter meta] - open_appstore 1.0.2 [flutter] - package_info 2.0.0 [flutter] - path_provider 2.0.1 [flutter path_provider_platform_interface path_provider_macos path_provider_linux path_provider_windows] - percent_indicator 3.0.1 [flutter] - permission_handler 7.1.0 [flutter meta permission_handler_platform_interface] - photo_gallery 1.0.1 [flutter] - photo_view 0.11.1 [flutter] - provider 5.0.0 [collection flutter nested] - pub_semver 2.0.0 [collection] - pull_to_refresh 1.6.5 [flutter] - pull_to_refresh_notification 2.0.1 [flutter] - quiver 3.0.1 [matcher] - rive 0.7.9 [collection flutter graphs meta] - rxdart 0.26.0 - shake_flutter 14.1.1 [flutter path] - share 2.0.1 [meta mime flutter] - shared_preferences 2.0.5 [meta flutter shared_preferences_platform_interface shared_preferences_linux shared_preferences_macos shared_preferences_web shared_preferences_windows] - slider_button 0.6.0 [vibration flutter] - stream_chat_flutter 2.0.0-nullsafety.3 [flutter stream_chat_flutter_core photo_view rxdart scrollable_positioned_list jiffy flutter_svg flutter_portal cached_network_image shimmer flutter_markdown url_launcher video_player chewie file_picker image_picker flutter_keyboard_visibility video_compress visibility_detector http_parser meta lottie substring_highlight flutter_slidable image_gallery_saver share_plus photo_manager ezanimation synchronized dio characters path_provider video_thumbnail collection] - timeago 3.0.2 - url_launcher 6.0.3 [flutter url_launcher_platform_interface url_launcher_linux url_launcher_macos url_launcher_windows url_launcher_web] - validators 3.0.0 - video_compress 3.0.0 [flutter] - video_player 2.1.1 [meta video_player_platform_interface video_player_web flutter flutter_test] - visibility_detector 0.2.0 [flutter] - wechat_assets_picker 5.5.0 [flutter extended_image photo_manager provider video_player] dev dependencies: - hive_generator 1.1.0 [build source_gen hive analyzer source_helper] dependency overrides: - graphs 1.0.0 transitive dependencies: - _fe_analyzer_shared 21.0.0 [meta] - analyzer 1.5.0 [_fe_analyzer_shared cli_util collection convert crypto glob meta package_config path pub_semver source_span watcher yaml pedantic] - archive 3.1.2 [crypto path] - args 2.1.0 - async 2.5.0 [collection] - boolean_selector 2.1.0 [source_span string_scanner] - build 2.0.1 [analyzer async convert crypto glob logging meta path] - build_config 1.0.0 [checked_yaml json_annotation path pubspec_parse yaml] - characters 1.1.0 - charcode 1.2.0 - checked_yaml 2.0.1 [json_annotation source_span yaml] - cli_util 0.3.0 [meta path] - clock 1.1.0 - convert 3.0.0 [typed_data] - crypto 3.0.1 [collection typed_data] - dart_style 2.0.1 [analyzer args path pub_semver source_span] - device_info_platform_interface 2.0.1 [flutter meta plugin_platform_interface] - dots_indicator 2.0.0 [flutter] - extended_image 4.1.0 [extended_image_library flutter meta] - extended_image_library 3.1.0 [crypto flutter http_client_helper path path_provider] - ezanimation 0.5.0 [flutter] - fake_async 1.2.0 [clock collection] - ffi 1.0.0 - file 6.0.0 [meta path] - file_picker 3.0.1 [flutter flutter_web_plugins flutter_plugin_android_lifecycle plugin_platform_interface] - firebase 9.0.1 [http http_parser js] - firebase_analytics_platform_interface 2.0.1 [flutter meta] - firebase_analytics_web 0.3.0+1 [firebase firebase_analytics_platform_interface flutter flutter_web_plugins meta] - firebase_auth_platform_interface 4.2.2 [firebase_core flutter meta plugin_platform_interface] - firebase_auth_web 1.1.2 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser intl js meta] - firebase_core_platform_interface 4.0.1 [collection flutter meta plugin_platform_interface] - firebase_core_web 1.0.3 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - firebase_crashlytics_platform_interface 3.0.3 [collection firebase_core flutter meta plugin_platform_interface] - firebase_messaging_platform_interface 2.1.4 [firebase_core flutter meta plugin_platform_interface] - firebase_messaging_web 1.0.7 [firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta] - firebase_remote_config_platform_interface 0.3.0-dev.3 [firebase_core flutter meta plugin_platform_interface] - flutter_blurhash 0.6.0 [flutter meta pedantic] - flutter_cache_manager 3.0.1 [clock collection file flutter http image path path_provider pedantic rxdart sqflite uuid] - flutter_keyboard_visibility 5.0.1 [meta flutter_keyboard_visibility_platform_interface flutter_keyboard_visibility_web flutter] - flutter_keyboard_visibility_platform_interface 2.0.0 [flutter meta plugin_platform_interface] - flutter_keyboard_visibility_web 2.0.0 [flutter_keyboard_visibility_platform_interface flutter_web_plugins flutter] - flutter_plugin_android_lifecycle 2.0.1 [flutter] - flutter_portal 0.4.0 [flutter] - flutter_slidable 0.6.0 [flutter] - flutter_svg 0.22.0 [flutter meta path_drawing vector_math xml] - flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher meta source_span stream_channel string_scanner term_glyph typed_data] - flutter_web_plugins 0.0.0 [flutter js characters collection meta typed_data vector_math] - freezed_annotation 0.14.1 [collection json_annotation meta] - glob 2.0.1 [async collection file path pedantic string_scanner] - google_maps_flutter_platform_interface 2.0.4 [flutter meta plugin_platform_interface stream_transform collection] - http 0.13.3 [async http_parser meta path pedantic] - http_client_helper 2.0.2 [http] - http_parser 4.0.0 [charcode collection source_span string_scanner typed_data] - image 3.0.2 [archive meta xml] - image_gallery_saver 1.6.9 [flutter] - image_picker_for_web 2.0.0 [image_picker_platform_interface meta flutter flutter_web_plugins] - image_picker_platform_interface 2.1.0 [flutter meta http plugin_platform_interface] - in_app_review_platform_interface 2.0.2 [flutter url_launcher plugin_platform_interface platform] - js 0.6.3 - json_annotation 4.0.1 - libphonenumber 2.0.0 [flutter meta] - libphonenumber_platform_interface 0.3.1 [flutter plugin_platform_interface] - libphonenumber_plugin 0.2.3 [flutter flutter_web_plugins libphonenumber_platform_interface libphonenumber_web libphonenumber] - libphonenumber_web 0.2.0+1 [flutter flutter_web_plugins js libphonenumber_platform_interface] - linkify 4.0.0 - location_platform_interface 2.1.0 [flutter meta plugin_platform_interface] - location_web 3.0.0 [flutter flutter_web_plugins http_parser js location_platform_interface meta] - logging 1.0.1 - lottie 1.0.1 [archive characters charcode collection flutter logging meta path vector_math] - markdown 4.0.0 [args charcode meta] - matcher 0.12.10 [stack_trace] - meta 1.3.0 - mime 1.0.0 - nested 1.0.0 [flutter] - octo_image 1.0.0+1 [flutter flutter_blurhash] - package_config 2.0.0 [path] - path 1.8.0 - path_drawing 0.5.1 [vector_math meta path_parsing flutter] - path_parsing 0.2.1 [vector_math meta] - path_provider_linux 2.0.0 [path xdg_directories path_provider_platform_interface flutter] - path_provider_macos 2.0.0 [flutter] - path_provider_platform_interface 2.0.1 [flutter meta platform plugin_platform_interface] - path_provider_windows 2.0.1 [path_provider_platform_interface meta path flutter ffi win32] - pedantic 1.11.0 - permission_handler_platform_interface 3.3.0 [flutter meta plugin_platform_interface] - petitparser 4.1.0 [meta] - photo_manager 1.1.6 [flutter] - platform 3.0.0 - plugin_platform_interface 2.0.0 [meta] - process 4.0.0 [file path platform] - pubspec_parse 1.0.0 [checked_yaml collection json_annotation pub_semver yaml] - random_color 1.0.6-nullsafety [flutter] - scrollable_positioned_list 0.2.0-nullsafety.0 [flutter collection] - share_plus 2.0.3 [meta mime flutter share_plus_platform_interface share_plus_linux share_plus_macos share_plus_windows share_plus_web] - share_plus_linux 2.0.1 [share_plus_platform_interface file flutter meta url_launcher] - share_plus_macos 2.0.1 [share_plus_platform_interface flutter] - share_plus_platform_interface 2.0.1 [flutter meta mime plugin_platform_interface] - share_plus_web 2.0.1 [share_plus_platform_interface url_launcher flutter flutter_web_plugins meta] - share_plus_windows 2.0.1 [share_plus_platform_interface flutter meta url_launcher] - shared_preferences_linux 2.0.0 [flutter file meta path path_provider_linux shared_preferences_platform_interface] - shared_preferences_macos 2.0.0 [shared_preferences_platform_interface flutter] - shared_preferences_platform_interface 2.0.0 [flutter] - shared_preferences_web 2.0.0 [shared_preferences_platform_interface flutter flutter_web_plugins meta] - shared_preferences_windows 2.0.0 [shared_preferences_platform_interface flutter file meta path path_provider_platform_interface path_provider_windows] - shimmer 2.0.0 [flutter] - sky_engine 0.0.99 - sliver_tools 0.2.2 [flutter] - source_gen 1.0.0 [analyzer async build dart_style glob meta path pedantic source_span] - source_helper 1.1.0 [analyzer collection source_gen] - source_span 1.8.0 [charcode collection path term_glyph] - sqflite 2.0.0+3 [flutter sqflite_common path] - sqflite_common 2.0.0+2 [synchronized path meta] - stack_trace 1.10.0 [path] - stream_channel 2.1.0 [async] - stream_chat 2.0.0-nullsafety.1 [async collection dio equatable freezed_annotation http_parser json_annotation logging meta mime rxdart uuid web_socket_channel] - stream_chat_flutter_core 2.0.0-nullsafety.2 [collection flutter meta rxdart stream_chat] - stream_transform 2.0.0 - string_scanner 1.1.0 [charcode source_span] - substring_highlight 1.0.26 [flutter] - synchronized 3.0.0 - term_glyph 1.2.0 - test_api 0.2.19 [async boolean_selector collection meta path source_span stack_trace stream_channel string_scanner term_glyph matcher] - typed_data 1.3.0 [collection] - url_launcher_linux 2.0.0 [flutter] - url_launcher_macos 2.0.0 [flutter] - url_launcher_platform_interface 2.0.2 [flutter plugin_platform_interface] - url_launcher_web 2.0.0 [url_launcher_platform_interface meta flutter flutter_web_plugins] - url_launcher_windows 2.0.0 [flutter] - uuid 3.0.4 [crypto] - vector_math 2.1.0 - vibration 1.7.1 [flutter vibration_web] - vibration_web 1.6.2 [flutter flutter_web_plugins] - video_player_platform_interface 4.1.0 [flutter meta flutter_test] - video_player_web 2.0.0 [flutter flutter_web_plugins meta video_player_platform_interface] - video_thumbnail 0.3.3 [flutter] - wakelock 0.4.0 [flutter meta wakelock_macos wakelock_platform_interface wakelock_web] - wakelock_macos 0.1.0 [flutter flutter_web_plugins wakelock_platform_interface] - wakelock_platform_interface 0.2.0 [flutter meta] - wakelock_web 0.2.0 [flutter flutter_web_plugins js wakelock_platform_interface] - watcher 1.0.0 [async path pedantic] - web_socket_channel 2.1.0 [async crypto stream_channel] - win32 2.0.5 [ffi] - xdg_directories 0.2.0 [meta path process] - xml 5.1.0 [collection meta petitparser] - yaml 3.1.0 [collection source_span string_scanner] ```

komallaghate commented 2 years ago

Is the solution for the above problem available? I'm also getting the same error. I'm getting an Invalid Envelope and an Internal remote config fetch error.

russellwheatley commented 2 years ago

Hey @komallaghate, are you able to share an MCVE? I'd be happy to take a look.

google-oss-bot commented 2 years ago

Hey @rubenvereecken. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

mockturtl commented 2 years ago

I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

Should the "staleness checker" be flagging assigned issues?

google-oss-bot commented 2 years ago

Hey @rubenvereecken. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

ciriousjoker commented 2 years ago

Marking assigned issues as stale doesn't seem logical

Lorenzohidalgo commented 2 years ago

I've encountered a similar issue with remote_config on Flutter web, calling fetchAndActivate triggers the following issues:

6
Locations: No module for https://www.gstatic.com/firebasejs/9.9.0/firebase-remote-config.js
23
Locations: No module for http://localhost:59295/dart_sdk.js
Locations: No module for 
15
Locations: No module for http://localhost:59295/dart_sdk.js
Locations: No module for http://localhost:59295/dart_sdk.js
Locations: No module for http://localhost:59295/dart_sdk.js
Locations: No module for http://localhost:59295/dart_sdk.js
2
Locations: No module for http://localhost:59295/dart_sdk.js
Locations: No module for http://localhost:59295/dart_sdk.js
53
Locations: No module for http://localhost:59295/dart_sdk.js
Locations: No module for http://localhost:59295/dart_sdk.js
Locations: No module for http://localhost:59295/dart_sdk.js
Locations: No module for http://localhost:59295/dart_sdk.js
Locations: No module for http://localhost:59295/dart_sdk.js
Locations: No module for http://localhost:59295/dart_sdk.js
21
Locations: No module for http://localhost:59295/dart_sdk.js
Locations: No module for http://localhost:59295/dart_sdk.js
Locations: No module for http://localhost:59295/dart_sdk.js
Locations: No module for http://localhost:59295/dart_sdk.js
Locations: No module for http://localhost:59295/dart_sdk.js
66
Locations: No module for http://localhost:59295/dart_sdk.js
Locations: No module for http://localhost:59295/dart_sdk.js
Locations: No module for http://localhost:59295/dart_sdk.js
Locations: No module for http://localhost:59295/dart_sdk.js
12
Locations: No module for http://localhost:59295/dart_sdk.js
2
Locations: No module for http://localhost:59295/main_module.bootstrap.js
Locations: No module for 
40
Locations: No module for http://localhost:59295/dwds/src/injected/client.js
ChromeProxyService: Failed to evaluate expression 'remote_config_interop.fetchAndActivate': InternalError: Expression evaluation in async frames is not supported. No frame with index 6..

Tested with flutter 3.3.2 and remote_config version ^2.0.17

mockturtl commented 2 years ago

Possibly related: #7425, via #6993. A possible root cause is a 403 response from GCP -- it's easy to miss.

I think the README for various plugins should remind users to check https://console.cloud.google.com/apis/dashboard, APIs & Services -> API Keys -> [pick] -> API Restrictions. The official Firebase docs kind of gloss over it.

Screenshot from 2022-09-16 13-20-36

mockturtl commented 2 years ago

Just bumped into this on a new machine, building for Android.

I forgot the default debug keystore (~/.android/debug.keystore) is created by installing Android Studio. :facepalm: So the new signing certificate's fingerprint was missing.

Hope this helps to reproduce / workaround.

google-oss-bot commented 2 years ago

Hey @rubenvereecken. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

russellwheatley commented 2 years ago

Hey @rubenvereecken, I've had a look at this issue.

I've found where the error is produced in your initial description in the iOS SDK source code: https://github.com/firebase/firebase-ios-sdk/blob/eb30b6fdd809cbfe3a9eb7f3ccf1dd46326bef2d/FirebaseRemoteConfig/Sources/RCNConfigFetch.m#L378-L379

The code on the native side is fairly simple. In a nutshell:

  FIRRemoteConfig* remoteConfig = [FIRRemoteConfig remoteConfig];
  FIRRemoteConfigSettings *remoteConfigSettings = [[FIRRemoteConfigSettings alloc] init];
  // 20 seconds
  remoteConfigSettings.fetchTimeout = 20;
  // 300 seconds or 5 minutes
  remoteConfigSettings.minimumFetchInterval = 300;
 [remoteConfig setConfigSettings:remoteConfigSettings];
 [remoteConfig fetchAndActivateWithCompletionHandler:^(
                    FIRRemoteConfigFetchAndActivateStatus status, NSError *error) {
    if (error != nil) {
      // Send error back to Flutter user
      result.error(nil, nil, nil, error);
    } else {
      if (status == FIRRemoteConfigFetchAndActivateStatusSuccessFetchedFromRemote) {
        result.success(@(YES));
      } else {
        result.success(@(NO));
      }
    }
  }];

The error description received in Flutter: internal remote config fetch error. The error logged by the iOS SDK is: No cached config result.. Error code: I-RCN000026.

Just not sure why it errors on some devices but not on others. I haven't been able to reproduce the error on my mac or iOS device.

Are you still experiencing this issue? Let me know and I'll see if I can escalate this issue (I ask as I'm not sure if it has been resolved internally by Firebase). If other users are still experiencing this exact error with the above mentioned description and error code, could you please "thumb up" this comment? (Please don't thumb up if it is a different error/description). Thanks.

@mockturtl - I have a PR that improves the exception on Android. It now indicates the error is a problem with GCP configuration.

dheerajsinghank commented 2 years ago

@russellwheatley @rubenvereecken I'm also getting the below error on my device when calling fetchAndActivate but it is working on some other devices (Android)

I/flutter ( 7090): ----------------FIREBASE CRASHLYTICS---------------- I/flutter ( 7090): [firebase_remote_config/internal] internal remote config fetch error I/flutter ( 7090): I/flutter ( 7090): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:653:7) I/flutter ( 7090): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:296:18) I/flutter ( 7090): <asynchronous suspension> I/flutter ( 7090): #2 MethodChannelFirebaseRemoteConfig.fetch (package:firebase_remote_config_platform_interface/src/method_channel/method_channel_firebase_remote_config.dart:132:7) I/flutter ( 7090): <asynchronous suspension> I/flutter ( 7090): #3 RemoteConfigService.fetchAndActivate (package:weddingfolk/services/remote_config.dart:67:7) I/flutter ( 7090): <asynchronous suspension> I/flutter ( 7090): #4 RemoteConfigService.init (package:weddingfolk/services/remote_config.dart:56:5) I/flutter ( 7090): <asynchronous suspension> I/flutter ( 7090): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:653:7) I/flutter ( 7090): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:296:18) I/flutter ( 7090): <asynchronous suspension> I/flutter ( 7090): #2 MethodChannelFirebaseRemoteConfig.fetch (package:firebase_remote_config_platform_interface/src/method_channel/method_channel_firebase_remote_config.dart:132:7) I/flutter ( 7090): <asynchronous suspension> I/flutter ( 7090): #3 RemoteConfigService.fetchAndActivate (package:weddingfolk/services/remote_config.dart:67:7) I/flutter ( 7090): <asynchronous suspension> I/flutter ( 7090): #4 RemoteConfigService.init (package:weddingfolk/services/remote_config.dart:56:5) I/flutter ( 7090): <asynchronous suspension>

it seems the problem is related to android device/os and firebase because I have also created the project in react-native and native android getting the same result like the flutter project

Error in Android native project : com.google.firebase.remoteconfig.FirebaseRemoteConfigClientException: The client had an error while calling the backend!

Thanks

marketten commented 2 years ago

Hi @darshankawar Same problem also happens on our side. After blocked: customer-response label added lots of feedback provided. Do you need more feedback to inspect the issue and remove blocked: customer-response label to continue?

russellwheatley commented 2 years ago

@marketten See this comment for what we're waiting for.

definitelyme commented 2 years ago

Yes @russellwheatley still happening

VagnerWillian commented 2 years ago

In my project too, fetch doesn't update the data. :(

sartorinahuel commented 2 years ago

@russellwheatley i have the same issue here.

russellwheatley commented 2 years ago

As mentioned here:

Are you still experiencing this issue? Let me know and I'll see if I can escalate this issue (I ask as I'm not sure if it has been resolved internally by Firebase). If other users are still experiencing this exact error with the above mentioned description and error code, could you please "thumb up" this comment? (Please don't thumb up if it is a different error/description). Thanks.

Please stop saying something along the lines of "I have the same issue" as it is unhelpful. I'm not sure if you're receiving the same error as mentioned in the issue comment I've tagged. Please read the comment carefully and ensure you have the exact same error logged by the iOS SDK which is:

The error logged by the iOS SDK is: No cached config result.. Error code: I-RCN000026.

Thanks.

google-oss-bot commented 1 year ago

Hey @rubenvereecken. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

VagnerWillian commented 1 year ago

I believe that this happens by reaching the quota of requests described in the documentation, the incorrect implementation can cause this problem.

rubenvereecken commented 1 year ago

Hey @rubenvereecken. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

You're kidding.

russellwheatley commented 1 year ago

Hey @rubenvereecken, do you have any feedback on this? https://github.com/firebase/flutterfire/issues/6196#issuecomment-1262002803

xVemu commented 1 year ago

It occurs on android, when there is no Internet connection.

VagnerWillian commented 1 year ago

I had this problem today, however, it turned out that the date and time on the device were incorrect.

Dawid-Dlugosz commented 1 year ago

I have the same problem, i created new project and it work, but it's not solution. Maybe is problem with configuration?

evekeen commented 1 year ago

The same thing just started to happen in native iOS code. It just stopped working, and I didn't change anything

2023-01-19 09:48:03.348893-0500 acetrace[5305:489693] 10.3.0 - [FirebaseRemoteConfig][I-RCN000026] RCN Fetch failure: Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLStringKey=https://firebaseremoteconfig.googleapis.com/v1/projects/test-dc9d1/namespaces/firebase:fetch?key=AIzaSyDNIs2VSt-VeFkaruYoldNr7ARB7DnY6IE, NSErrorFailingURLKey=https://firebaseremoteconfig.googleapis.com/v1/projects/test-dc9d1/namespaces/firebase:fetch?key=AIzaSyDNIs2VSt-VeFkaruYoldNr7ARB7DnY6IE, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <AD9BCB8C-BBB0-4163-B518-4F039A02DCF3>.<1>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <AD9BCB8C-BBB0-4163-B518-4F039A02DCF3>.<1>, NSLocalizedDescription=cancelled}. No cached config result.
2023-01-19 09:48:03.349067-0500 acetrace[5305:489693] 10.3.0 - [FirebaseRemoteConfig][I-RCN000026] RCN Fetch failure. Response http error code: 0
kkoken commented 1 year ago

The app we have in production is affected by the issue (1.6k+ people) on flutter 3.3.9. Generally, people are stuck with a black screen after they launched the app.

We have not switched to 3.7.0 or 3.7.1. If it is needed, I could also provide flutter doctor -v @darshankawar @russellwheatley

// on main function
  RemoteConfigSettings setting =
      RemoteConfigSettings(minimumFetchInterval: const Duration(hours: 1), fetchTimeout: const Duration(minutes: 1));
  await remoteConfig.setConfigSettings(setting);
// App's initState()
  listenConnectivityState() async {
    var status = await getIt<ConnectivityUtil>().getConnectivityStatus();
    if (status == ConnectivityStatus.WIFI || status == ConnectivityStatus.MOBILE) {
      await remoteConfig.fetch();
      await remoteConfig.fetchAndActivate();
    }
  }
// pubspec
  #Firebase
  firebase_analytics: 10.0.3
  firebase_core: 2.1.1
  firebase_crashlytics: 3.0.3
  firebase_remote_config: 3.0.3
  firebase_performance: 0.9.0+3

// flutter version
environment:
  sdk: ">=2.18.0 <3.0.0"
  flutter: 3.3.9
russellwheatley commented 1 year ago

Hey @kkoken, do you mind creating a separate issue for that, please? I'll take a look 🙏.

I would like to keep this issue specifically for iOS raised by the OP. I've circled back to this and I'm looking to elevate it to the relevant Firebase team to see if I can find out what is happening with this specific problem.

russellwheatley commented 1 year ago

I've opened a PR that does a single retry on error code 999 related specifically to the OP's error.

I've also added a couple of logs that indicate the remote config host status so we can identify if that is an issue. Let me know what you think 👍

The logs required an observer which would require an update to a property in the Info.plist file so I removed it unfortunately.

I'll reopen the issue if this is still happening for users, and we can think about increasing the delay on the retry. I'll enquire with Firebase team why this may be happening in the meanwhile. Thanks.

aytunch commented 1 year ago

Hi @russellwheatley I am constantly getting this exception on web after a couple of minutes of app usage. Makes the debugging sessions unpleasant :/ Do you think the same solution you applied for iOS can be used for web?

russellwheatley commented 1 year ago

@aytunch - if you want to create a separate issue for web, provide some detail and a reproduction, I'd take a look. Thanks.