[BUG] Received unexpected response
Checks
- [x] I have read the FAQ section, searched the open issues, and still think this is a new bug.
Describe the bug you encountered:
On a Realme RMP2013 (Android 10 to12) and on two different devices "Tabwee W90" (Andr. 15) with "Nova Launcher" I have always the same error. See sreenshot. No difference in landscape or portrait mode.
Describe what you expected to happen:
I have multiple phones with Android OS (A8-A15), all with "Nova L." and the Keepass has no problems with the phones! (And even my Chromebook now is working with Keepass2Android.)
What version of Keepass2Android are you using?
1.12-r5
Which version of Android are you on?
15 (W90_EEA_L30_v1.0_A15_01_20250222V03...)
It is Realme RMP2103
The message says "Unauthorized". Are you 100% sure you entered the correct credentials for the WebDav server? If yes, can you check the Nextcloud log to see if this tells more about why the credentials are considered invalid?
The credentials are correct (all phones and computers log-in's are good) and the PWD can be seen while typing. ;-)
Nextcloud log:
[core] Warnung: Login failed: 'ralf' (Remote IP: 'xxx.xxx.120.178') GET /remote.php/webdav/rbsafe.kdbx von xxx.xxx.120.178 von -- um 22.08.2025, 09:38:29
{ "reqId":"ixkZDjO0VAVX2fmD7Ixk", "level":2, "time":"2025-08-22T07:38:29+00:00", "remoteAddr":"xxx.xxx.120.178", "user":"--", "app":"core", "method":"GET", "url":"/remote.php/webdav/rbsafe.kdbx", "message":"Login failed: 'ralf' (Remote IP: 'xxx.xxx.120.178')", "userAgent":"okhttp/4.12.0", "version":"31.0.8.1", "data":{ "app":"core" }, "id":"68a81ec5c5e77" }
Just some thoughts:
- Username AND password are correct?
- password with special characters?
- 2nd-factor enabled? If yes, use an app password
Just some thoughts:
- Username AND password are correct? YES
- password with special characters? YES an @ (but always correct)
- 2nd-factor enabled? NO
Just some thoughts:
- Username AND password are correct?
- password with special characters?
- 2nd-factor enabled? If yes, use an app password
I got the same problem, and I am sure that and username and password is correct, I test it on my pc, this is the wrong password
< HTTP/2 401
< content-security-policy: child-src 'self'; connect-src 'self' blob: https://raw.githubusercontent.com/owncloud/awesome-ocis/; default-src 'none'; font-src 'self'; frame-ancestors 'self'; frame-src 'self' blob: https://embed.diagrams.net/; img-src 'self' data: blob: https://raw.githubusercontent.com/owncloud/awesome-ocis/; manifest-src 'self'; media-src 'self'; object-src 'self' blob:; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'
< date: Mon, 15 Sep 2025 02:17:26 GMT
< referrer-policy: strict-origin-when-cross-origin
< www-authenticate: Bearer realm="fake.fake", charset="UTF-8"
< x-content-type-options: nosniff
< x-frame-options: SAMEORIGIN
< x-permitted-cross-domain-policies: none
< x-request-id: 4706fdcaf085/dZALFbIo89-001456
< x-robots-tag: none
< x-xss-protection: 1; mode=block
< content-length: 0
<
and this is the correct password:
< HTTP/2 200
< accept-ranges: bytes
< content-disposition: attachment; filename*=UTF-8''index.md; filename="index.md"
< content-security-policy: child-src 'self'; connect-src 'self' blob: https://raw.githubusercontent.com/owncloud/awesome-ocis/; default-src 'none'; font-src 'self'; frame-ancestors 'self'; frame-src 'self' blob: https://embed.diagrams.net/; img-src 'self' data: blob: https://raw.githubusercontent.com/owncloud/awesome-ocis/; manifest-src 'self'; media-src 'self'; object-src 'self' blob:; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'
< content-type: text/markdown; charset=UTF-8
< date: Mon, 15 Sep 2025 02:17:16 GMT
< etag: "2873dabc854702b1bd813c2fed53b665"
< last-modified: Mon, 08 Sep 2025 12:50:21 +0000
< oc-checksum: SHA1:43220f70f84c1d76720335800fd44a674cba2f47
< oc-etag: "2873dabc854702b1bd813c2fed53b665"
< oc-fileid: dfd54c02-dd89-4fab-8018-a175d7252950$c812b03e-5034-49b2-866c-77358187351a!c9d54dc7-29d4-456d-a224-e59643923004
< referrer-policy: strict-origin-when-cross-origin
< vary: Origin
< x-content-type-options: nosniff
< x-frame-options: SAMEORIGIN
< x-permitted-cross-domain-policies: none
< x-request-id: 4706fdcaf085/dZALFbIo89-001451
< x-robots-tag: none
< x-xss-protection: 1; mode=block
< content-length: 1964
It return the file correctly, I copy and paste the url, username, password into Keepass2Android field with WebDav(HTTPS), and it response 401.
By the way, this password was an app token, it use the basic authorization and only contains ASCII characters.
My origin url likes "/dav/spaces/dfd54c02-dd89-4fab-8018-a175d7252950$c812b03e-5034-49b2-866c-77358187351a", so I try url like "/dav/files/admin/", and also failed with 401.
And I try other webdav softwares, it works fine with the credentials, so I do think this is a bug with Keepass2Android.
Log doesn't contain any message helps:
2025/9/15 09:33:06:91 -- AppSettingsActivity.OnPause 3
2025/9/15 09:33:08:106 -- AppSettingsActivity.OnResume 3
2025/9/15 09:33:08:107 -- DB null 3
2025/9/15 09:33:10:404 -- AppSettingsActivity.OnPause 3
2025/9/15 09:33:10:421 -- FileSelect.OnStart
2025/9/15 09:33:10:422 -- FileSelect.OnResume
2025/9/15 09:33:11:54 -- AppSettingsActivity.OnStop 3
2025/9/15 09:33:11:56 -- AppSettingsActivity.OnDestroyTrue 3
2025/9/15 09:33:11:206 -- FileSelect.OnPause
2025/9/15 09:33:11:212 -- SelectStorageLocationActivity.OnCreate
2025/9/15 09:33:11:829 -- FileSelect.OnStop
2025/9/15 09:33:13:250 -- onAR
2025/9/15 09:33:13:251 -- base.onAR
2025/9/15 09:33:13:331 -- parsing autofillStructure...
2025/9/15 09:33:13:331 -- Parsing done
2025/9/15 09:33:13:332 -- cannot autofill
2025/9/15 09:33:29:107 -- Received unexpected response: Response{protocol=h2, code=401, message=, url=https://ocis.fake.fake/dav/spaces/dfd54c02-dd89-4fab-8018-a175d7252950$c812b03e-5034-49b2-866c-77358187351a}
2025/9/15 09:33:29:109 -- System.Exception: Received unexpected response: Response{protocol=h2, code=401, message=, url=https://ocis.fake.fake/dav/spaces/dfd54c02-dd89-4fab-8018-a175d7252950$c812b03e-5034-49b2-866c-77358187351a}
---> Java.Lang.Exception: Received unexpected response: Response{protocol=h2, code=401, message=, url=https://ocis.fake.fake/dav/spaces/dfd54c02-dd89-4fab-8018-a175d7252950$c812b03e-5034-49b2-866c-77358187351a}
at Java.Interop.JniEnvironment.InstanceMethods.CallObjectMethod(JniObjectReference , JniMethodInfo , JniArgumentValue* )
at Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeVirtualObjectMethod(String , IJavaPeerable , JniArgumentValue* )
at Keepass2android.Javafilestorage.WebDavStorage.GetFileEntry(String filename)
at keepass2android.Io.JavaFileStorage.GetFileDescription(IOConnectionInfo ioc)
--- End of managed Java.Lang.Exception stack trace ---
java.lang.Exception: Received unexpected response: Response{protocol=h2, code=401, message=, url=https://ocis.fake.fake/dav/spaces/dfd54c02-dd89-4fab-8018-a175d7252950$c812b03e-5034-49b2-866c-77358187351a}
at keepass2android.javafilestorage.WebDavStorage.checkStatus(WebDavStorage.java:369)
at keepass2android.javafilestorage.WebDavStorage.listFiles(WebDavStorage.java:268)
at keepass2android.javafilestorage.WebDavStorage.getFileEntry(WebDavStorage.java:382)
at crc64c98c008c0cd742cb.FileChooserFileProvider.n_getFileEntry(Native Method)
at crc64c98c008c0cd742cb.FileChooserFileProvider.getFileEntry(FileChooserFileProvider.java:58)
at keepass2android.kp2afilechooser.Kp2aFileProvider.checkConnection(Kp2aFileProvider.java:248)
at keepass2android.kp2afilechooser.Kp2aFileProvider.getCheckConnectionCursor(Kp2aFileProvider.java:222)
at keepass2android.kp2afilechooser.Kp2aFileProvider.doAnswerApiCommand(Kp2aFileProvider.java:363)
at keepass2android.kp2afilechooser.Kp2aFileProvider.query(Kp2aFileProvider.java:203)
at android.content.ContentProvider.query(ContentProvider.java:1669)
at android.content.ContentProvider.query(ContentProvider.java:1765)
at android.content.ContentProvider$Transport.query(ContentProvider.java:310)
at android.content.ContentResolver.query(ContentResolver.java:1231)
at android.content.ContentResolver.query(ContentResolver.java:1162)
at android.content.ContentResolver.query(ContentResolver.java:1118)
at group.pals.android.lib.ui.filechooser.FragmentFiles$10.doInBackground(FragmentFiles.java:1049)
at group.pals.android.lib.ui.filechooser.FragmentFiles$10.doInBackground(FragmentFiles.java:1016)
at android.os.AsyncTask$3.call(AsyncTask.java:394)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
--- End of managed Java.Lang.Exception stack trace ---
java.lang.Exception: Received unexpected response: Response{protocol=h2, code=401, message=, url=https://ocis.fake.fake/dav/spaces/dfd54c02-dd89-4fab-8018-a175d7252950$c812b03e-5034-49b2-866c-77358187351a}
at keepass2android.javafilestorage.WebDavStorage.checkStatus(WebDavStorage.java:369)
at keepass2android.javafilestorage.WebDavStorage.listFiles(WebDavStorage.java:268)
at keepass2android.javafilestorage.WebDavStorage.getFileEntry(WebDavStorage.java:382)
at crc64c98c008c0cd742cb.FileChooserFileProvider.n_getFileEntry(Native Method)
at crc64c98c008c0cd742cb.FileChooserFileProvider.getFileEntry(FileChooserFileProvider.java:58)
at keepass2android.kp2afilechooser.Kp2aFileProvider.checkConnection(Kp2aFileProvider.java:248)
at keepass2android.kp2afilechooser.Kp2aFileProvider.getCheckConnectionCursor(Kp2aFileProvider.java:222)
at keepass2android.kp2afilechooser.Kp2aFileProvider.doAnswerApiCommand(Kp2aFileProvider.java:363)
at keepass2android.kp2afilechooser.Kp2aFileProvider.query(Kp2aFileProvider.java:203)
at android.content.ContentProvider.query(ContentProvider.java:1669)
at android.content.ContentProvider.query(ContentProvider.java:1765)
at android.content.ContentProvider$Transport.query(ContentProvider.java:310)
at android.content.ContentResolver.query(ContentResolver.java:1231)
at android.content.ContentResolver.query(ContentResolver.java:1162)
at android.content.ContentResolver.query(ContentResolver.java:1118)
at group.pals.android.lib.ui.filechooser.FragmentFiles$10.doInBackground(FragmentFiles.java:1049)
at group.pals.android.lib.ui.filechooser.FragmentFiles$10.doInBackground(FragmentFiles.java:1016)
at android.os.AsyncTask$3.call(AsyncTask.java:394)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
Exception_EndOfInnerExceptionStack
at keepass2android.Io.JavaFileStorage.GetFileDescription(IOConnectionInfo ioc)
at keepass2android.Io.OfflineSwitchableFileStorage.GetFileDescription(IOConnectionInfo ioc)
at keepass2android.Io.CachingFileStorage.GetFileDescription(IOConnectionInfo ioc)
at keepass2android.FileChooserFileProvider.GetFileEntry(String filename, StringBuilder errorMessageBuilder)
2025/9/15 09:33:30:409 -- onAR
2025/9/15 09:33:30:409 -- base.onAR
2025/9/15 09:33:30:426 -- FileSelect.OnStart
2025/9/15 09:33:30:427 -- FileSelect.OnResume
2025/9/15 09:33:31:379 -- FileSelect.OnPause
2025/9/15 09:33:31:389 -- AppSettingsActivity.OnCreate 4
2025/9/15 09:33:31:390 -- AppSettingsActivity:apptask= 4
2025/9/15 09:33:31:393 -- AppSettingsActivity.OnStart 4
2025/9/15 09:33:31:393 -- AppSettingsActivity.OnResume 4
2025/9/15 09:33:31:394 -- DB null 4
2025/9/15 09:33:31:977 -- FileSelect.OnStop
Username AND password are correct? Yes password with special characters? No, only ASCII characters 2nd-factor enabled? If yes, use an app password Yes, it's app token
Can you set up an account for me on such a server for testing and share credentials to [email protected]?
Can you set up an account for me on such a server for testing and share credentials to [email protected]?
sure, the email has been sent from [email protected], please check it.
I have the same issue