azure-storage-azcopy: Exit codes documentation is missing

Without having exit codes documented, the experience to troubleshoot what happened remotely (in this case the command is executed in Azure Function) is very challenging. Please document exit codes.

Which version of the AzCopy was used?

Version 10 (latest)

Note: The version is visible when running AzCopy without any argument

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

Linux

What command did you run?

azcopy cp "{sourcePath}/*.*" "{destination}" --from-to LocalBlob --check-length=false");

where sourcePath is a local folder and destination is a blob URI with SAS token (can write)

What problem was encountered?

This is all I got from azcopy’s failure to run:

**exit code 2**

log files have showed the following:

panic: mkdir : The system cannot find the path specified.
goroutine 1 [running]:
github.com/Azure/azure-storage-azcopy/v10/common.PanicIfErr(...)
/home/vsts/work/1/s/common/lifecyleMgr.go:583
main.main()
/home/vsts/work/1/s/main.go:55 +0x589

How can we reproduce the problem in the simplest way?

N/A

Have you found a mitigation/solution?

No

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 15 (9 by maintainers)

Most upvoted comments

I apologize – I went back to double check logs and after I added the environment variables azcopy is working! So, to sum it up, by manually setting AZCOPY_LOG_LOCATION & AZCOPY_JOB_PLAN_LOCATION to C:\local\Temp azcopy is now working.

How could we sum this issue up then? azcopy, when running in a Function, doesn’t have permission to create the .azcopy directory in the “USERPROFILE” directory and therefore we need to explicitly set those two settings?

Summary note: provide a more meaningful error instead of panic for failure to create log directory.

@seankearney glad to hear you are unblocked.

It is quite strange that the error didn’t always happen. In fact, @adreed-msft also implemented an Azure Function that called AzCopy but didn’t encounter it. We should improve the error message regardless though. Thanks for your findings.