-
Notifications
You must be signed in to change notification settings - Fork 205
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
Azcopy sync on IOT edge blob #1031
Comments
Any luck on this? I'm running into the same problem. It may be because we're trying to sync to the emulator and not a real storage account. I'll test for that tomorrow and let you know what I find out. |
It's definitely a bug when connecting to an emulator:
For a moment I was hopeful that AzureCLI might work for this, but it turns out that AzureCLI uses AzCopy under the hood. So we wait. |
FYI, the code in validators.go is also the cause of issue 713. Sure would be nice to get this fixed, it could potentially clear out several emulator-related issues. |
I am currently experiencing this exact same issue. Really frustrating. |
Hi, Apologies for the delayed response here. Are you still unable to sync to emulator? I just attempted to run a similar command and did not hit the failure to parse the URL. |
I'm still getting an error when attempting to sync to Azurite on a remote server (on my LAN):
I also tried:
...as that syntax is indicated in the auto-generated code by Storage Explorer. Same error. Note that the usage guidance doesn't provide an example for syncing to an emulator, i.e. what the URL should contain:
In any case, the relevant source code hasn't changed since my original post on this thread of Jun 24, 2020. The line numbers have changed, yes, but not code surrounding the bug. |
@InteXX could you try manually specifying the --from-to CLI parameter? In this case it would be LocalBlob |
Results in:
|
@InteXX sorry I was a little unclear. Could you run this?
|
Same result:
|
It appears I'm running an old version: I'm working out how to update... |
|
@InteXX if you are running against Azurite, you need to provide SAS or OAuth token or make your resource in Azurite public |
I seem to remember this from a while back, from somewhere else. How to fix that header value? |
Are you running the latest Azurite version? I believe its v3 |
I'm running v3.28.0. Is that the latest? I found that error message problem: Azure/azure-sdk-for-net#14257 |
Yes, this should be the latest version. |
I run my Go code in GoLand, but VSCode has extensions to build and run go code as well. Since Azurite has the same static key, for now I should just be able to generate the URL for you to test. This should last a day. Just replace the 127.0.0.1 with server5 |
Thanks, that got me started. At least there's no error message now. But the sync hangs on the last of the three files in that folder—and it's always a different file. I made sure the files aren't in use, and I even copied them to a different source folder. Same result. Odd... |
I can try and take a look at the log to see if theres anything causing a hang |
I'm getting the memory error again. Could you regenerate that SAS and this time exclude Service and Object from the resources? |
Is this the extension? https://marketplace.visualstudio.com/items?itemName=golang.go |
Technically removing the o will not allow any object level operations to be performed, so it shouldnt be removed, but you can try both. Here is s removed Here is s and o removed |
Yes that should be right. You need the code I pasted above saved as a file named main.go, then also a file called go.mod with the following contents to grab dependencies.
|
This should also have more info on how to set up VSCode for Go https://code.visualstudio.com/docs/languages/go |
|
Could you run 'go mod tidy' in the directory where the go.mod and main.go files are? |
Got it. The code is running (thanks), but now I'm getting the auth error again. |
What's the difference between the SAS generated with this code and the SAS generated by Azure Storage Explorer? |
The only obvious difference I see is the SAS version (sv query parameter) being used to generate the SAS, Go SDK uses 2020-02-10 and Storage Explorer is 2023-01-03 |
It's worth noting that the one time I did get it to run without an error (link here), When I try now using that same SAS, though, I get the memory error:
Log:
|
@InteXX I took a look at the Azurite thread above, were you able to resolve your issue? |
Yes, it works now. If I may, I'd like to suggest an update to the documentation—both online and command line usage—so that others will be less likely to encounter this problem in the future. Thank you. |
Absolutely, could you share more details on what you'd like updated? I can create a new issue and tag it appropriately. |
Certainly, I'd love to. Firstly, the SAS generator in Azure Storage Explorer generates incorrect URL syntax for a successful
This is incorrect. The syntax should be instead:
For this to work the DNS record must exist, e.g. assuming we're hosting Azurite on Also, this CLI switch is mandatory:
In the end, my complete successful command was:
That's what is unclear in the documentation, in both online and CLI usage sources... the proper URL syntax to use when connecting locally to Azurite. All of the provided examples assume a remote connection with Azure. I've searched the online documentation here for any mention of Azurite and I'm coming up empty. Nor am I finding Azurite syntax in the CLI usage text. These documentation oversights may extend to other Let me know if you have any questions about my findings on the matter. Thank you for your consideration. |
That looks good, and thank you, but my supplied URL syntax didn't make it through for some reason. A minor edit is in order. These URLs:
...should instead be:
It appears the brackets are throwing things off. Perhaps wrapping them in code formatting will allow the bracketed text. |
Gauri, I've been thinking... Maybe this isn't a documentation issue at all. Maybe it's an issue internal to I'll concede that I haven't tested my theory here against every
Perhaps the documentation (and Azure Storage Explorer) are correct and |
Which version of the AzCopy was used? - 10.4.3
Which platform are you using? Mac and Linux
What command did you run?
./azcopy sync "/Home/data" "http:/127.0.0.1:11002/exptest/demo?[SAS]"
What problem was encountered?
When trying syn files from local system into iot edge blob storage using azcopy sync
I get the following error
INFO: Cannot infer destination location of http://127.0.0.1:11002/exptest/demo?[SAS]. Please specify the --from-to switch. Valid values are two-word phases of the form BlobLocal, LocalBlob etc. Use the word 'Blob' for Blob Storage, 'Local' for the local file system, 'File' for Azure Files, and 'BlobFS' for ADLS Gen2. If you need a combination that is not supported yet, please log an issue on the AzCopy GitHub issues list.
error parsing the input given by the user. Failed with error Unable to infer the source '/Home/data' / destination 'http://127.0.0.1:11002/exptest/demo?[SAS]
I tried adding --from-to switch then the error I get is
Error: unknown flag: --from-to
Then I created a local host entry on the linux vm
vi /etc/hosts
and added the following line
127.0.0.1 exptest.blob.core.windows.net
Then the sync command I used was
./azcopy sync "/Home/data" "https://exptest.blob.core.windows.net:11002/demo?[SAS]"
the output was
3 Files Scanned at Source, 0 Files Scanned at Destination and the program was stuck here for ever
How can we reproduce the problem in the simplest way?
Follow the instructions here to https://docs.microsoft.com/en-us/azure/iot-edge/how-to-deploy-blob launch a iot edge blob on a linux VM
The log into the VM and try to sync a file into blob storage running on the VM
./azcopy sync "/Home/data" "http:/127.0.0.1:11002/exptest/demo?[SAS]"
Have you found a mitigation/solution?
NO
Any help is much appreciated
The text was updated successfully, but these errors were encountered: