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

Amplify Fails to Configure - "WorkerBeeExceptionImpl" #4161

Closed
3 of 14 tasks
BeamTrakLLC opened this issue Nov 20, 2023 · 6 comments
Closed
3 of 14 tasks

Amplify Fails to Configure - "WorkerBeeExceptionImpl" #4161

BeamTrakLLC opened this issue Nov 20, 2023 · 6 comments
Assignees

Comments

@BeamTrakLLC
Copy link

Description

We have a Flutter desktop application that implements Amplify Auth and S3 Storage. We distribute the application via MSIX installer. There has been no issues distributing and running the application until last week on one computer. The computer would not load the Authenticator widget as amplify would not configure correctly. Unable to recreate the issue on different computers, we installed the development tools on the problem computer and were given the following error:

"WorkerBeeExceptionImpl {
error=FormatException: Unexpected character (at character 3461)
...5,116,169,84,200,68,37,67,93,93,73]}00,248,76,52,251,89,255,138,43,0,216...
^
,
stackTrace=#0 _ChunkedJsonParser.fail (dart:convert-patch/convert_patch.dart:1383:5)
#1 _ChunkedJsonParser.parse (dart:convert-patch/convert_patch.dart:913:48)
#2 _parseJson (dart:convert-patch/convert_patch.dart:35:10)
#3 JsonDecoder.convert (dart:convert/json.dart:610:36)
#4 JsonCodec.decode (dart:convert/json.dart:216:41)
#5 FileKeyValueStore.readAll
file_key_value_store.dart:96

#6 FileKeyValueStore.readKey
file_key_value_store.dart:70

#7 AmplifySecureStorageWindows.read
amplify_secure_storage_windows.dart:45

#8 SecureStorageWorker.run
secure_storage_worker.dart:53

#9 _run
secure_storage_worker.worker.vm.dart:14

,
}"

We tried pulling the amplify environment, reconfiguring the environment, and even deploying a test amplify environment. All attempts ran into the same issue. Below is a code snippet of what is being run and where it fails:

Fails on line: await Amplify.configure(amplifyconfig);

void main() async {
Paint.enableDithering = true;
WidgetsFlutterBinding.ensureInitialized();
await ColorThemes.themeInitialize();
await _configureAmplify();
await windowManager.ensureInitialized();

WindowOptions windowOptions = const WindowOptions(
size: Size(1200, 800),
center: true,
alwaysOnTop: false,
backgroundColor: Colors.transparent,
skipTaskbar: false,
titleBarStyle: TitleBarStyle.normal,
windowButtonVisibility: true,
);

windowManager.waitUntilReadyToShow(windowOptions, () async {
await windowManager.maximize();
await windowManager.show();
//await windowManager.focus();
});

runApp(const MyApp());
}

Future _configureAmplify() async {
try {
final auth = AmplifyAuthCognito();
final storage = AmplifyStorageS3();

await Amplify.addPlugins([auth, storage]);
await Amplify.configure(amplifyconfig);

final session = await Amplify.Auth.fetchAuthSession();
if (session.isSignedIn) {
  await Amplify.Auth.signOut();
}
safePrint('Successfully configured');

} on Exception catch (e) {
safePrint('Error configuring Amplify: $e');
}
}

Any help would be greatly appreciated. Below is the flutter doctor from the computer with the issue:

flutter doctor -v
[√] Flutter (Channel stable, 3.13.9, on Microsoft Windows [Version 10.0.19045.3693], locale en-US)
• Flutter version 3.13.9 on channel stable at C:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision d211f42860 (4 weeks ago), 2023-10-25 13:42:25 -0700
• Engine revision 0545f8705d
• Dart version 3.1.5
• DevTools version 2.25.0

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at C:\Users\khines\AppData\Local\Android\sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
• All Android licenses accepted.

[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.7.6)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.7.34221.43
• Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2022.3)
• 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 17.0.6+0-b2043.56-10027231)

[√] VS Code (version 1.84.2)
• VS Code at C:\Users\khines\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.76.0

[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19045.3693]
• Chrome (web) • chrome • web-javascript • Google Chrome 119.0.6045.160
• Edge (web) • edge • web-javascript • Microsoft Edge 119.0.2151.72

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

• No issues found!

Categories

  • Analytics
  • API (REST)
  • API (GraphQL)
  • Auth
  • Authenticator
  • DataStore
  • Notifications (Push)
  • Storage

Steps to Reproduce

No response

Screenshots

No response

Platforms

  • iOS
  • Android
  • Web
  • macOS
  • Windows
  • Linux

Flutter Version

3.13.9

Amplify Flutter Version

1.6.0

Deployment Method

Amplify CLI

Schema

No response

@khatruong2009 khatruong2009 added the pending-triage This issue is in the backlog of issues to triage label Nov 20, 2023
@haverchuck
Copy link
Member

@BeamTrakLLC Was this a fresh install on a new computer, or one that had previously been running the application without issue?

@BeamTrakLLC
Copy link
Author

This computer had been running previous versions without any issues. We then tried removing the application entirely and installing a previous working version. The error still occurs though.

@khatruong2009
Copy link
Member

Hi @BeamTrakLLC, I installed a sample app with auth and storage on windows and also ran the application from an MSIX installer and was not able to reproduce the issue. Due to this problem only happening on one computer and the workerbee error showing error=FormatException: Unexpected character (at character 3461), this leads me to believe that there might be a file or some data that is corrupted.

@BeamTrakLLC
Copy link
Author

Thank you for your help @khatruong2009, a corrupt file is definitely a possibility. We ran "SFC /scannow" in hopes of the error being related to a corrupt OS file but it did not fix the issue. The only outlier we can think of in regards to how the program was installed on the computer is when installing the certificate for the MSIX installer. The computer was in the incorrect timezone when we installed the certificate which caused this error:

E/flutter ( 6264): HandshakeException: Handshake error in client (OS Error: E/flutter ( 6264): CERTIFICATE_VERIFY_FAILED: unable to get local issuer certificate(handshake.cc:363))

This was resolved by changing the computer to the correct timezone and soon after the application was moved to have a launcher to handle updating and launching the app. But recently we moved back to a standard MSIX installer to allow for in-place updates and remove the need to bug test both the application and launcher.

This issue seems to be different though considering the previous certificate error would still allow amplify to configure and would only occur when the user attempted to login. We are going to get the current version of the app to work with the previous launcher to see if that allows amplify to configure. If that is the case then we know the issue is within the changes made between those updates. We will report back Monday Nov 27th as the office is closed for the holidays after today.

@BeamTrakLLC
Copy link
Author

We switched the program back to the previously working launcher. This did not fix the issue and upon further testing this change worked on every other computer except the problem computer. We think this issue is deeper than the program as other issues began to arise on the problem computer. Things such as the search bar not opening, file explorer randomly closing, and applications being unable to uninstall and reinstall.

@khatruong2009
Copy link
Member

Hi @BeamTrakLLC, sounds like this issue is related to that one specific computer. I'm going to close this issue but feel free to let us know if another issue comes up.

@khatruong2009 khatruong2009 self-assigned this Nov 29, 2023
@khatruong2009 khatruong2009 removed the pending-triage This issue is in the backlog of issues to triage label Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants