Azure / azure-storage-azcopy

The new Azure Storage data transfer utility - AzCopy v10
MIT License
609 stars 220 forks source link

AzCopy failed to delete folder #1632

Closed the-grayest closed 2 years ago

the-grayest commented 2 years ago

Which version of the AzCopy was used?

10.13.0

Which platform are you using? (ex: Windows, Mac, Linux)

Windows

What command did you run?

azcopy.exe remove "https://SA-REDACTED.blob.core.windows.net/promo/temp/test/V_PPMS_ACTION_STATUS.delta/?sv=2019-02-02&se=2022-01-01T09%3A09%3A33Z&sr=c&sp=rdl&sig=pdUEtOKjWATABGFjf6KV3naQ4Z3s6C6Eqz7nWm%2BWjIk%3D" --recursive --trusted-microsoft-suffixes= --log-level=INFO

What problem was encountered?

First, we ran the command:

azcopy.exe remove https://safordatalake.blob.core.windows.net/promo/temp/test/V_PPMS_ACTION_STATUS.delta/? --recursive --trusted-microsoft-suffixes= --log-level=INFO

As a result, the command ended with errors. In the log of the AzCopy operation, we see a message about the successful removal of the __tmp_path_dir directory:

2021/12/02 09:43:41 INFO: [P#0-T#3] DELETE SUCCESSFUL: temp/test/V_PPMS_ACTION_STATUS.delta/_delta_log/__tmp_path_dir

But later, there is an attempt to delete the parent directory, which ended with an error:

2021/12/02 09:43:42 ERR: [P#0-T#0] https://safordatalake.blob.core.windows.net/promo/temp/test/V_PPMS_ACTION_STATUS.delta?se=2022-01-01t09%3A09%3A33z&sig=-REDACTED-&sp=rdl&sr=c&sv=2019-02-02: 409: DELETE ERROR -409 This operation is not permitted on a non-empty directory.. X-Ms-Request-Id:798666ce-b01e-0014-6a61-e75fcb000000

After the command finished, we saw that the directory __tmp_path_dir still exists.

It is logical that if the / /__tmp_path_dir directory were really deleted, then the 409 error (conflict) would not occur. As you reported, the peculiarity of this situation is that only a few users authorized through AAD / RBAC observe this problem.

How can we reproduce the problem in the simplest way?

  1. Create ADLSGen2-enabled storage account
  2. Create some directory structure within blob container, at least 5 levels deep and fill it in with some files
  3. Configure ADD authorization on SA
  4. Login to SA using Storage Explorer with AAD account
  5. Try to delete folder using Storage Explorer within container, which have subfolder with files inside

Have you found a mitigation/solution?

This problem is not observed when performing the same operation on the Portal using the classic UI or the web version of Storage Explorer.

the-grayest commented 2 years ago

Please, any updates expected?

mohsha-msft commented 2 years ago

Hey @the-grayest ,

Thanks for reaching out! Can you please tell me if you're seeing the same error when running azcopy remove command or is it just happening in Storage Explorer?

the-grayest commented 2 years ago

Hi @mohsha-msft! As described above, we run command azcopy command directly in CMD.

mohsha-msft commented 2 years ago

Discussed Offline.

bclipp commented 2 years ago

what was the resolution?