Android app crashed due to a Newtonsoft.Json.JsonReaderException #1593

Closed
opened 2025-11-26 22:53:12 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @PylotLight on GitHub (Feb 11, 2023).

Steps To Reproduce

  1. Go to android app and add my selfhosted bitwarden instance as base server
  2. Click on login

Expected Result

Logs in normally

Actual Result

The log shows that the app crashed due to a Newtonsoft.Json.JsonReaderException.
The error message suggests that the JSON value that the app was trying to parse was not properly formatted and it could not parse it because it started with the character '<'.

The log also shows that the app was running on an Android device with the OS version of "google/barbet/barbet:13/TQ1A.230205.002/2023020600:user/release-keys".

Screenshots or Videos

No response

Additional Context

`
type: crash
osVersion: google/barbet/barbet:13/TQ1A.230205.002/2023020600:user/release-keys
package: com.x8bit.bitwarden:5247
process: com.x8bit.bitwarden
processUptime: 18293 + 275 ms

android.runtime.JavaProxyThrowable: Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
  at Newtonsoft.Json.JsonTextReader.ParseValue () [0x002b3] in <7ca8898b690a4181a32a9cf767cedb1e>:0 
  at Newtonsoft.Json.JsonTextReader.Read () [0x0004c] in <7ca8898b690a4181a32a9cf767cedb1e>:0 
  at Newtonsoft.Json.JsonReader.ReadAndMoveToContent () [0x00000] in <7ca8898b690a4181a32a9cf767cedb1e>:0 
  at Newtonsoft.Json.JsonReader.ReadForType (Newtonsoft.Json.Serialization.JsonContract contract, System.Boolean hasConverter) [0x0004a] in <7ca8898b690a4181a32a9cf767cedb1e>:0 
  at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Boolean checkAdditionalContent) [0x000db] in <7ca8898b690a4181a32a9cf767cedb1e>:0 
  at Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00054] in <7ca8898b690a4181a32a9cf767cedb1e>:0 
  at Newtonsoft.Json.JsonSerializer.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00000] in <7ca8898b690a4181a32a9cf767cedb1e>:0 
  at Newtonsoft.Json.JsonConvert.DeserializeObject (System.String value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) [0x0002d] in <7ca8898b690a4181a32a9cf767cedb1e>:0 
  at Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value, Newtonsoft.Json.JsonSerializerSettings settings) [0x00000] in <7ca8898b690a4181a32a9cf767cedb1e>:0 
  at Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value) [0x00000] in <7ca8898b690a4181a32a9cf767cedb1e>:0 
  at Bit.Core.Services.ApiService.SendAsync[TRequest,TResponse] (System.Net.Http.HttpMethod method, System.String path, TRequest body, System.Boolean authed, System.Boolean hasResponse, System.Boolean logoutOnUnauthorized) [0x00407] in <46892b02e3ad470da646aaca3a0dc975>:0 
  at Bit.Core.Services.AuthService.MakePreloginKeyAsync (System.String masterPassword, System.String email) [0x000c5] in <46892b02e3ad470da646aaca3a0dc975>:0 
  at Bit.Core.Services.AuthService.LogInAsync (System.String email, System.String masterPassword, System.String captchaToken) [0x000b0] in <46892b02e3ad470da646aaca3a0dc975>:0 
  at Bit.App.Pages.LoginPageViewModel.LogInAsync (System.Boolean showLoading, System.Boolean checkForExistingAccount) [0x0066a] in <94846ffbb67f4441960869341097463f>:0 
  at Bit.App.Pages.LoginPage.LogIn_Clicked (System.Object sender, System.EventArgs e) [0x00095] in <94846ffbb67f4441960869341097463f>:0 
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) [0x00000] in <3d68fce0fd854c1cbbeae89668c2c501>:0 
  at Android.App.SyncContext+<>cDisplayClass2_0.<Post>b0 () [0x00000] in <09f72489eac049bfb8b4a269e275f79b>:0 
  at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <09f72489eac049bfb8b4a269e275f79b>:0 
  at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <09f72489eac049bfb8b4a269e275f79b>:0 
  at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PP_V (_JniMarshal_PP_V callback, System.IntPtr jnienv, System.IntPtr klazz) [0x00005] in <09f72489eac049bfb8b4a269e275f79b>:0 
 at mono.java.lang.RunnableImplementor.n_run(Native Method)
 at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:31)
 at android.os.Handler.handleCallback(Handler.java:942)
 at android.os.Handler.dispatchMessage(Handler.java:99)
 at android.os.Looper.loopOnce(Looper.java:201)
 at android.os.Looper.loop(Looper.java:288)
 at android.app.ActivityThread.main(ActivityThread.java:7879)
 at java.lang.reflect.Method.invoke(Native Method)
 at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
 at com.android.internal.os.ExecInit.main(ExecInit.java:49)
 at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
 at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:355)

`

