Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AzCopy Sync command is failing

I'm issuing this command:

azcopy sync "D:\Releases\Test\MyApp" "http://server3:10000/devstoreaccount1/myapp?sv=2019-02-02&st=2020-06-24T03%3A19%3A44Z&se=2020-06-25T03%3A19%3A44Z&sr=c&sp=racwdl&sig=REDACTED"

...and I'm getting this error:

error parsing the input given by the user. Failed with error Unable to infer the source 'D:\Releases\Test\MyApp' / destination 'http://server3:10000/devstoreaccount1/myapp?sv=2019-02-02&st=2020-06-24T03%3A19%3A44Z&se=2020-06-25T03%3A19%3A44Z&sr=c&sp=racwdl&sig=-REDACTED-

I would have thought my source was pretty clear.

Can anyone see anything wrong with my syntax?

like image 993
InteXX Avatar asked Oct 15 '25 04:10

InteXX


1 Answers

I believe you have run into an issue with azcopy that it does not support local emulator (at least for sync command). There's an open issue on Github for the same: https://github.com/Azure/azure-storage-azcopy/issues/554.

Basically the issue is coming from the following lines of code, where it returns location as Unknown in case of storage emulator URLs:

func inferArgumentLocation(arg string) common.Location {
    if arg == pipeLocation {
        return common.ELocation.Pipe()
    }
    if startsWith(arg, "http") {
        // Let's try to parse the argument as a URL
        u, err := url.Parse(arg)
        // NOTE: sometimes, a local path can also be parsed as a url. To avoid thinking it's a URL, check Scheme, Host, and Path
        if err == nil && u.Scheme != "" && u.Host != "" {
            // Is the argument a URL to blob storage?
            switch host := strings.ToLower(u.Host); true {
            // Azure Stack does not have the core.windows.net
            case strings.Contains(host, ".blob"):
                return common.ELocation.Blob()
            case strings.Contains(host, ".file"):
                return common.ELocation.File()
            case strings.Contains(host, ".dfs"):
                return common.ELocation.BlobFS()
            case strings.Contains(host, benchmarkSourceHost):
                return common.ELocation.Benchmark()
                // enable targeting an emulator/stack
            case IPv4Regex.MatchString(host):
                return common.ELocation.Unknown()//This is what gets returned in case of storage emulator URL.
            }

            if common.IsS3URL(*u) {
                return common.ELocation.S3()
            }
        }
    }

    return common.ELocation.Local()
}
like image 64
Gaurav Mantri Avatar answered Oct 17 '25 01:10

Gaurav Mantri



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!