PhilippC / PhilippC/keepass2android

[BUG] Unable to sync local changes (FTPES)

Open
#2,404 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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:

After openin database, i try to sync my local changes with remote FTP on my NAS (QNAP TS264) (on FTPES) but i get an error.
I checked user permissions, all is working. I can even see the tmp file created with 0ko but nothing more. No problem with syncing with an other app and the same user.

Here are the logs:

20/08/2023 14:13:39:868 -- status message: Synchronisation de la base de données mise en cache…
20/08/2023 14:13:39:868 -- status submessage: Chargement du fichier source…
20/08/2023 14:13:39:868 -- FTP: IocToUri out = ftp://xxxxxxx/MyPasswords.kdbx
20/08/2023 14:13:40:490 -- FTP: IocToUri out = ftp://xxxxxxx/MyPasswords.kdbx
20/08/2023 14:13:40:575 -- Checking for file change. Current hash = 95AFDAC19D03048CAE9FA015C1EDC98D5762DE0E33B8D2F1A9D00BB71801822F
20/08/2023 14:13:40:576 -- ftp://SETyyyyyy:2#xxxxxxx/MyPasswords.kdbx baseVersionHash = FF676A80120B0E82021E8221A9135DC980C17A14D9F0D99841772695445EE33B
20/08/2023 14:13:40:576 -- Checking for file change. baseVersionHash = FF676A80120B0E82021E8221A9135DC980C17A14D9F0D99841772695445EE33B
20/08/2023 14:13:40:577 -- ftp://SETyyyyyy:2#xxxxxxx/MyPasswords.kdbx isCached = True
20/08/2023 14:13:40:577 -- ftp://SETyyyyyy:2#xxxxxxx/MyPasswords.kdbx localVersionHash = 83F323F4194FCE4A050481FFBAC2B8ABB1B662AB69C7DF4938F6ECB688BDE68C
20/08/2023 14:13:40:577 -- ftp://SETyyyyyy:2#xxxxxxx/MyPasswords.kdbx baseVersionHash = FF676A80120B0E82021E8221A9135DC980C17A14D9F0D99841772695445EE33B
20/08/2023 14:13:40:578 -- status message: Enregistrement de la base de données…
20/08/2023 14:13:40:578 -- Conflict. True True True
20/08/2023 14:13:42:27 -- status submessage: Importation des modifications…
20/08/2023 14:13:42:150 -- ReadXmlStreamed: 118ms
20/08/2023 14:13:42:174 -- status submessage:
20/08/2023 14:13:42:331 -- Xml WriteDocument: 151ms
20/08/2023 14:13:42:334 -- ftp://SETyyyyyy:2#xxxxxxx/MyPasswords.kdbx isCached = True
20/08/2023 14:13:42:334 -- FTP: IocToUri out = ftp://xxxxxxx/MyPasswords.kdbx
20/08/2023 14:13:42:892 -- FTP: IocToUri out = ftp://xxxxxxx/MyPasswords.kdbx.241CAB.tmp
20/08/2023 14:13:42:942 -- couldn't save to remote ftp://SETyyyyyy:2#xxxxxxx/MyPasswords.kdbx
20/08/2023 14:13:42:945 -- System.AggregateException: One or more errors occurred. (Authentication failed because the remote party has closed the transport stream.) ---> System.IO.IOException: Authentication failed because the remote party has closed the transport stream.
at Mono.Net.Security.AsyncProtocolRequest.ProcessOperation (System.Threading.CancellationToken cancellationToken) [0x00115] in <6b1cf0be3bd54c56ac3706bf9fe33b14>:0
at Mono.Net.Security.AsyncProtocolRequest.StartOperation (System.Threading.CancellationToken cancellationToken) [0x0008b] in <6b1cf0be3bd54c56ac3706bf9fe33b14>:0
at Mono.Net.Security.MobileAuthenticatedStream.ProcessAuthentication (System.Boolean runSynchronously, Mono.Net.Security.MonoSslAuthenticationOptions options, System.Threading.CancellationToken cancellationToken) [0x00262] in <6b1cf0be3bd54c56ac3706bf9fe33b14>:0
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00011] in <4087c528abc04d8290db635003aa826f>:0
at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00043] in <4087c528abc04d8290db635003aa826f>:0
at System.Threading.Tasks.Task.Wait () [0x00000] in <4087c528abc04d8290db635003aa826f>:0
at FluentFTP.FtpSocketStream.ActivateEncryption (System.String targethost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCerts, System.Security.Authentication.SslProtocols sslProtocols) [0x0007d] in <dc76bb427f614505a2b462ce9b65cab3>:0
at (wrapper remoting-invoke-with-check) FluentFTP.FtpSocketStream.ActivateEncryption(string,System.Security.Cryptography.X509Certificates.X509CertificateCollection,System.Security.Authentication.SslProtocols)
at FluentFTP.FtpClient.OpenPassiveDataStream (FluentFTP.FtpDataConnectionType type, System.String command, System.Int64 restart) [0x00399] in <dc76bb427f614505a2b462ce9b65cab3>:0
at FluentFTP.FtpClient.OpenDataStream (System.String command, System.Int64 restart) [0x00070] in <dc76bb427f614505a2b462ce9b65cab3>:0
at FluentFTP.FtpClient.OpenWrite (System.String path, FluentFTP.FtpDataType type, System.Boolean checkIfFileExists) [0x000a2] in <dc76bb427f614505a2b462ce9b65cab3>:0
at FluentFTP.FtpClient.OpenWrite (System.String path) [0x00000] in <dc76bb427f614505a2b462ce9b65cab3>:0
at keepass2android.Io.TransactedWrite.OpenFile () [0x0002a] in <483bd1ecfe364ef6a0dfb2f58ee9f0f5>:0
at keepass2android.Io.CachingFileStorage.UpdateRemoteFile (System.IO.Stream cachedData, KeePassLib.Serialization.IOConnectionInfo ioc, System.Boolean useFileTransaction, System.String hash) [0x0000e] in <483bd1ecfe364ef6a0dfb2f58ee9f0f5>:0
at keepass2android.Io.CachingFileStorage.TryUpdateRemoteFile (System.IO.Stream cachedData, KeePassLib.Serialization.IOConnectionInfo ioc, System.Boolean useFileTransaction, System.String hash) [0x00000] in <483bd1ecfe364ef6a0dfb2f58ee9f0f5>:0
---> (Inner Exception #0) System.IO.IOException: Authentication failed because the remote party has closed the transport stream.
at Mono.Net.Security.AsyncProtocolRequest.ProcessOperation (System.Threading.CancellationToken cancellationToken) [0x00115] in <6b1cf0be3bd54c56ac3706bf9fe33b14>:0
at Mono.Net.Security.AsyncProtocolRequest.StartOperation (System.Threading.CancellationToken cancellationToken) [0x0008b] in <6b1cf0be3bd54c56ac3706bf9fe33b14>:0
at Mono.Net.Security.MobileAuthenticatedStream.ProcessAuthentication (System.Boolean runSynchronously, Mono.Net.Security.MonoSslAuthenticationOptions options, System.Threading.CancellationToken cancellationToken) [0x00262] in <6b1cf0be3bd54c56ac3706bf9fe33b14>:0 <---
Describe what you expected to happen:

Syncing

What version of Keepass2Android are you using?

1.09e-r7

Which version of Android are you on?

13

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the logged call path through keepass2android.Io.TransactedWrite.OpenFile and CachingFileStorage.UpdateRemoteFile/TryUpdateRemoteFile, then inspect FluentFTP.FtpClient.OpenWrite and ActivateEncryption for the FTPES failure. Reproduce the sync against the reported QNAP setup and verify that the remote database is written successfully without the TLS transport error.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, csharp
Domain
mobile, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.