Operating System

Android

Operating System Version

A12

Device

Pixel 5a

Build Version

2022.10.0

Beta

  • Using a pre-release version of the application.
Originally created by @PylotLight on GitHub (Feb 11, 2023). ### Steps To Reproduce 1. Go to android app and add my selfhosted bitwarden instance as base server 2. Click on login ### Expected Result Logs in normally ### Actual Result The log shows that the app crashed due to a Newtonsoft.Json.JsonReaderException. The error message suggests that the JSON value that the app was trying to parse was not properly formatted and it could not parse it because it started with the character '<'. The log also shows that the app was running on an Android device with the OS version of "google/barbet/barbet:13/TQ1A.230205.002/2023020600:user/release-keys". ### Screenshots or Videos _No response_ ### Additional Context ``` ` type: crash osVersion: google/barbet/barbet:13/TQ1A.230205.002/2023020600:user/release-keys package: com.x8bit.bitwarden:5247 process: com.x8bit.bitwarden processUptime: 18293 + 275 ms android.runtime.JavaProxyThrowable: Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0. at Newtonsoft.Json.JsonTextReader.ParseValue () [0x002b3] in <7ca8898b690a4181a32a9cf767cedb1e>:0 at Newtonsoft.Json.JsonTextReader.Read () [0x0004c] in <7ca8898b690a4181a32a9cf767cedb1e>:0 at Newtonsoft.Json.JsonReader.ReadAndMoveToContent () [0x00000] in <7ca8898b690a4181a32a9cf767cedb1e>:0 at Newtonsoft.Json.JsonReader.ReadForType (Newtonsoft.Json.Serialization.JsonContract contract, System.Boolean hasConverter) [0x0004a] in <7ca8898b690a4181a32a9cf767cedb1e>:0 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Boolean checkAdditionalContent) [0x000db] in <7ca8898b690a4181a32a9cf767cedb1e>:0 at Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00054] in <7ca8898b690a4181a32a9cf767cedb1e>:0 at Newtonsoft.Json.JsonSerializer.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00000] in <7ca8898b690a4181a32a9cf767cedb1e>:0 at Newtonsoft.Json.JsonConvert.DeserializeObject (System.String value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings) [0x0002d] in <7ca8898b690a4181a32a9cf767cedb1e>:0 at Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value, Newtonsoft.Json.JsonSerializerSettings settings) [0x00000] in <7ca8898b690a4181a32a9cf767cedb1e>:0 at Newtonsoft.Json.JsonConvert.DeserializeObject[T] (System.String value) [0x00000] in <7ca8898b690a4181a32a9cf767cedb1e>:0 at Bit.Core.Services.ApiService.SendAsync[TRequest,TResponse] (System.Net.Http.HttpMethod method, System.String path, TRequest body, System.Boolean authed, System.Boolean hasResponse, System.Boolean logoutOnUnauthorized) [0x00407] in <46892b02e3ad470da646aaca3a0dc975>:0 at Bit.Core.Services.AuthService.MakePreloginKeyAsync (System.String masterPassword, System.String email) [0x000c5] in <46892b02e3ad470da646aaca3a0dc975>:0 at Bit.Core.Services.AuthService.LogInAsync (System.String email, System.String masterPassword, System.String captchaToken) [0x000b0] in <46892b02e3ad470da646aaca3a0dc975>:0 at Bit.App.Pages.LoginPageViewModel.LogInAsync (System.Boolean showLoading, System.Boolean checkForExistingAccount) [0x0066a] in <94846ffbb67f4441960869341097463f>:0 at Bit.App.Pages.LoginPage.LogIn_Clicked (System.Object sender, System.EventArgs e) [0x00095] in <94846ffbb67f4441960869341097463f>:0 at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) [0x00000] in <3d68fce0fd854c1cbbeae89668c2c501>:0 at Android.App.SyncContext+<>cDisplayClass2_0.<Post>b0 () [0x00000] in <09f72489eac049bfb8b4a269e275f79b>:0 at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <09f72489eac049bfb8b4a269e275f79b>:0 at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <09f72489eac049bfb8b4a269e275f79b>:0 at Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PP_V (_JniMarshal_PP_V callback, System.IntPtr jnienv, System.IntPtr klazz) [0x00005] in <09f72489eac049bfb8b4a269e275f79b>:0 at mono.java.lang.RunnableImplementor.n_run(Native Method) at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:31) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7879) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ExecInit.main(ExecInit.java:49) at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:355) ` ``` ### Operating System Android ### Operating System Version A12 ### Device Pixel 5a ### Build Version 2022.10.0 ### Beta - [ ] Using a pre-release version of the application.
GiteaMirror added the bug label 2025-11-26 22:53:12 -06:00
Author
Owner

