Invalid BsonExpression when converted from Linq expression #980

Closed
opened 2025-11-26 22:35:54 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @roccolord on GitHub (Apr 2, 2020).

Describe the Bug

Starting the app on a Huawei P20 Pro crashes instantly.

Steps To Reproduce

Environment

  • Device: Huawei P20 Pro
  • Operating system: Android 9.1 Mars 2020 security fixes
  • Build Version (go to "Settings" → "About" in the app): 2.3.1
  • Is this a Beta release? Y

Additional Context

Crash:
04-02 17:41:08.675 30646 30646 I MonoDroid: UNHANDLED EXCEPTION:
04-02 17:41:08.703 1269 25999 E HiDATA : ***************************period begin ***************************
04-02 17:41:08.703 1269 25999 E HiDATA : QOE_MSG_GET_QUALITY_INFO mPeriodTime = 4000
04-02 17:41:08.705 1269 25999 E HiDATA : updateTcpQualityDate
04-02 17:41:08.705 1269 25999 E HiDATA : reportNetworkInfo isOTADataUpdate = false isTCPDataUpdate = true isUDPDataUpdate = true
04-02 17:41:08.705 1269 25999 E HiDATA : onNetworkInfoUpdate
04-02 17:41:08.705 1269 25997 D HiDATA : QOE_MSG_UPDATE_TCP_INFO isWaittingCheckResult = false
04-02 17:41:08.705 1269 25997 D HiDATA : detectNetworkQuality noUdpAccess = false
04-02 17:41:08.706 1269 25997 E HiDATA : detectTcpNetworkAvailable info.mPeriodTcpRxPacket = 0 info.mPeriodTcpTxPacket = 0 info.mPeriodDnsFailCount = 0
04-02 17:41:08.706 1269 25997 D HiDATA : haveInternetProcess isInternet = true noUdpAccess = false mNetworkDisableCount = 0
04-02 17:41:08.706 1269 25997 E HiDATA : ***************************period end ***************************
04-02 17:41:08.718 30646 30646 I MonoDroid: System.NotSupportedException: Invalid BsonExpression when converted from Linq expression: i => (i.Id == value(Bit.Core.Services.LiteDbStorageService+<>c__DisplayClass6_01[System.String]).key) - ($._id = @p0) ---> System.TypeInitializationException: The type initializer for 'LiteDB.BsonExpression' threw an exception. ---> System.ArgumentNullException: Value cannot be null. 04-02 17:41:08.718 30646 30646 I MonoDroid: Parameter name: method 04-02 17:41:08.718 30646 30646 I MonoDroid: at System.Linq.Expressions.Expression.Call (System.Reflection.MethodInfo method, System.Linq.Expressions.Expression arg0, System.Linq.Expressions.Expression arg1) [0x00068] in <b0037b07c89b44f9bf29887da14b4658>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: at LiteDB.BsonExpressionParser.TryParsePath (LiteDB.Tokenizer tokenizer, LiteDB.ExpressionContext context, System.Boolean isRoot) [0x000de] in <da3b55f2020d4ca38f320e2cd4b6423d>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: at LiteDB.BsonExpressionParser.ParseSingleExpression (LiteDB.Tokenizer tokenizer, LiteDB.ExpressionContext context, System.Boolean isRoot) [0x00094] in <da3b55f2020d4ca38f320e2cd4b6423d>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: at LiteDB.BsonExpressionParser.ParseFullExpression (LiteDB.Tokenizer tokenizer, LiteDB.ExpressionContext context, System.Boolean isRoot) [0x00000] in <da3b55f2020d4ca38f320e2cd4b6423d>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: at LiteDB.BsonExpression.Parse (LiteDB.Tokenizer tokenizer, LiteDB.BsonExpressionParserMode mode, System.Boolean isRoot) [0x00054] in <da3b55f2020d4ca38f320e2cd4b6423d>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: at LiteDB.BsonExpression.Create (System.String expression) [0x00028] in <da3b55f2020d4ca38f320e2cd4b6423d>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: at LiteDB.BsonExpression..cctor () [0x0000a] in <da3b55f2020d4ca38f320e2cd4b6423d>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: --- End of inner exception stack trace --- 04-02 17:41:08.718 30646 30646 I MonoDroid: at LiteDB.LinqExpressionVisitor.Resolve (System.Boolean predicate) [0x00019] in <da3b55f2020d4ca38f320e2cd4b6423d>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: --- End of inner exception stack trace --- 04-02 17:41:08.718 30646 30646 I MonoDroid: at LiteDB.LinqExpressionVisitor.Resolve (System.Boolean predicate) [0x000a4] in <da3b55f2020d4ca38f320e2cd4b6423d>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: at LiteDB.BsonMapper.GetExpression[T,K] (System.Linq.Expressions.Expression1[TDelegate] predicate) [0x00020] in :0
04-02 17:41:08.718 30646 30646 I MonoDroid: at LiteDB.LiteCollection1[T].Find (System.Linq.Expressions.Expression1[TDelegate] predicate, System.Int32 skip, System.Int32 limit) [0x00000] in :0
04-02 17:41:08.718 30646 30646 I MonoDroid: at Bit.Core.Services.LiteDbStorageService.GetAsync[T] (System.String key) [0x000fb] in :0
04-02 17:41:08.718 30646 30646 I MonoDroid: at Bit.App.Services.MobileStorageService.GetAsync[T] (System.String key) [0x0013b] in :0
04-02 17:41:08.718 30646 30646 I MonoDroid: at Bit.Core.Services.TokenService.GetTokenAsync () [0x00083] in :0
04-02 17:41:08.718 30646 30646 I MonoDroid: at Bit.Core.Services.UserService.IsAuthenticatedAsync () [0x00071] in :0
04-02 17:41:08.718 30646 30646 I MonoDroid: at Bit.Core.Services.EventService.UploadEventsAsync () [0x00080] in :0
04-02 17:41:08.718 30646 30646 I MonoDroid: at Bit.Droid.Receivers.EventUploadReceiver.OnReceive (Android.Content.Context context, Android.Content.Intent intent) [0x00065] in :0
04-02 17:41:08.718 30646 30646 I MonoDroid: at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__7_0 (System.Object state) [0x00000] in <1caf55231bdd4bb483764b9b31b31ebe>:0
04-02 17:41:08.718 30646 30646 I MonoDroid: at Android.App.SyncContext+<>c__DisplayClass2_0.b__0 () [0x00000] in <2d0de8a221e34f1eb8819be4a9e3a57b>:0
04-02 17:41:08.718 30646 30646 I MonoDroid: at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <2d0de8a221e34f1eb8819be4a9e3a57b>:0
04-02 17:41:08.718 30646 30646 I MonoDroid: at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <2d0de8a221e34f1eb8819be4a9e3a57b>:0
04-02 17:41:08.718 30646 30646 I MonoDroid: at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.28(intptr,intptr)
04-02 17:41:08.724 30646 30646 W x8bit.bitwarde: JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable
04-02 17:41:08.727 30646 30646 D AndroidRuntime: Shutting down VM
04-02 17:41:08.735 30646 30646 E AndroidRuntime: FATAL EXCEPTION: main
04-02 17:41:08.735 30646 30646 E AndroidRuntime: Process: com.x8bit.bitwarden, PID: 30646
04-02 17:41:08.735 30646 30646 E AndroidRuntime: android.runtime.JavaProxyThrowable: System.NotSupportedException: Invalid BsonExpression when converted from Linq expression: i => (i.Id == value(Bit.Core.Services.LiteDbStorageService+<>c__DisplayClass6_01[System.String]).key) - ($._id = @p0)` ---> System.TypeInitializationException: The type initializer for 'LiteDB.BsonExpression' threw an exception. ---> System.ArgumentNullException: Value cannot be null.

┆Issue is synchronized with this Asana task by Unito

Originally created by @roccolord on GitHub (Apr 2, 2020). ## Describe the Bug Starting the app on a Huawei P20 Pro crashes instantly. ## Steps To Reproduce <!-- Comment: 1. Start app ## Expected Result Be able to login. ## Actual Result Crash ## Screenshots or Videos <!-- Comment: If applicable, add screenshots and/or a short video to help explain your problem. --> ## Environment - Device: Huawei P20 Pro - Operating system: Android 9.1 Mars 2020 security fixes - Build Version (go to "Settings" → "About" in the app): 2.3.1 - Is this a Beta release? Y ## Additional Context Crash: 04-02 17:41:08.675 30646 30646 I MonoDroid: UNHANDLED EXCEPTION: 04-02 17:41:08.703 1269 25999 E HiDATA : ***************************period begin *************************** 04-02 17:41:08.703 1269 25999 E HiDATA : QOE_MSG_GET_QUALITY_INFO mPeriodTime = 4000 04-02 17:41:08.705 1269 25999 E HiDATA : updateTcpQualityDate 04-02 17:41:08.705 1269 25999 E HiDATA : reportNetworkInfo isOTADataUpdate = false isTCPDataUpdate = true isUDPDataUpdate = true 04-02 17:41:08.705 1269 25999 E HiDATA : onNetworkInfoUpdate 04-02 17:41:08.705 1269 25997 D HiDATA : QOE_MSG_UPDATE_TCP_INFO isWaittingCheckResult = false 04-02 17:41:08.705 1269 25997 D HiDATA : detectNetworkQuality noUdpAccess = false 04-02 17:41:08.706 1269 25997 E HiDATA : detectTcpNetworkAvailable info.mPeriodTcpRxPacket = 0 info.mPeriodTcpTxPacket = 0 info.mPeriodDnsFailCount = 0 04-02 17:41:08.706 1269 25997 D HiDATA : haveInternetProcess isInternet = true noUdpAccess = false mNetworkDisableCount = 0 04-02 17:41:08.706 1269 25997 E HiDATA : ***************************period end *************************** 04-02 17:41:08.718 30646 30646 I MonoDroid: System.NotSupportedException: Invalid BsonExpression when converted from Linq expression: i => (i.Id == value(Bit.Core.Services.LiteDbStorageService+<>c__DisplayClass6_0`1[System.String]).key) - `($._id = @p0)` ---> System.TypeInitializationException: The type initializer for 'LiteDB.BsonExpression' threw an exception. ---> System.ArgumentNullException: Value cannot be null. 04-02 17:41:08.718 30646 30646 I MonoDroid: Parameter name: method 04-02 17:41:08.718 30646 30646 I MonoDroid: at System.Linq.Expressions.Expression.Call (System.Reflection.MethodInfo method, System.Linq.Expressions.Expression arg0, System.Linq.Expressions.Expression arg1) [0x00068] in <b0037b07c89b44f9bf29887da14b4658>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: at LiteDB.BsonExpressionParser.TryParsePath (LiteDB.Tokenizer tokenizer, LiteDB.ExpressionContext context, System.Boolean isRoot) [0x000de] in <da3b55f2020d4ca38f320e2cd4b6423d>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: at LiteDB.BsonExpressionParser.ParseSingleExpression (LiteDB.Tokenizer tokenizer, LiteDB.ExpressionContext context, System.Boolean isRoot) [0x00094] in <da3b55f2020d4ca38f320e2cd4b6423d>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: at LiteDB.BsonExpressionParser.ParseFullExpression (LiteDB.Tokenizer tokenizer, LiteDB.ExpressionContext context, System.Boolean isRoot) [0x00000] in <da3b55f2020d4ca38f320e2cd4b6423d>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: at LiteDB.BsonExpression.Parse (LiteDB.Tokenizer tokenizer, LiteDB.BsonExpressionParserMode mode, System.Boolean isRoot) [0x00054] in <da3b55f2020d4ca38f320e2cd4b6423d>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: at LiteDB.BsonExpression.Create (System.String expression) [0x00028] in <da3b55f2020d4ca38f320e2cd4b6423d>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: at LiteDB.BsonExpression..cctor () [0x0000a] in <da3b55f2020d4ca38f320e2cd4b6423d>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: --- End of inner exception stack trace --- 04-02 17:41:08.718 30646 30646 I MonoDroid: at LiteDB.LinqExpressionVisitor.Resolve (System.Boolean predicate) [0x00019] in <da3b55f2020d4ca38f320e2cd4b6423d>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: --- End of inner exception stack trace --- 04-02 17:41:08.718 30646 30646 I MonoDroid: at LiteDB.LinqExpressionVisitor.Resolve (System.Boolean predicate) [0x000a4] in <da3b55f2020d4ca38f320e2cd4b6423d>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: at LiteDB.BsonMapper.GetExpression[T,K] (System.Linq.Expressions.Expression`1[TDelegate] predicate) [0x00020] in <da3b55f2020d4ca38f320e2cd4b6423d>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: at LiteDB.LiteCollection`1[T].Find (System.Linq.Expressions.Expression`1[TDelegate] predicate, System.Int32 skip, System.Int32 limit) [0x00000] in <da3b55f2020d4ca38f320e2cd4b6423d>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: at Bit.Core.Services.LiteDbStorageService.GetAsync[T] (System.String key) [0x000fb] in <c357100c811f48f099f33746186395a1>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: at Bit.App.Services.MobileStorageService.GetAsync[T] (System.String key) [0x0013b] in <ab8465693fdb481aa44e5dbe887eb411>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: at Bit.Core.Services.TokenService.GetTokenAsync () [0x00083] in <c357100c811f48f099f33746186395a1>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: at Bit.Core.Services.UserService.IsAuthenticatedAsync () [0x00071] in <c357100c811f48f099f33746186395a1>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: at Bit.Core.Services.EventService.UploadEventsAsync () [0x00080] in <c357100c811f48f099f33746186395a1>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: at Bit.Droid.Receivers.EventUploadReceiver.OnReceive (Android.Content.Context context, Android.Content.Intent intent) [0x00065] in <a6c82668eb8f4c5198b6b5c7270873fe>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) [0x00000] in <1caf55231bdd4bb483764b9b31b31ebe>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: at Android.App.SyncContext+<>c__DisplayClass2_0.<Post>b__0 () [0x00000] in <2d0de8a221e34f1eb8819be4a9e3a57b>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <2d0de8a221e34f1eb8819be4a9e3a57b>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <2d0de8a221e34f1eb8819be4a9e3a57b>:0 04-02 17:41:08.718 30646 30646 I MonoDroid: at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.28(intptr,intptr) 04-02 17:41:08.724 30646 30646 W x8bit.bitwarde: JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable 04-02 17:41:08.727 30646 30646 D AndroidRuntime: Shutting down VM 04-02 17:41:08.735 30646 30646 E AndroidRuntime: FATAL EXCEPTION: main 04-02 17:41:08.735 30646 30646 E AndroidRuntime: Process: com.x8bit.bitwarden, PID: 30646 04-02 17:41:08.735 30646 30646 E AndroidRuntime: android.runtime.JavaProxyThrowable: System.NotSupportedException: Invalid BsonExpression when converted from Linq expression: i => (i.Id == value(Bit.Core.Services.LiteDbStorageService+<>c__DisplayClass6_0`1[System.String]).key) - `($._id = @p0)` ---> System.TypeInitializationException: The type initializer for 'LiteDB.BsonExpression' threw an exception. ---> System.ArgumentNullException: Value cannot be null. ┆Issue is synchronized with this [Asana task](https://app.asana.com/0/1169444489336079/1169620626627328) by [Unito](https://www.unito.io/learn-more)
Author
Owner

@Quicksand10 commented on GitHub (Apr 2, 2020):

Having the same issue. The app logged me out and when I press "LOG IN", I get an instant crash.

Environment

Device: Huawei Mate 10 Pro (BLA-A09)
Operating system: Android EMUI 9.0.0.227 Security Patch January 2020
Build Version: 2.3.1
Is this a Beta release? Y
@Quicksand10 commented on GitHub (Apr 2, 2020): Having the same issue. The app logged me out and when I press "LOG IN", I get an instant crash. **Environment** Device: Huawei Mate 10 Pro (BLA-A09) Operating system: Android EMUI 9.0.0.227 Security Patch January 2020 Build Version: 2.3.1 Is this a Beta release? Y
Author
Owner

@mpbw2 commented on GitHub (Apr 2, 2020):

See #805

@mpbw2 commented on GitHub (Apr 2, 2020): See #805
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#980