Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duck CLI: Issued delete command for a file, entire folder deleted #11756

Closed
cyberduck opened this issue Aug 7, 2021 · 2 comments
Closed

Duck CLI: Issued delete command for a file, entire folder deleted #11756

cyberduck opened this issue Aug 7, 2021 · 2 comments
Assignees
Labels
bug cli Command Line Interface fixed
Milestone

Comments

@cyberduck
Copy link
Collaborator

ef2996d created the issue

CLI v7.10.0 (35184)
After updating to 7.10.0 (35184), the following command was issued in a Windows batch file:

duck -delete wasabisys://xxxxxxxxxxxxxxxxxxxx@Bax-Backup/Guinan/Diff/20210425-Guinan-Daily_20210430015501.nbd > logfile.txt

Instead of deleting the 20210425-Guinan-Daily_20210430015501.nbd file in the Diff folder, the ENTIRE Diff folder was deleted. That is, instead of deleting 1 file, it deleted 74 files and the folder they were in. This script has been used for months without issue, but this happened only after the 7.10.0 update. I see that the command should have been "--delete" and the script mistakenly has "-delete", but as I said, the script has worked fine for months. The log file (logfile.txt) contained the following:

Unknown…
Resolving s3.wasabisys.com…
Opening S3 connection to s3.wasabisys.com…
S3 connection opened…
Authenticating as xxxxxxxxxxxxxxxxxxxx…
Login successful…
Reading metadata of Diff…
Deleting Diff……
Deleting 20210425-Guinan-Daily_20210430015501.nbd…
Deleting 20210425-Guinan-Daily_20210501015501.nbd…
Deleting 20210502-Guinan-Daily_20210503015501.nbd…
Deleting 20210502-Guinan-Daily_20210504015501.nbd…
Deleting 20210502-Guinan-Daily_20210505015501.nbd…
Deleting 20210502-Guinan-Daily_20210506084838.nbd…
Deleting 20210502-Guinan-Daily_20210507015500.nbd…
Deleting 20210502-Guinan-Daily_20210508015500.nbd…
Deleting 20210509-Guinan-Daily_20210510164500.nbd…
Deleting 20210509-Guinan-Daily_20210511015501.nbd…
Deleting 20210509-Guinan-Daily_20210512015501.nbd…
Deleting 20210509-Guinan-Daily_20210513015500.nbd…
Deleting 20210509-Guinan-Daily_20210514015500.nbd…
Deleting 20210509-Guinan-Daily_20210515015500.nbd…
Deleting 20210516-Guinan-Daily_20210517015501.nbd…
Deleting 20210516-Guinan-Daily_20210518015501.nbd…
Deleting 20210516-Guinan-Daily_20210519015501.nbd…
Deleting 20210516-Guinan-Daily_20210520015501.nbd…
Deleting 20210516-Guinan-Daily_20210521015500.nbd…
Deleting 20210516-Guinan-Daily_20210522015501.nbd…
Deleting 20210523-Guinan-Daily_20210524015501.nbd…
Deleting 20210523-Guinan-Daily_20210525015500.nbd…
Deleting 20210523-Guinan-Daily_20210526015500.nbd…
Deleting 20210523-Guinan-Daily_20210527015500.nbd…
Deleting 20210523-Guinan-Daily_20210528015501.nbd…
Deleting 20210523-Guinan-Daily_20210529015500.nbd…
Deleting 20210602-Guinan-Daily_20210603085525.nbd…
Deleting 20210602-Guinan-Daily_20210603191619.nbd…
Deleting 20210602-Guinan-Daily_20210604015501.nbd…
Deleting 20210602-Guinan-Daily_20210605015500.nbd…
Deleting 20210606-Guinan-Daily_20210607015501.nbd…
Deleting 20210606-Guinan-Daily_20210608015501.nbd…
Deleting 20210606-Guinan-Daily_20210609015500.nbd…
Deleting 20210606-Guinan-Daily_20210610015501.nbd…
Deleting 20210606-Guinan-Daily_20210611015501.nbd…
Deleting 20210606-Guinan-Daily_20210612015501.nbd…
Deleting 20210613-Guinan-Daily_20210614015501.nbd…
Deleting 20210613-Guinan-Daily_20210615015500.nbd…
Deleting 20210613-Guinan-Daily_20210616015501.nbd…
Deleting 20210613-Guinan-Daily_20210617015501.nbd…
Deleting 20210613-Guinan-Daily_20210618015501.nbd…
Deleting 20210613-Guinan-Daily_20210619015501.nbd…
Deleting 20210613-Guinan-Daily_20210624111459.nbd…
Deleting 20210625-Guinan-Daily_20210626015500.nbd…
Deleting 20210627-Guinan-Daily_20210628015501.nbd…
Deleting 20210627-Guinan-Daily_20210629015501.nbd…
Deleting 20210627-Guinan-Daily_20210630015500.nbd…
Deleting 20210627-Guinan-Daily_20210701085703.nbd…
Deleting 20210627-Guinan-Daily_20210702015501.nbd…
Deleting 20210627-Guinan-Daily_20210703083108.nbd…
Deleting 20210704-Guinan-Daily_20210705015501.nbd…
Deleting 20210704-Guinan-Daily_20210706015500.nbd…
Deleting 20210704-Guinan-Daily_20210707015501.nbd…
Deleting 20210704-Guinan-Daily_20210708015501.nbd…
Deleting 20210704-Guinan-Daily_20210709015500.nbd…
Deleting 20210704-Guinan-Daily_20210710015501.nbd…
Deleting 20210711-Guinan-Daily_20210712015501.nbd…
Deleting 20210711-Guinan-Daily_20210713015501.nbd…
Deleting 20210711-Guinan-Daily_20210714015501.nbd…
Deleting 20210711-Guinan-Daily_20210715015506.nbd…
Deleting 20210711-Guinan-Daily_20210716015501.nbd…
Deleting 20210711-Guinan-Daily_20210717015501.nbd…
Deleting 20210718-Guinan-Daily_20210719015500.nbd…
Deleting 20210718-Guinan-Daily_20210720015501.nbd…
Deleting 20210718-Guinan-Daily_20210721015501.nbd…
Deleting 20210718-Guinan-Daily_20210722015501.nbd…
Deleting 20210718-Guinan-Daily_20210723015500.nbd…
Deleting 20210718-Guinan-Daily_20210724015500.nbd…
Deleting 20210725-Guinan-Daily_20210726015501.nbd…
Deleting 20210725-Guinan-Daily_20210727015501.nbd…
Deleting 20210725-Guinan-Daily_20210728015500.nbd…
Deleting 20210725-Guinan-Daily_20210729015500.nbd…
Deleting 20210725-Guinan-Daily_20210730015501.nbd…
Deleting 20210725-Guinan-Daily_20210731015500.nbd…
Deleting Diff…

This is what a log file for a delete command typically contains:

Reading metadata of 20210425-Guinan-Daily_20210429015500.nbd…
Resolving s3.wasabisys.com…
Opening S3 connection to s3.wasabisys.com…
S3 connection opened…
Authenticating as xxxxxxxxxxxxxxxxxxxx…
Login successful…
Deleting 20210425-Guinan-Daily_20210429015500.nbd……
Deleting 20210425-Guinan-Daily_20210429015500.nbd…

The script was run against a set of 25 files across 8 folders. All 8 folders were deleted, deleting 331 files instead of the 25.

Note that the list had multiple files from a given folder. The first file deletion command for a given folder deleted the folder. When the delete command was subsequently issued for the other files in the folder, the log file showed this:

Unknown…
Resolving s3.wasabisys.com…
Opening S3 connection to s3.wasabisys.com…
S3 connection opened…
Authenticating as xxxxxxxxxxxxxxxxxxxx…
Disconnecting s3.wasabisys.com…
Failure to read attributes of Diff. Not Found. Request Error. Please contact your web hosting service provider for assistance.

Unknown.

Fortunately, most of the files could be recovered from a local cache, but this is pretty upsetting.

Let me know if you need anything else.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

I can no longer reproduce. This should be fixed with 1caf945.

@cyberduck
Copy link
Collaborator Author

@dkocher commented

Replying to [comment:3 dkocher]:

I can no longer reproduce. This should be fixed with 1caf945.

Verified with

