Skip to content
This repository has been archived by the owner on Oct 31, 2019. It is now read-only.

Can't read/write to blob storage #108

Open
IyarLin opened this issue Jan 1, 2018 · 2 comments
Open

Can't read/write to blob storage #108

IyarLin opened this issue Jan 1, 2018 · 2 comments

Comments

@IyarLin
Copy link

IyarLin commented Jan 1, 2018

Hi,

I've been able to interact with blob storage in the following ways: list all storage containers, list all storage blobs.

When I try writing a new blob using the following command:
azurePutBlob(sc,
storageAccount = "csb1898e872be2fx4a7bxac8",
container = "reports",
contents = "HELLO",
blob = "Ad Group Performance Report2.csv")
I get the following error message:
"Opening and ending tag mismatch: meta line 5 and head
Opening and ending tag mismatch: hr line 9 and body
Opening and ending tag mismatch: body line 7 and html
Premature end of data in tag head line 3
Premature end of data in tag html line 2"

Same happens when I try reading one of the blobs using the following command:
azureGetBlob(sc, storageAccount = "csb1898e872be2fx4a7bxac8",
container = "reports",
blob="Audience Performance Report",
type="text")
Many thanks

Iyar

@brnleehng
Copy link
Member

brnleehng commented Mar 1, 2018

Hi @IyarLin

You are getting errors on the parsing HTML because the storage response returned a bad 400 malformed request. The blob name 'Ad Group Performance Report' is not
URL encoded. AzureSMR will need to URL encode the blob name so the user doesn't have to do it.

Response [https://storageaccount.blob.core.windows.net/containerName/Ad Group Performance Report]
Date: 2018-02-27 22:50
Status: 400
Content-Type: text/html; charset=us-ascii
Size: 311 B

<TITLE>Bad Request</TITLE> Bad Request

HTTP Error 400. The request is badly formed.

Fix:
ad_group = azureGetBlob(sc, storageAccount = "storageAccount",
container = "container",
blob=utils::URLencode(blobName),
type="text")

@IyarLin
Copy link
Author

IyarLin commented Mar 4, 2018

Many thanks! It works

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants