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

android.os.TransactionTooLargeException: contacts don't get synced to database #8418

Closed
4 tasks done
ilf opened this issue Dec 1, 2018 · 5 comments
Closed
4 tasks done

Comments

@ilf
Copy link

ilf commented Dec 1, 2018


Bug description

contacts don't get synced to database, error android.os.TransactionTooLargeException

Steps to reproduce

Expected result: sync contacts to database and show Signal contacts
Actual result: contacts don't get synced to database, error android.os.TransactionTooLargeException

Device info

Android version: 7.1.2
Signal version: 4.30.8 to at least 4.32.8

Link to debug log

12-01 20:03:49.547  6680  9641 E JavaBinder: !!! FAILED BINDER TRANSACTION !!!  (parcel size = 1127380)
12-01 20:03:49.548  6680  9641 W DirectoryHelper: null
12-01 20:03:49.548  6680  9641 W DirectoryHelper: android.os.TransactionTooLargeException: data parcel size 1127380 bytes
12-01 20:03:49.548  6680  9641 W DirectoryHelper:       at android.os.BinderProxy.transactNative(Native Method)
12-01 20:03:49.548  6680  9641 W DirectoryHelper:       at android.os.BinderProxy.transact(Binder.java:615)
12-01 20:03:49.548  6680  9641 W DirectoryHelper:       at android.content.ContentProviderProxy.applyBatch(ContentProviderNative.java:518)
12-01 20:03:49.548  6680  9641 W DirectoryHelper:       at android.content.ContentProviderClient.applyBatch(ContentProviderClient.java:438)
12-01 20:03:49.548  6680  9641 W DirectoryHelper:       at android.content.ContentResolver.applyBatch(ContentResolver.java:1318)
12-01 20:03:49.548  6680  9641 W DirectoryHelper:       at org.thoughtcrime.securesms.contacts.ContactsDatabase.setRegisteredUsers(ContactsDatabase.java:140)
12-01 20:03:49.548  6680  9641 W DirectoryHelper:       at org.thoughtcrime.securesms.util.DirectoryHelper.updateContactsDatabase(DirectoryHelper.java:188)
12-01 20:03:49.548  6680  9641 W DirectoryHelper:       at org.thoughtcrime.securesms.util.DirectoryHelper.lambda$getLegacyDirectoryResult$1$DirectoryHelper(DirectoryHelper.java:309)
12-01 20:03:49.548  6680  9641 W DirectoryHelper:       at org.thoughtcrime.securesms.util.DirectoryHelper$$Lambda$3.call(Unknown Source)
12-01 20:03:49.548  6680  9641 W DirectoryHelper:       at java.util.concurrent.FutureTask.run(FutureTask.java:237)
12-01 20:03:49.548  6680  9641 W DirectoryHelper:       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
12-01 20:03:49.548  6680  9641 W DirectoryHelper:       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
12-01 20:03:49.548  6680  9641 W DirectoryHelper:       at java.lang.Thread.run(Thread.java:761)

History and Patch

This has previously been reported at #7394, where @moxie0 acknowleged it, praised the "really well researched report" and the reporter even submitted a proposed patch: #7394 (comment)

diff --git a/src/org/thoughtcrime/securesms/contacts/ContactsDatabase.java b/src/org/thoughtcrime/securesms/contacts/ContactsDatabase.java
index 34c0e6f6..7078ae49 100644
--- a/src/org/thoughtcrime/securesms/contacts/ContactsDatabase.java
+++ b/src/org/thoughtcrime/securesms/contacts/ContactsDatabase.java
@@ -115,11 +115,12 @@ public class ContactsDatabase {
         Log.w(TAG, "Updating display name: " + currentContactEntry.getKey());
         updateDisplayName(operations, currentContactEntry.getValue().getAggregateDisplayName(), currentContactEntry.getValue().getId(), currentContactEntry.getValue().getDisplayNameSource());
       }
+      if (!operations.isEmpty()) {
+        context.getContentResolver().applyBatch(ContactsContract.AUTHORITY, operations);
+      }
     }
 
-    if (!operations.isEmpty()) {
-      context.getContentResolver().applyBatch(ContactsContract.AUTHORITY, operations);
-    }
+
   }
 
   @NonNull Cursor querySystemContacts(@Nullable String filter) {

The issue was auto-closed by #7598, but I verified it still occurs with the current release of Signal, so I take the liberty to re-submit it according to #7598

@ilf
Copy link
Author

ilf commented Dec 18, 2018

Upgraded to 4.31.6 and tried again, same error:

12-18 17:41:00.543 17162 19682 I ContactsDatabase: Adding number: +[redacted]
12-18 17:41:00.577 17162 19682 I ContactsDatabase: Adding number: +[redacted]
12-18 17:41:00.676 17162 19682 E JavaBinder: !!! FAILED BINDER TRANSACTION !!!  (parcel size = 1149504)
12-18 17:41:00.677 17162 19682 W DirectoryHelper: null
12-18 17:41:00.677 17162 19682 W DirectoryHelper: android.os.TransactionTooLargeException: data parcel size 1149504 bytes
12-18 17:41:00.677 17162 19682 W DirectoryHelper:       at android.os.BinderProxy.transactNative(Native Method)
12-18 17:41:00.677 17162 19682 W DirectoryHelper:       at android.os.BinderProxy.transact(Binder.java:615)
12-18 17:41:00.677 17162 19682 W DirectoryHelper:       at android.content.ContentProviderProxy.applyBatch(ContentProviderNative.java:518)
12-18 17:41:00.677 17162 19682 W DirectoryHelper:       at android.content.ContentProviderClient.applyBatch(ContentProviderClient.java:438)
12-18 17:41:00.677 17162 19682 W DirectoryHelper:       at android.content.ContentResolver.applyBatch(ContentResolver.java:1318)
12-18 17:41:00.677 17162 19682 W DirectoryHelper:       at org.thoughtcrime.securesms.contacts.ContactsDatabase.setRegisteredUsers(ContactsDatabase.java:140)
12-18 17:41:00.677 17162 19682 W DirectoryHelper:       at org.thoughtcrime.securesms.util.DirectoryHelper.updateContactsDatabase(DirectoryHelper.java:188)
12-18 17:41:00.677 17162 19682 W DirectoryHelper:       at org.thoughtcrime.securesms.util.DirectoryHelper.lambda$getLegacyDirectoryResult$1$DirectoryHelper(DirectoryHelper.java:309)
12-18 17:41:00.677 17162 19682 W DirectoryHelper:       at org.thoughtcrime.securesms.util.DirectoryHelper$$Lambda$3.call(Unknown Source)
12-18 17:41:00.677 17162 19682 W DirectoryHelper:       at java.util.concurrent.FutureTask.run(FutureTask.java:237)
12-18 17:41:00.677 17162 19682 W DirectoryHelper:       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
12-18 17:41:00.677 17162 19682 W DirectoryHelper:       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
12-18 17:41:00.677 17162 19682 W DirectoryHelper:       at java.lang.Thread.run(Thread.java:761)

@ilf
Copy link
Author

ilf commented Jan 13, 2019

Upgraded to 4.31.7, same error:

01-13 15:02:26.647  3524  8540 W PushServiceSocket: Push service URL: https://textsecure-service.whispersystems.org
01-13 15:02:26.647  3524  8540 W PushServiceSocket: Opening URL: https://textsecure-service.whispersystems.org/v1/directory/tokens
01-13 15:02:27.711  3524  8540 V Cursor  : Filling cursor window with start position:0 required position:0
01-13 15:02:27.719  3524  8540 V Cursor  : Filling cursor window with start position:0 required position:0
01-13 15:02:39.863  3524  8540 I ContactsDatabase: Adding number: +[redacted]
<snip>
01-13 15:02:53.238  3524  8540 I ContactsDatabase: Adding number: +[redacted]
01-13 15:02:53.239  3524  8540 I ContactsDatabase: Updating display name: +[redacted]
01-13 15:02:53.341  3524  8540 E JavaBinder: !!! FAILED BINDER TRANSACTION !!!  (parcel size = 1172296)
01-13 15:02:53.352  3524  8540 W DirectoryHelper: null
01-13 15:02:53.352  3524  8540 W DirectoryHelper: android.os.TransactionTooLargeException: data parcel size 1172296 bytes
01-13 15:02:53.352  3524  8540 W DirectoryHelper:       at android.os.BinderProxy.transactNative(Native Method)
01-13 15:02:53.352  3524  8540 W DirectoryHelper:       at android.os.BinderProxy.transact(Binder.java:615)
01-13 15:02:53.352  3524  8540 W DirectoryHelper:       at android.content.ContentProviderProxy.applyBatch(ContentProviderNative.java:518)
01-13 15:02:53.352  3524  8540 W DirectoryHelper:       at android.content.ContentProviderClient.applyBatch(ContentProviderClient.java:438)
01-13 15:02:53.352  3524  8540 W DirectoryHelper:       at android.content.ContentResolver.applyBatch(ContentResolver.java:1318)
01-13 15:02:53.352  3524  8540 W DirectoryHelper:       at org.thoughtcrime.securesms.contacts.ContactsDatabase.setRegisteredUsers(ContactsDatabase.java:140)
01-13 15:02:53.352  3524  8540 W DirectoryHelper:       at org.thoughtcrime.securesms.util.DirectoryHelper.updateContactsDatabase(DirectoryHelper.java:188)
01-13 15:02:53.352  3524  8540 W DirectoryHelper:       at org.thoughtcrime.securesms.util.DirectoryHelper.lambda$getLegacyDirectoryResult$1$DirectoryHelper(DirectoryHelper.java:309)
01-13 15:02:53.352  3524  8540 W DirectoryHelper:       at org.thoughtcrime.securesms.util.DirectoryHelper$$Lambda$3.call(Unknown Source)
01-13 15:02:53.352  3524  8540 W DirectoryHelper:       at java.util.concurrent.FutureTask.run(FutureTask.java:237)
01-13 15:02:53.352  3524  8540 W DirectoryHelper:       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
01-13 15:02:53.352  3524  8540 W DirectoryHelper:       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
01-13 15:02:53.352  3524  8540 W DirectoryHelper:       at java.lang.Thread.run(Thread.java:761)

@ilf
Copy link
Author

ilf commented Jan 13, 2019

Wow, another update on the same day. Here goes 4.31.8:

01-13 22:02:38.597 17403 17556 W PushServiceSocket: Push service URL: https://textsecure-service.whispersystems.org
01-13 22:02:38.598 17403 17556 W PushServiceSocket: Opening URL: https://textsecure-service.whispersystems.org/v1/directory/tokens
01-13 22:02:39.763 17403 17556 V Cursor  : Filling cursor window with start position:0 required position:0
01-13 22:02:39.779 17403 17556 V Cursor  : Filling cursor window with start position:0 required position:0
01-13 22:02:52.865 17403 17556 I ContactsDatabase: Adding number: +[redacted]
<snip>
01-13 22:03:06.548 17403 17556 I ContactsDatabase: Adding number: +[redacted]
01-13 22:03:06.549 17403 17556 I ContactsDatabase: Updating display name: +[redacted]
01-13 22:03:06.652 17403 17556 E JavaBinder: !!! FAILED BINDER TRANSACTION !!!  (parcel size = 1172296)
01-13 22:03:06.657 17403 17556 W DirectoryHelper: null
01-13 22:03:06.657 17403 17556 W DirectoryHelper: android.os.TransactionTooLargeException: data parcel size 1172296 bytes
01-13 22:03:06.657 17403 17556 W DirectoryHelper:       at android.os.BinderProxy.transactNative(Native Method)
01-13 22:03:06.657 17403 17556 W DirectoryHelper:       at android.os.BinderProxy.transact(Binder.java:615)
01-13 22:03:06.657 17403 17556 W DirectoryHelper:       at android.content.ContentProviderProxy.applyBatch(ContentProviderNative.java:518)
01-13 22:03:06.657 17403 17556 W DirectoryHelper:       at android.content.ContentProviderClient.applyBatch(ContentProviderClient.java:438)
01-13 22:03:06.657 17403 17556 W DirectoryHelper:       at android.content.ContentResolver.applyBatch(ContentResolver.java:1318)
01-13 22:03:06.657 17403 17556 W DirectoryHelper:       at org.thoughtcrime.securesms.contacts.ContactsDatabase.setRegisteredUsers(ContactsDatabase.java:140)
01-13 22:03:06.657 17403 17556 W DirectoryHelper:       at org.thoughtcrime.securesms.util.DirectoryHelper.updateContactsDatabase(DirectoryHelper.java:188)
01-13 22:03:06.657 17403 17556 W DirectoryHelper:       at org.thoughtcrime.securesms.util.DirectoryHelper.lambda$getLegacyDirectoryResult$1$DirectoryHelper(DirectoryHelper.java:309)
01-13 22:03:06.657 17403 17556 W DirectoryHelper:       at org.thoughtcrime.securesms.util.DirectoryHelper$$Lambda$3.call(Unknown Source)
01-13 22:03:06.657 17403 17556 W DirectoryHelper:       at java.util.concurrent.FutureTask.run(FutureTask.java:237)
01-13 22:03:06.657 17403 17556 W DirectoryHelper:       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
01-13 22:03:06.657 17403 17556 W DirectoryHelper:       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
01-13 22:03:06.657 17403 17556 W DirectoryHelper:       at java.lang.Thread.run(Thread.java:761)

@ilf
Copy link
Author

ilf commented Jan 24, 2019

Verified in 4.32.8. I'll spare the log output, it's more of the same.

@greyson-signal
Copy link
Contributor

I believe this is fixed. See #8580.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants