android icon indicating copy to clipboard operation
android copied to clipboard

Too many conflicts seems to lead to java.lang.OutOfMemoryError

Open switchboy opened this issue 3 years ago • 3 comments

⚠️ Before posting ⚠️

  • [X] This is a bug, not a question or an enhancement.
  • [X] I've searched for similar issues and didn't find a duplicate.
  • [X] I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
  • [X] I agree to follow Nextcloud's Code of Conduct.

Steps to reproduce

Install next loud app on device with a load of pictures and sync

Factory reset without formatting SDcard

Install next loud app again and re-enable auto upload

Have conflicts with more then 2000 files with exactly the same content

Run out of memory on the device

Expected behaviour

Either Skip over duplicates (preferred)

Not run out of memory

Actual behaviour

Cause of error

Exception in thread "Thread-7" java.lang.OutOfMemoryError: Failed to allocate a 40 byte allocation with 4138920 free bytes and 4041KB until OOM, target footprint 536870912, growth limit 536870912; giving up on allocation because <1% of heap free after GC.
    at sun.security.util.DerValue.getDataBytes(DerValue.java:648)
    at sun.security.x509.AVA.toRFC2253CanonicalString(AVA.java:933)
    at sun.security.x509.RDN.toRFC2253StringInternal(RDN.java:444)
    at sun.security.x509.RDN.toRFC2253String(RDN.java:424)
    at sun.security.x509.X500Name.getRFC2253CanonicalName(X500Name.java:730)
    at sun.security.x509.X500Name.hashCode(X500Name.java:383)
    at javax.security.auth.x500.X500Principal.hashCode(X500Principal.java:487)
    at java.util.HashMap.hash(HashMap.java:338)
    at java.util.LinkedHashMap.get(LinkedHashMap.java:464)
    at okhttp3.internal.tls.BasicTrustRootIndex.<init>(BasicTrustRootIndex.kt:57)
    at okhttp3.internal.platform.Platform.buildTrustRootIndex(Platform.kt:163)
    at okhttp3.internal.platform.Platform.buildCertificateChainCleaner(Platform.kt:160)
    at okhttp3.internal.platform.Android10Platform.buildCertificateChainCleaner(Android10Platform.kt:82)
    at okhttp3.internal.tls.CertificateChainCleaner$Companion.get(CertificateChainCleaner.kt:42)
    at okhttp3.OkHttpClient$Builder.sslSocketFactory(OkHttpClient.kt:870)
    at com.nextcloud.common.PlainClient$Companion.createDefaultClient(PlainClient.kt:62)
    at com.nextcloud.common.PlainClient$Companion.access$createDefaultClient(PlainClient.kt:47)
    at com.nextcloud.common.PlainClient.<init>(PlainClient.kt:45)
    at com.nextcloud.client.network.ClientFactoryImpl.createPlainClient(ClientFactoryImpl.java:94)
    at com.nextcloud.client.network.ConnectivityServiceImpl.isInternetWalled(ConnectivityServiceImpl.java:79)
    at com.owncloud.android.files.services.FileUploader.retryFailedUploads(FileUploader.java:1093)
    at com.owncloud.android.utils.FilesSyncHelper.lambda$restartJobsIfNeeded$0(FilesSyncHelper.java:240)
    at com.owncloud.android.utils.FilesSyncHelper$$ExternalSyntheticLambda0.run(Unknown Source:10)
    at java.lang.Thread.run(Thread.java:920)

App information

  • ID: com.nextcloud.client
  • Version: 30210090
  • Build flavor: gplay

Device information

  • Brand: samsung
  • Device: heroltexx
  • Model: SM-G930F
  • Id: SQ3A.220705.003.A1
  • Product: heroltexx

Firmware

  • SDK: 32
  • Release: 12
  • Incremental: eng.ivanme.20220806.144850

Android version

12.1l

Device brand and model

s7

Stock or custom OS?

Custom (explain in "additional information")

Nextcloud android app version

30210090

Nextcloud server version

22.2.3

Using a reverse proxy?

Yes

Android logs

No response

Server error logs

No response

Additional information

LOS 19.1

switchboy avatar Aug 16 '22 19:08 switchboy

I have exactly the same issue using the 3.21.0 release from F-Droid on Android 12.

When there is too much conflicts detected, the app crashes with an Out Of Memory Error.

However, I think that the root cause of the problem is that there is way too much false positives. For instance, if the app is reinstalled after being used for some time, having already uploaded many images, and the option "Upload existing" is used, a lot of files will already be present on the server.

The client will consider those as conflicting files, whereas they are exactly the same.

Could the client check the checksums of the remote file and the local file before declaring a conflict? It would avoid such bugs, and it would also greatly improve the user experience.

aviallon avatar Aug 27 '22 13:08 aviallon

Same here. Never ending sync for days on both phones.

cieska avatar Oct 15 '22 08:10 cieska

Same sitiuation after nextcloud IP change. Before intenral home IP, Public IP after change. App try to sync 5000 photos, i recive conflict notification and app crash

MaciejIwan avatar Nov 18 '23 20:11 MaciejIwan