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

Upgrading to Android SDK 18.2.0 can produce an unhandled exception if there are unsent logs "Protocol message contained an invalid tag (zero)" #52

Closed
1 of 4 tasks
tapeo opened this issue May 16, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@tapeo
Copy link

tapeo commented May 16, 2023

Describe the bug

Crash when no internet available

Integration Method

  • SPM (iOS)
  • Cocoapods (iOS)
  • Direct Download (iOS)
  • GMaven (Android)

SDK Version (e.g. 18.0.1):

18.2.0

To Reproduce

Disable device internet

Additional context

E/AndroidRuntime( 5575): com.google.android.recaptcha.internal.zzhp: Failed to parse the message.
E/AndroidRuntime( 5575): 	at com.google.android.recaptcha.internal.zzis.zzi(com.google.android.recaptcha:recaptcha@@18.2.0:52)
E/AndroidRuntime( 5575): 	at com.google.android.recaptcha.internal.zzex.zzo(com.google.android.recaptcha:recaptcha@@18.2.0:4)
E/AndroidRuntime( 5575): 	at com.google.android.recaptcha.internal.zzis.zzs(com.google.android.recaptcha:recaptcha@@18.2.0:22)
E/AndroidRuntime( 5575): 	at com.google.android.recaptcha.internal.zzis.zzi(com.google.android.recaptcha:recaptcha@@18.2.0:48)
E/AndroidRuntime( 5575): 	at com.google.android.recaptcha.internal.zzhf.zzi(com.google.android.recaptcha:recaptcha@@18.2.0:4)
E/AndroidRuntime( 5575): 	at com.google.android.recaptcha.internal.zzhf.zzu(com.google.android.recaptcha:recaptcha@@18.2.0:1)
E/AndroidRuntime( 5575): 	at com.google.android.recaptcha.internal.zzmy.zzk(com.google.android.recaptcha:recaptcha@@18.2.0:1)
E/AndroidRuntime( 5575): 	at com.google.android.recaptcha.internal.zzao.zzg(com.google.android.recaptcha:recaptcha@@18.2.0:6)
E/AndroidRuntime( 5575): 	at com.google.android.recaptcha.internal.zzao.zzd(com.google.android.recaptcha:recaptcha@@18.2.0:1)
E/AndroidRuntime( 5575): 	at com.google.android.recaptcha.internal.zzan.invokeSuspend(com.google.android.recaptcha:recaptcha@@18.2.0:15)
E/AndroidRuntime( 5575): 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
E/AndroidRuntime( 5575): 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
E/AndroidRuntime( 5575): 	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
E/AndroidRuntime( 5575): 	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
E/AndroidRuntime( 5575): 	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
E/AndroidRuntime( 5575): 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
E/AndroidRuntime( 5575): 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
E/AndroidRuntime( 5575): 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
E/AndroidRuntime( 5575): 	Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@448a49b, Dispatchers.IO]
@tapeo tapeo added the bug Something isn't working label May 16, 2023
@mcorner
Copy link
Collaborator

mcorner commented May 16, 2023

Thanks for the report and we will look into it. We can't immediately reproduce that with no internet. Do you have any more details on how you triggered this? Are you just disabling internet on the device with airplane mode etc? Does this happen every time? Did this happen on earlier SDKs?

Internal bug reference: b/282909604

@tapeo tapeo closed this as completed May 23, 2023
@tapeo tapeo reopened this May 23, 2023
@tapeo
Copy link
Author

tapeo commented May 23, 2023

Sometimes it happens after execute setup, but maybe is not due to no network.
Is this something related to the internal behaviour of the lib?

D/RecaptchaPlugin: Network Error
E/AndroidRuntime: FATAL EXCEPTION: DefaultDispatcher-worker-4
    com.google.android.recaptcha.internal.zzhp: Protocol message contained an invalid tag (zero).
        at com.google.android.recaptcha.internal.zzex.zzi(com.google.android.recaptcha:recaptcha@@18.2.0:15)
        at com.google.android.recaptcha.internal.zzis.zzi(com.google.android.recaptcha:recaptcha@@18.2.0:50)
        at com.google.android.recaptcha.internal.zzex.zzo(com.google.android.recaptcha:recaptcha@@18.2.0:4)
        at com.google.android.recaptcha.internal.zzis.zzs(com.google.android.recaptcha:recaptcha@@18.2.0:22)
        at com.google.android.recaptcha.internal.zzis.zzi(com.google.android.recaptcha:recaptcha@@18.2.0:48)
        at com.google.android.recaptcha.internal.zzhf.zzi(com.google.android.recaptcha:recaptcha@@18.2.0:4)
        at com.google.android.recaptcha.internal.zzhf.zzu(com.google.android.recaptcha:recaptcha@@18.2.0:1)
        at com.google.android.recaptcha.internal.zzmy.zzk(com.google.android.recaptcha:recaptcha@@18.2.0:1)
        at com.google.android.recaptcha.internal.zzao.zzg(com.google.android.recaptcha:recaptcha@@18.2.0:6)
        at com.google.android.recaptcha.internal.zzao.zzd(com.google.android.recaptcha:recaptcha@@18.2.0:1)
        at com.google.android.recaptcha.internal.zzan.invokeSuspend(com.google.android.recaptcha:recaptcha@@18.2.0:15)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
        at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:749)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
    	Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@ecb726e, Dispatchers.IO]
I/Process: Sending signal. PID: 5421 SIG: 9

@mcorner
Copy link
Collaborator

mcorner commented May 23, 2023

@tapeo We know where in the code this is happening and we know how to fix it. However, we haven't found a reproduction of it yet. It is unlikely to have anything to do with being connected or not connected.

Can you tell me a few things?

  1. This is happening locally, correct? Not in production?
  2. Have you used any previous versions of the SDK on this device?
  3. Does it happen on this device every time you call getClient or execute?
  4. Does this happen on multiple devices?
  5. Can you tell me the OS version of your Android device?
  6. Can you send me the file stored on the device //data/data/<Your-Application-Package-Name>/databases/cesdb? You can put it somewhere and give me a link at my first name and my last name put together at google.com
  7. Erase the app and try again.

Thanks for your help,
-Mark

@mcorner
Copy link
Collaborator

mcorner commented May 26, 2023

@tapeo We have reproduced this. This can occur if:
A) an app was using a previous Android SDK version
AND
B) A user uses the app, but did not have internet or for some reason reCAPTCHA was unable to send its logs
AND
C) The app is upgraded to 18.2.0

We are urgently working on a fix that will very likely only be fixed by a new Android SDK release (18.2.1)

@mcorner mcorner changed the title Crash when internet connection not available Upgrading to Android SDK 18.2.0 can produce an unhandled exception if there are unsent logs "Protocol message contained an invalid tag (zero)" May 26, 2023
@mcorner
Copy link
Collaborator

mcorner commented May 30, 2023

Great news: 18.2.1 is out and has the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants