locked
Fail to upload file to blob service RRS feed

  • Question

  • Hello,

    We are using libcurl, REST APIs and C++ to write an application to upload/download file to/from Azure Blob Storage.  However, we fail to upload a file and get Http 400 error code.   See the request/Response in below

    [CURL]: PUT /container1/arkazurerepository/2001/000/000/103 HTTP/1.1
    Host: devazurestorage2016.blob.core.windows.net
    Accept: */*
    Transfer-Encoding: chunked
    Content-Length: 592033
    x-ms-blob-type: BlockBlob
    x-ms-date: Wed, 09 Nov 2016 01:54:14 GMT
    x-ms-version: 2015-02-21
    Authorization: SharedKey devazurestorage2016:It1hQ08Q1JTmJeW38fxowGwj1ae6/HoeiScLqzTa1ew=
    Expect: 100-continue

    [CURL]: HTTP/1.1 400 The value for one of the HTTP headers is not in the correct format.
    [CURL]: Content-Length: 322
    [CURL]: Content-Type: application/xml
    [CURL]: Server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
    [CURL]: x-ms-request-id: b70b364d-0001-003a-3d2c-3abca9000000
    [CURL]: x-ms-version: 2015-02-21
    [CURL]: Date: Wed, 09 Nov 2016 01:54:20 GMT
    [CURL]: HTTP error before end of send, stop sending
    [CURL]: Closing connection 0

    'https://devazurestorage2016.blob.core.windows.net/container1/arkazurerepository/2001/000/000/103'(status code:400, message:). 

    Response:
    <?xml version="1.0" encoding="utf-8"?><Error><Code>InvalidHeaderValue</Code><Message>The value for one of the HTTP headers is not in the correct format.
    RequestId:b70b364d-0001-003a-3d2c-3abca9000000
    Time:2016-11-09T01:54:20.4402809Z</Message><HeaderName>Content-Length</HeaderName><HeaderValue>-1</HeaderValue></Error>The thread 0xed4 has exited with code 0 (0x0).

    It compains about Content-Length.  Does anyone have any idea about it?

    Thanks,

    Jonathan


    Jonathan Hsueh

    Wednesday, November 9, 2016 2:19 AM

All replies

  • Hi Jonathan,

    The error seems to indicate that the request size is not matching the content length provided. We need to look at the actual data on the wire and compare it to what is being provided. 

    I recommend you to create a technical support ticket. The ticket enables you to work closely with the support engineers and get a quick resolution to your issue.

     

    Here is the link http://azure.microsoft.com/en-us/support/options/ to create support case.

    Regards,

    MD. Shihab

    Wednesday, November 9, 2016 3:30 PM
  • Hi Shihab,

    Thanks for the suggestion.  I have another question.  I tried to "ping" the endpoint.  It fails.  Is it normal?

    C:\>ping devazurestorage2016.blob.core.windows.net

    Pinging blob.by3prdstr03a.store.core.windows.net [23.99.32.78] with 32 bytes of data:
    Request timed out.
    Request timed out.
    Request timed out.
    Request timed out.

    Ping statistics for 23.99.32.78:
        Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

    Regards,

    Jonathan


    Jonathan Hsueh

    Friday, December 2, 2016 12:17 AM
  • Hi Jonathan,

    Ping command won't work in Azure as ICMP protocol is not permitted through the Azure Load Balancer. I think you could use PsPing (part of the Microsoft SysInternals suite) as an alternative to Ping. Hope this helps!

    Regards.

    Md. Shihab

    ***************************************************************************

    Please remember to click "Mark as Answer" on the post that helps you as this can be beneficial to other community members reading the thread. And vote as helpful.

    Sunday, December 4, 2016 8:57 AM
  • Hi Shihab,

    PsPing doesn't work either. Does it require port# ?

    C:\PSTools>psping -h 10 -i 0 -l 1500 -n 5 -4 23.99.32.70

    PsPing v2.10 - PsPing - ping, latency, bandwidth measurement utility
    Copyright (C) 2012-2016 Mark Russinovich
    Sysinternals - www.sysinternals.com

    Pinging 23.99.32.70 with 1500 bytes of data:
    6 iterations (warmup 1) ping test:
    Error pinging 23.99.32.70:
    Request timed out.
    Error pinging 23.99.32.70:
    Request timed out.
    Error pinging 23.99.32.70:
    Request timed out.
    Error pinging 23.99.32.70:
    Request timed out.
    Error pinging 23.99.32.70:
    Request timed out.
    Error pinging 23.99.32.70:
    Request timed out.

    Ping statistics for 23.99.32.70:
      Sent = 5, Received = 0, Lost = 5 (100% loss),
      Minimum = 0.00ms, Maximum = 0.00ms, Average = 0.00ms

    Latency Count
    4997.19 1
    4997.35 0
    4997.50 0
    4997.65 1
    4997.80 0
    4997.95 0
    4998.10 1
    4998.26 1
    4998.41 0
    4998.56 1

    I knew I have no problem to ping our account in Amazon S3.  However, I have problem to ping\psping my Azure account.  Will this cause to fail to use libcurl to call read callback function?

    Thanks,

    Jonathan


    Jonathan Hsueh

    Wednesday, December 7, 2016 5:59 PM
  • Hi Jonathan,

    Yes, PsPing requires you to specify the port. An example of this is shown below. Hope this helps!

    Regards.

    Md. Shihab

    ***************************************************************************

    Please remember to click "Mark as Answer" on the post that helps you as this can be beneficial to other community members reading the thread. And vote as helpful.

    • Proposed as answer by Md Shihab Tuesday, December 20, 2016 10:56 AM
    Thursday, December 8, 2016 2:56 AM