@SergeantConfused commented on GitHub (Feb 13, 2023):

Hi @PylotLight,

I am unable to reproduce this issue, it has been escalated for further investigation. If you have more information that can help us, please add it below.

Thank you.

@SergeantConfused commented on GitHub (Feb 13, 2023): Hi @PylotLight, I am unable to reproduce this issue, it has been escalated for further investigation. If you have more information that can help us, please add it below. Thank you.
Author
Owner

@PylotLight commented on GitHub (Feb 13, 2023):

My current guess is that my reverse proxy authelia is in front of it and seeing the character is "<" I'm thinking that the response the app gets is a html page from cloudflare or authelia saying it's not authed properly, but this doesn't happen on the browser extensions.
If I was to fix this, I would like to have debug info on what call is being made while I login, and if the response data is a webpage with an auth error then say that.

I will do some testing on my side but that's my current thoughts as the browser extensions and deskop apps work just fine with the self hosted server.

@PylotLight commented on GitHub (Feb 13, 2023): My current guess is that my reverse proxy authelia is in front of it and seeing the character is "<" I'm thinking that the response the app gets is a html page from cloudflare or authelia saying it's not authed properly, but this doesn't happen on the browser extensions. If I was to fix this, I would like to have debug info on what call is being made while I login, and if the response data is a webpage with an auth error then say that. I will do some testing on my side but that's my current thoughts as the browser extensions and deskop apps work just fine with the self hosted server.
Author
Owner

@PylotLight commented on GitHub (Feb 14, 2023):

Confirmed it was Authelia which I changed policy to bypass for. Ideally there would be a way to handle reverse proxy authentication and redirecting to the browser for login or something.

@PylotLight commented on GitHub (Feb 14, 2023): Confirmed it was Authelia which I changed policy to bypass for. Ideally there would be a way to handle reverse proxy authentication and redirecting to the browser for login or something.
Author
Owner

@trmartin4 commented on GitHub (Feb 11, 2024):

As this was resolved with Authelia configuration, I will close this. Please let us know if you have any other issues.

@trmartin4 commented on GitHub (Feb 11, 2024): As this was resolved with Authelia configuration, I will close this. Please let us know if you have any other issues.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#1593