mellifera:cyberduck dkocher$ duck --verbose --username 3P8EKI02F6OBKT14FITH --delete wasabisys-us-east-1:/cyberduck/snippets/page.xml
Authenticating as 3P8EKI02F6OBKT14FITH…
> HEAD /snippets/ HTTP/1.1
> Date: Thu, 14 Oct 2021 20:34:54 GMT
> x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
> Host: cyberduck.s3.us-east-1.wasabisys.com
> x-amz-date: 20211014T203454Z
> Authorization: ********
> Connection: Keep-Alive
> User-Agent: Cyberduck/7.10.2.35432 (Mac OS X/11.6) (x86_64)
< HTTP/1.1 200 OK
< Accept-Ranges: bytes
< Content-Length: 0
< Content-Type: application/x-directory
< Date: Thu, 14 Oct 2021 20:34:55 GMT
< ETag: "d41d8cd98f00b204e9800998ecf8427e"
< Last-Modified: Wed, 17 Mar 2021 19:13:06 GMT
< Server: WasabiS3/7.1.198-2021-09-17-22521bb (head09)
< x-amz-id-2: vw7m3W7DW9Oqcs1MCAJ8Sm5ylEBEhPz6w336oRkObFHhYxgsyCNg8IE1QtyXzHdqz0tpwLMqPZhg
< x-amz-request-id: 619F7D20CDC3D077
> GET /?versioning HTTP/1.1
> Date: Thu, 14 Oct 2021 20:34:55 GMT
> x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
> Host: cyberduck.s3.us-east-1.wasabisys.com
> x-amz-date: 20211014T203455Z
> Authorization: ********
> Connection: Keep-Alive
> User-Agent: Cyberduck/7.10.2.35432 (Mac OS X/11.6) (x86_64)
< HTTP/1.1 200 OK
< Date: Thu, 14 Oct 2021 20:34:56 GMT
< Server: WasabiS3/7.1.198-2021-09-17-22521bb (head09)
< x-amz-id-2: y3bFJC6eHPBDEU8YXsRAwtltUD5h/a6UDhYWXcC9QHVb2cNy/sIo946zNWgCUQvpER7jEjk3fJRJ
< x-amz-request-id: FB1A91FD7232FF0C
< Transfer-Encoding: chunked
> GET /?encoding-type=url&max-keys=1000&prefix=snippets%2F&delimiter=%2F HTTP/1.1
> Date: Thu, 14 Oct 2021 20:34:55 GMT
> x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
> Host: cyberduck.s3.us-east-1.wasabisys.com
> x-amz-date: 20211014T203455Z
> Authorization: ********
> Connection: Keep-Alive
> User-Agent: Cyberduck/7.10.2.35432 (Mac OS X/11.6) (x86_64)
< HTTP/1.1 200 OK
< Content-Type: application/xml
< Date: Thu, 14 Oct 2021 20:34:56 GMT
< Server: WasabiS3/7.1.198-2021-09-17-22521bb (head09)
< x-amz-bucket-region: us-east-1
< x-amz-id-2: mhLB+9o1nhLcZEhciqi8geIPM81SHdXeUtzizhWtPVyJ8fgKpBJQpPDlzcNRkCARaZ64h2ma2WjO
< x-amz-request-id: 0ED6EE2BFB97BB7F
Login successful…
> HEAD /snippets/page.xml HTTP/1.1
> Date: Thu, 14 Oct 2021 20:34:56 GMT
> x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
> Host: cyberduck.s3.us-east-1.wasabisys.com
> x-amz-date: 20211014T203456Z
> Authorization: ********
> Connection: Keep-Alive
> User-Agent: Cyberduck/7.10.2.35432 (Mac OS X/11.6) (x86_64)
< HTTP/1.1 200 OK
< Accept-Ranges: bytes
< Content-Length: 437
< Content-Type: application/xml
< Date: Thu, 14 Oct 2021 20:34:56 GMT
< ETag: "c2fffeb4a4cf0e84a049df9a993bfe61"
< Last-Modified: Wed, 17 Mar 2021 19:13:09 GMT
< Server: WasabiS3/7.1.198-2021-09-17-22521bb (head09)
< x-amz-id-2: kjYeyrHvpSFBUCCWHWug7pA9r6A6UOmyvS7uUlrUBmeARV8bGZyDxRuIpT/N8hlsv8wFkZR3djCo
Deleting page.xml…
> DELETE /snippets/page.xml HTTP/1.1
> Date: Thu, 14 Oct 2021 20:34:56 GMT
> x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
> Host: cyberduck.s3.us-east-1.wasabisys.com
> x-amz-date: 20211014T203456Z
> Authorization: ********
> Connection: Keep-Alive
> User-Agent: Cyberduck/7.10.2.35432 (Mac OS X/11.6) (x86_64)
< HTTP/1.1 204 No Content
< Date: Thu, 14 Oct 2021 20:34:56 GMT
< Server: WasabiS3/7.1.198-2021-09-17-22521bb (head09)
< x-amz-id-2: Jz7PKNG8CNo1aYBOQvmS8gCAcm6mWNYQ2eh55Qi3FqZJ8ebDyNfRrRa5o/JavTmA7/Cj7nnjz/8v
< x-amz-request-id: 18D28CA7B405A08E

@iterate-ch iterate-ch locked as resolved and limited conversation to collaborators Nov 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug cli Command Line Interface fixed
Projects
None yet
Development

No branches or pull requests

2 participants