Closed bustekuchen closed 1 year ago
I can't reproduce it here. Can you give two minimal zip files with some source and target data structures that reproduce the problem? Also, what FTP server are you using?
Hi, I tested a bit more around. It seems like the problem is only in the folder creation, as soon as the folder Structure is in place the sync if the files runs flawlessly.
I currently tried to download a whole Structure from ftp to an empty local folder. With the dummy source structure I can reproduce the issue. As soon as the folders are in place the download works. When I delete on of the folders locally and restart the Download I get the File exists error again for the deleted folder.
infos about the current testing environment: Client(pyftpsync): Ubuntu 20.04.4 LTS python: 3.8.10 Server: CrushFTP 10.1
Test structure: test_data.zip
Strange. It seems to work here, using v4.0.0-a3
ftp_local % pyftpsync download -v --progress . ftps://ds415/ agains a NAS FTP server
Download to /Users/martin/test/ftp_local
from ftps://ds415/
Encoding local: utf-8, remote: utf-8
No credentials found in keyring('pyftpsync', 'ds415').
Using credentials from .netrc file: martin:***.
Login as 'martin'.
Could not send 'OPTS UTF-8': '501 OPTS command is not defined for [UTF-8].'
Sent 'OPTS UTF8 ON'.
Server time offset: -0.73 seconds.
SKIP UNMATCHED - .DS_Store
SKIP UNMATCHED - [#recycle]
COPY UNMODIFIED < [01_sub_folder]
COPY UNMODIFIED < [02_sub_Folder]
COPY UNMODIFIED < [05_Sub-Folder]
Wrote 17/1 files in 0 directories, skipped: 0. Elap: 3.29 sec.
ftp_local %
(Same result with sftp: and ftps: protocols).
When I delete on of the folders locally and restart the Download I get the File exists error again for the deleted folder.
This should be classified as local removal and not be downloaded again:
SKIP UNMATCHED - .DS_Store
EQUAL = [01_sub_folder]
EQUAL = [02_sub_Folder]
SKIP UNMATCHED - [#recycle]
SKIP REMOTE DEL. >X [05_Sub-Folder]
EQUAL = [01_sub_folder/2022.6.23]
...
I suspect that your server sends '..' and '.' with the list command.
Maybe we see more if you run with more logging (-vvv
)
I also committed a blind fix, maybe you can test?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi,
Python version: 3.8.10 pyftpsync version: 3.1.0 (also tested with 4.0.0-a3)
Started with the following Error from the Title:
Then I thought, well what if just have a Problem with relative paths like
..
and.
Therefore I started pyftpsync again but this time with this exclude-x ".,.."
. Now things getting stranger. I do get to the part where file operations happen. pyftpsync is creating the first folder, just to immediately afterwords trowing the same error again. But if you just restart he is going one folder further. So with every time I start the program I get one Folder closer to my remote structure.So I was like, okay If getting an error if the folder already exists. I add a only mkdir if not exists. This looks like this: in ftpsync/targets.py on line 389 I Changed the
def mkdir
:But the result of the change was a
Tried to navigate outside root
error fromdef cwd
. At this point I am not deep enough into this to fix the Problem.I Hope I could explain the Problem.
Alex