locked
AZcopy exception - can't pinpoint issue RRS feed

  • Question

  • I'm trying to set up AZcopy to send our SQL backups into an Azure Blob as an of-site backup option. The operation starts fine, then suddenly crashes with the following error:


    Unhandled Exception: System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
       at Microsoft.WindowsAzure.Storage.DataMovement.Interop.NativeMethods.ThrowExceptionForLastWin32ErrorIfExists(Int32 errorCode, Int32[] expectErrorCodes)
       at Microsoft.WindowsAzure.Storage.DataMovement.TransferEnumerators.EnumerateDirectoryHelper.CheckPathDiscoveryPermission(String dir)
       at Microsoft.WindowsAzure.Storage.DataMovement.TransferEnumerators.EnumerateDirectoryHelper.<InternalEnumerateFiles>d__2.MoveNext()
       at Microsoft.WindowsAzure.Storage.DataMovement.TransferEnumerators.FileEnumerator.<EnumerateLocation>d__8.MoveNext()
       at Microsoft.WindowsAzure.Storage.DataMovement.MultipleObjectsTransfer.ListNewTransfers(CancellationToken cancellationToken)
       at System.Threading.Tasks.Task.Execute()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.WindowsAzure.Storage.DataMovement.MultipleObjectsTransfer.<ExecuteAsync>d__30.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at Microsoft.WindowsAzure.Storage.DataMovement.MultipleObjectsTransfer.<ExecuteAsync>d__30.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.WindowsAzure.Storage.DataMovement.DirectoryTransfer.<ExecuteAsync>d__17.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.WindowsAzure.Storage.DataMovement.TransferManager.<DoTransfer>d__73.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.WindowsAzure.Storage.DataMovement.TransferManager.<UploadDirectoryInternalAsync>d__70.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.WindowsAzure.Storage.AzCopy.DirectoryTransferLauncher.<UploadDirectory>d__3.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.WindowsAzure.Storage.AzCopy.DirectoryTransferLauncher.<ExecuteImplAsync>d__1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.WindowsAzure.Storage.AzCopy.TransferLauncherBase.<ExecuteAsync>d__14.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.WindowsAzure.Storage.AzCopy.BlobFileTransfer.DoTransfer()
       at Microsoft.WindowsAzure.Storage.AzCopy.AzCopy.ExecuteTransfer()
       at Microsoft.WindowsAzure.Storage.AzCopy.AzCopy.Execute(String[] args)
       at Microsoft.WindowsAzure.Storage.AzCopy.AzCopy.Main(String[] args)


    Unfortunately, there's no real information about WHAT specifically the application cannot access. The current user should have full control over the source location, and the SAS key for the blob is correct (after all, part of the operation seems to complete correctly). I'd like to check what exactly is AZcopy trying to copy at that point, but it's not logging that information, and the journal files are binary and cannot be opened.


    Any suggestions?

    Monday, May 7, 2018 11:24 AM

All replies

  • "Access denied" errors are generally caused by insufficient permissions. Could you confirm you have enough permissions to execute the command?  Try to execute your prompt as an Administrator. Make sure you have enough permission on the source also. Which version of Az copy you are using?

    Just to confirm, are you using this cmdlet?

    AzCopy /Source:LOCALPATH /Dest:https://SOMETHING.blob.core.windows.net/SOMETHING /DestKey:YOURKEY /Pattern:"FILENAME.EXTENSION"

    Also make sure to use /Y switch when you run AZ copy. Refer this link for more information .

    Disclaimer: This response contains a reference to a third-party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Monday, May 7, 2018 1:52 PM
  • Mateusz,

    Did Sandeep's suggestions below help you resolve the issue?  If not, you can try an alternative upload tool which we (Microsoft) recently released here: https://www.microsoft.com/en-us/garage/profiles/fast-data-transfer/?group=newest 

    It's a bit more work to set it up, compared to AzCopy, since it requires a server-side VM running in your subscription. However, if there is a permission denied error reading a file (which appears to be the issue in this case) it will log the details of the failed file (in a log file called error-files<date>.log). There's also a parameter called UnauthorizedFileAction which may help. 

    John


    John Rusk, http://dotnet.AgileKiwi.com - .NET and Agility

    • Proposed as answer by vikranth s Wednesday, May 16, 2018 12:45 PM
    Sunday, May 13, 2018 10:27 PM