Large amount of file uploads fail; restarting causes crash
- Dominant language
- Kotlin
- Stars
- 5.6k
- Forks
- 2k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 92
Description
### ⚠️ Before posting ⚠️
- [X] This is a **bug**, not a question or an enhancement.
- [X] I've [searched for similar issues](https://github.com/nextcloud/android/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](https://nextcloud.com/contribute/code-of-conduct/).
### Steps to reproduce
1. attempt to manually upload a lot of files to my nextcloud server using the android app
2. a few files go through, but most (500+ files) fail to upload
3. press the restart/refresh icon to restart the upload process for these failed files.
4. only a few files restart the upload process, so I click the refresh button a few more times
5. crash
### Expected behaviour
The files should upload to the server. If files fail to upload, the upload should restart with one click and no crash.
### Actual behaviour
The file uploads repeatedly fail (even when the app is open and the phone is on and unlocked). The app crashes when I press the "restart" icon too many times in an attempt to restart failed uploads (as clicking restart one time seems to restart a few file uploads at a time).
### Android version
13
### Device brand and model
Google Pixel 5a
### Stock or custom OS?
Custom (explain in "additional information")
### Nextcloud android app version
3.22.3
### Nextcloud server version
25.0.1
### Using a reverse proxy?
Yes
### Android logs
### Cause of error
```java
Exception in thread "Thread-75" java.lang.OutOfMemoryError: Failed to allocate a 40 byte allocation with 992168 free bytes and 968KB until OOM, target footprint 268435456, growth limit 268435456; giving up on allocation because <1% of heap free after GC.
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at java.security.Provider$Service.newInstance(Provider.java:1635)
at sun.security.jca.GetInstance.getInstance(GetInstance.java:236)
at sun.security.jca.GetInstance.getInstance(GetInstance.java:164)
at java.security.Security.getImpl(Security.java:628)
at java.security.MessageDigest.getInstance(MessageDigest.java:211)
at android.security.net.config.DirectoryCertificateSource.hashName(DirectoryCertificateSource.java:215)
at android.security.net.config.DirectoryCertificateSource.getHash(DirectoryCertificateSource.java:192)
at android.security.net.config.DirectoryCertificateSource.findCerts(DirectoryCertificateSource.java:140)
at android.security.net.config.DirectoryCertificateSource.findAllByIssuerAndSignature(DirectoryCertificateSource.java:115)
at android.security.net.config.SystemCertificateSource.findAllByIssuerAndSignature(SystemCertificateSource.java:27)
at android.security.net.config.CertificatesEntryRef.findAllCertificatesByIssuerAndSignature(CertificatesEntryRef.java:65)
at android.security.net.config.NetworkSecurityConfig.findAllCertificatesByIssuerAndSignature(NetworkSecurityConfig.java:146)
at android.security.net.config.TrustedCertificateStoreAdapter.findAllIssuers(TrustedCertificateStoreAdapter.java:46)
at com.android.org.conscrypt.TrustManagerImpl.findAllTrustAnchorsByIssuerAndSignature(TrustManagerImpl.java:932)
at com.android.org.conscrypt.TrustManagerImpl.checkTrustedRecursive(TrustManagerImpl.java:556)
at com.android.org.conscrypt.TrustManagerImpl.checkTrusted(TrustManagerImpl.java:503)
at com.android.org.conscrypt.TrustManagerImpl.checkServerTrusted(TrustManagerImpl.java:332)
at android.security.net.config.NetworkSecurityTrustManager.checkServerTrusted(NetworkSecurityTrustManager.java:113)
at android.security.net.config.NetworkSecurityTrustManager.checkServerTrusted(NetworkSecurityTrustManager.java:87)
at android.security.net.config.RootTrustManager.checkServerTrusted(RootTrustManager.java:118)
at com.owncloud.android.lib.common.network.AdvancedX509TrustManager.checkServerTrusted(AdvancedX509TrustManager.java:118)
at org.conscrypt.Platform.checkServerTrusted(Platform.java:437)
at org.conscrypt.ConscryptEngine.verifyCertificateChain(ConscryptEngine.java:1643)
at org.conscrypt.NativeCrypto.ENGINE_SSL_read_direct(Native Method)
at org.conscrypt.NativeSsl.readDirectByteBuffer(NativeSsl.java:567)
at org.conscrypt.ConscryptEngine.readPlaintextDataDirect(ConscryptEngine.java:1099)
at org.conscrypt.ConscryptEngine.readPlaintextData(ConscryptEngine.java:1083)
at org.conscrypt.ConscryptEngine.unwrap(ConscryptEngine.java:880)
at org.conscrypt.ConscryptEngine.unwrap(ConscryptEngine.java:751)
at org.conscrypt.ConscryptEngine.unwrap(ConscryptEngine.java:716)
at org.conscrypt.ConscryptEngineSocket$SSLInputStream.processDataFromSocket(ConscryptEngineSocket.java:833)
at org.conscrypt.ConscryptEngineSocket$SSLInputStream.access$100(ConscryptEngineSocket.java:706)
at org.conscrypt.ConscryptEngineSocket.doHandshake(ConscryptEngineSocket.java:230)
at org.conscrypt.ConscryptEngineSocket.startHandshake(ConscryptEngineSocket.java:209)
at okhttp3.internal.connection.ConnectPlan.connectTls(ConnectPlan.kt:323)
at okhttp3.internal.connection.ConnectPlan.connectTlsEtc(ConnectPlan.kt:188)
at okhttp3.internal.connection.FastFallbackExchangeFinder.find(FastFallbackExchangeFinder.kt:78)
at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:267)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:84)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:65)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:205)
at okhttp3.internal.connection.RealCall.execute(RealCall.kt:158)
at com.nextcloud.common.OkHttpMethodBase.execute(OkHttpMethodBase.kt:175)
at com.nextcloud.client.network.ConnectivityServiceImpl.isInternetWalled(ConnectivityServiceImpl.java:81)
at com.owncloud.android.files.services.FileUploader.retryFailedUploads(FileUploader.java:1072)
at com.owncloud.android.ui.activity.UploadListActivity.lambda$refresh$0$com-owncloud-android-ui-activity-UploadListActivity(UploadListActivity.java:198)
at com.owncloud.android.ui.activity.UploadListActivity$$ExternalSyntheticLambda0.run(Unknown Source:2)
at java.lang.Thread.run(Thread.java:1012)
```
### App information
* ID: `com.nextcloud.client`
* Version: `30220390`
* Build flavor: `generic`
### Device information
* Brand: `google`
* Device: `barbet`
* Model: `Pixel 5a`
* Id: `TP1A.221105.002`
* Product: `barbet`
### Firmware
* SDK: `33`
* Release: `13`
* Incremental: `2022111000`
### Server error logs
_No response_
### Additional information
GrapheneOS
Contributor guide
Assessment
This issue has not been assessed yet.