PhilippC / PhilippC/keepass2android
[BUG] Timeout when saving big database (stored on WebDAV/NextCloud)
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.2k
- Forks
- 478
- Avg merge
- 1h 4m
- Merged PRs (30d)
- 2
Description
Checks
- I have read the FAQ section, searched the open issues, and still think this is a new bug.
Describe the bug you encountered:
I have an +80MByte database stored on my Nextcloud run by hetzner.com.
When I make changes and save it it runs into a timeout.
On my phone I see the upload is happing @ ~1MB/s. So its not fast I know.
Here's the log:
12/12/2025 12:01:19:258 -- DatabaseSettingsActivity.OnPause 8
12/12/2025 12:01:19:263 -- Timeout start
12/12/2025 12:01:19:293 -- GroupActivity.OnStart 6
12/12/2025 12:01:19:295 -- GroupActivity.OnResume 6
12/12/2025 12:01:19:295 -- DatabaseIsUnlocked=True 6
12/12/2025 12:01:19:295 -- Timeout cancel
12/12/2025 12:01:19:813 -- DatabaseSettingsActivity.OnStop 8
12/12/2025 12:01:19:821 -- DatabaseSettingsActivity.OnDestroyTrue 8
12/12/2025 12:01:22:472 -- status message: Initializing...
12/12/2025 12:01:22:472 -- status submessage:
12/12/2025 12:01:22:526 -- status message: Synchronizing cached database…
12/12/2025 12:01:22:527 -- status submessage: Loading source file…
12/12/2025 12:01:31:859 -- Checking for file change. Current hash =
12/12/2025 12:01:31:860 -- https://nextcloud.com/remote.php/dav/files/user/db.mdb baseVersionHash =
12/12/2025 12:01:31:860 -- Checking for file change. baseVersionHash =
12/12/2025 12:01:31:860 -- https://nextcloud.com/remote.php/dav/files/user/db.mdb isCached = True
12/12/2025 12:01:31:861 -- https://nextcloud.com/remote.php/dav/files/user/db.mdb localVersionHash =
12/12/2025 12:01:31:861 -- https://nextcloud.com/remote.php/dav/files/user/db.mdb baseVersionHash =
12/12/2025 12:01:31:861 -- status submessage: Save file…
12/12/2025 12:01:31:862 -- https://nextcloud.com/remote.php/dav/files/user/db.mdb localVersionHash =
12/12/2025 12:02:49:438 -- timeout
12/12/2025 12:02:49:514 -- System.Exception: timeout
---> Java.Net.SocketTimeoutException: timeout
at Java.Interop.JniEnvironment.InstanceMethods.CallVoidMethod(JniObjectReference , JniMethodInfo , JniArgumentValue* )
at Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeVirtualVoidMethod(String , IJavaPeerable , JniArgumentValue* )
at Keepass2android.Javafilestorage.WebDavStorage.UploadFile(String path, Byte[] data, Boolean writeTransactional)
at keepass2android.Io.JavaFileStorage.JavaFileStorageWriteTransaction.CommitWrite()
--- End of managed Java.Net.SocketTimeoutException stack trace ---
java.net.SocketTimeoutException: timeout
at okhttp3.internal.http2.Http2Stream$StreamTimeout.newTimeoutException(Http2Stream.kt:675)
at okhttp3.internal.http2.Http2Stream$StreamTimeout.exitAndThrowIfTimedOut(Http2Stream.kt:684)
at okhttp3.internal.http2.Http2Stream$FramingSink.emitFrame(Http2Stream.kt:567)
at okhttp3.internal.http2.Http2Stream$FramingSink.write(Http2Stream.kt:532)
at okio.ForwardingSink.write(ForwardingSink.kt:29)
at okhttp3.internal.connection.Exchange$RequestBodySink.write(Exchange.kt:223)
at okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.kt:256)
at okio.RealBufferedSink.write(RealBufferedSink.kt:186)
at okhttp3.RequestBody$Companion$toRequestBody$2.writeTo(RequestBody.kt:152)
at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.kt:62)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:34)
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:83)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at com.burgstaller.okhttp.AuthenticationCacheInterceptor.intercept(AuthenticationCacheInterceptor.java:45)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
at keepass2android.javafilestorage.WebDavStorage.uploadFile(WebDavStorage.java:315)
at keepass2android.javafilestorage.WebDavStorage.uploadFile(WebDavStorage.java:267)
at mono.java.lang.RunnableImplementor.n_run(Native Method)
at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:29)
at java.lang.Thread.run(Thread.java:1563)
Suppressed: okhttp3.internal.http2.StreamResetException: stream was reset: CANCEL
at okhttp3.internal.http2.Http2Stream.takeHeaders(Http2Stream.kt:148)
at okhttp3.internal.http2.Http2ExchangeCodec.readResponseHeaders(Http2ExchangeCodec.kt:97)
at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.kt:110)
at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.kt:93)
... 18 more
--- End of managed Java.Net.SocketTimeoutException stack trace ---
java.net.SocketTimeoutException: timeout
at okhttp3.internal.http2.Http2Stream$StreamTimeout.newTimeoutException(Http2Stream.kt:675)
at okhttp3.internal.http2.Http2Stream$StreamTimeout.exitAndThrowIfTimedOut(Http2Stream.kt:684)
at okhttp3.internal.http2.Http2Stream$FramingSink.emitFrame(Http2Stream.kt:567)
at okhttp3.internal.http2.Http2Stream$FramingSink.write(Http2Stream.kt:532)
at okio.ForwardingSink.write(ForwardingSink.kt:29)
at okhttp3.internal.connection.Exchange$RequestBodySink.write(Exchange.kt:223)
at okio.RealBufferedSink.emitCompleteSegments(RealBufferedSink.kt:256)
at okio.RealBufferedSink.write(RealBufferedSink.kt:186)
at okhttp3.RequestBody$Companion$toRequestBody$2.writeTo(RequestBody.kt:152)
at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.kt:62)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:34)
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:83)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at com.burgstaller.okhttp.AuthenticationCacheInterceptor.intercept(AuthenticationCacheInterceptor.java:45)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
at keepass2android.javafilestorage.WebDavStorage.uploadFile(WebDavStorage.java:315)
at keepass2android.javafilestorage.WebDavStorage.uploadFile(WebDavStorage.java:267)
at mono.java.lang.RunnableImplementor.n_run(Native Method)
at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:29)
at java.lang.Thread.run(Thread.java:1563)
Suppressed: okhttp3.internal.http2.StreamResetException: stream was reset: CANCEL
at okhttp3.internal.http2.Http2Stream.takeHeaders(Http2Stream.kt:148)
at okhttp3.internal.http2.Http2ExchangeCodec.readResponseHeaders(Http2ExchangeCodec.kt:97)
at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.kt:110)
at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.kt:93)
... 18 more
Exception_EndOfInnerExceptionStack
at keepass2android.Io.JavaFileStorage.JavaFileStorageWriteTransaction.CommitWrite()
at keepass2android.Io.CachingFileStorage.UpdateRemoteFile(Stream cachedData, IOConnectionInfo ioc, Boolean useFileTransaction, String hash)
at keepass2android.Io.CachingFileStorage.UpdateRemoteFile(IOConnectionInfo ioc, Boolean useFileTransaction)
at keepass2android.SynchronizeCachedDatabase.Run()
12/12/2025 12:02:56:204 -- GroupActivity.OnPause 6
12/12/2025 12:02:56:205 -- Timeout start
12/12/2025 12:02:56:236 -- LockingActivity: OnActivityResult
12/12/2025 12:02:56:237 -- AppTask keepass2android.NullTask in OnActivityResult
12/12/2025 12:02:56:237 -- Task in activity GroupActivity 4 changed to NullTask
12/12/2025 12:02:56:239 -- GroupActivity.OnStart 4
12/12/2025 12:02:56:241 -- GroupActivity.OnResume 4
12/12/2025 12:02:56:241 -- DatabaseIsUnlocked=True 4
12/12/2025 12:02:56:241 -- Timeout cancel
12/12/2025 12:02:56:821 -- GroupActivity.OnStop 6
12/12/2025 12:02:56:824 -- GroupActivity.OnDestroyTrue 6
12/12/2025 12:03:01:419 -- GroupActivity.OnPause 4
12/12/2025 12:03:01:419 -- Timeout start
12/12/2025 12:03:01:455 -- DatabaseSettingsActivity.OnCreate 9
12/12/2025 12:03:01:455 -- DatabaseSettingsActivity:apptask= 9
12/12/2025 12:03:01:456 -- Setting FLAG_SECURE.
12/12/2025 12:03:01:463 -- DatabaseSettingsActivity.OnStart 9
12/12/2025 12:03:01:464 -- DatabaseSettingsActivity.OnResume 9
12/12/2025 12:03:01:464 -- DatabaseIsUnlocked=True 9
12/12/2025 12:03:01:465 -- Timeout cancel
12/12/2025 12:03:01:927 -- GroupActivity.OnStop 4
12/12/2025 12:03:07:783 -- DatabaseSettingsActivity.OnPause 9
12/12/2025 12:03:07:783 -- Timeout start
12/12/2025 12:03:25:24 -- DatabaseSettingsActivity.OnResume 9
12/12/2025 12:03:25:25 -- DatabaseIsUnlocked=True 9
12/12/2025 12:03:25:25 -- Timeout cancel
Describe what you expected to happen:
The http upload should not run in a timeout so quickly. Timeout should be raised or make it a setting.
What version of Keepass2Android are you using?
1.14-r4
Which version of Android are you on?
12
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in WebDavStorage.java at uploadFile entries around lines 267 and 315, then follow the CachingFileStorage.UpdateRemoteFile path shown in the stack trace. Reproduce an upload of a large WebDAV database and determine where the timeout is applied; done means the upload no longer fails prematurely or the timeout can be configured as requested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, csharp
- Domain
- cloud, mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100