You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

sz3324's avatar
sz3324
Explorer | Level 3
10 months ago

Error 400 when trying to download a file

Hello, 

 

I'm using Dropbox for OTA. It worked for long time up until couple of weeks ago. Now, connection is established, folder list is downloaded, but when trying to download a file, I'm receiving Error 400. Your support team answered similar questions (around Error 400), claiming that the format of the HTTPT request might not be 100% correct.

 

This is an embedded system and I'm using a library of the chip vendor, Texas Instrument (TI), so I do not have access to exact format of the HTTP request. I spoke with TI and they asked for a log from your server that shows the mismatch.

 

Is there a way to get a log from your server that shows the format of the received HTTP request?

 

For a reference, here is the Dropbox HTTP Response:

<!DOCTYPE html><LF>
<html><LF>
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><LF>
<meta name="viewport" content="width=device-width, initial-scale=1" /><LF>
<title>Dropbox - 400</title><LF>
<link href="">cfl.dropboxstatic.com/.../error.css" rel="stylesheet" type="text/css"/><LF>
<link rel="shortcut icon" href="">cfl.dropboxstatic.com/.../><LF>
</head><LF>
<body><LF>
<div class="figure"><LF>
<img src="">assets.dropbox.com/.../target-miss.svg" alt="Error: 400"/><LF>
</div><LF>
<div id="errorbox"><LF>
<h1>Error (400)</h1>Something went wrong. Don't worry, your files are still safe and the Dropbox team has been notified. Check out our <a href="">status.dropbox.com">Status Page</a> to see if there is a known incident, our <a href="">www.dropbox.com/help">Help Center</a> and <a href="">forums.dropbox.com">forums</a> for help, or head back to <a href="">www.dropbox.com/.../a>.<LF>
</div><LF>
<LF>
</body><LF>
</html><LF>

 

Thanks,

Shimon

  • Dropbox doesn't offer a way to retrieve request/error logs like that, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.

     

    A 400 error like that would indicate an issue with how the request was formatted, and in cases like that we recommend using client-side logging to inspect the requests that the client is making. You may want to refer to the documentation for the network client you're using and see if you can enable some client-side logging and use that to inspect the request when you reproduce the error.


  • sz3324 wrote:

    ...

    Is there a way to get a log from your server that shows the format of the received HTTP request?

    ...


    Hi sz3324,

    Dropbox (and most other similar services) doesn't provide such logs usually, so server side logs gonna be unavailable to you, as Greg said. In addition, on embedded systems, client side logs are relatively limited where available at all. Usually some coding equilibristics are needed to redirect log to external logging server in such cases, cosa limited local resources.

    In spite, there's an easy trick that let you evaluate the transaction without significant effort and as accurate as possible. Just trace the HTTP of interest itself. 😉 An easy way is using pseudo server as denoted here. Make needed temporary changes to the troublesome request (the download - in your case). In addition you may use some helper tool - like Wireshark, for instance.

    Hope this helps.

    • sz3324's avatar
      sz3324
      Explorer | Level 3

      Thanks. I'll try a pseudo server

      • sz3324's avatar
        sz3324
        Explorer | Level 3

        Hello,

        Here is the problematic request (the one acknowledged with error 400), captured locally just before submitted:

         

        'list_folder' request:
        POST /2/files/list_folder HTTP/1.1<CR><LF>
        Content-Type: application/json<CR><LF>
        Authorization: Bearer sl.Bwg31qNyvs2KjuANe6wfTrBJu2LBO7mrVltkFc9dSYg9VCVfg4NhKyPbZ4Es5QSy2BMHTlno5OBgiF14RAOtFCHpbyWuJ1T-EY5jxgKIbOhDv1Wrq4DwXJR6SUHabSP4AdAHwTM<CR><LF>
        Host: api.dropboxapi.com<CR><LF>
        Content-Length: 41<CR><LF>
        <CR><LF>
        {"path": "/ota_bundle_office","limit": 1}<CR><LF>

         

         

        'list_folder' response:
        {"entries": [{".tag": "file", "name": "20240221072512_CC3220SF.tar", "path_lower": "/ota_bundle_office/20240221072512_cc3220sf.tar", "path_display": "/ota_bundle_office/20240221072512_CC3220SF.tar", "id": "id:dIosUmeVHMoAAAAAAAABVA", "client_modified": "2024-02-21T05:31:31Z", "server_modified": "2024-02-21T05:31:31Z", "rev": "01611dda3b09665000000026de23b50", "size": 573440, "is_downloadable": true, "content_hash": "c31073c7b9ea0a3fa69ff61a6ab8d80e5b51d9fa4ef8eee49384cc5b64071406"}], "cursor": "AAGUl6koiJNa5jclgopptYqRLLcfflMtyH4JCF0vnMrlWQ51eowHqMHoXjqHlaDMXOrhfzWY3yBqNRuGqrAgeS2n-Yf9OlPbeL03QBJ9uw3s2sAm-dAMk9r5JiK8ypWoLwhrYUtVsesIJ_8wu9N1J00J_kZpWsHG1iiuws4AmBtggVPtTKBNtD8TIZMGwQ9z1RrZtbYuHmoMXZ_Vm8a8CRDYen9zNkZsMRHsMOCUkj0b9w", "has_more": false}0<LF><CR>

         


        problematic request:
        POST /2/files/get_temporary_link HTTP/1.1<CR><LF>
        Content-Type: application/json<CR><LF>
        Authorization: Bearer sl.Bwg31qNyvs2KjuANe6wfTrBJu2LBO7mrVltkFc9dSYg9VCVfg4NhKyPbZ4Es5QSy2BMHTlno5OBgiF14RAOtFCHpbyWuJ1T-EY5jxgKIbOhDv1Wrq4DwXJR6SUHabSP4AdAHwTM<CR><LF>
        Host: api.dropboxapi.com<CR><LF>
        Content-Length: 58<CR><LF>
        <CR><LF>
        {"path": "/ota_bundle_office/20240221072512_CC3220SF.tar"}<CR><LF>

         

         

        error 400 response:
        <!DOCTYPE html><LF>
        <html><LF>
        <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><LF>
        <meta name="viewport" content="width=device-width, initial-scale=1" /><LF>
        <title>Dropbox - 400</title><LF>
        <link href="https://cfl.dropboxstatic.com/static/metaserver/static/css/error.css" rel="stylesheet" type="text/css"/><LF>
        <link rel="shortcut icon" href="https://cfl.dropboxstatic.com/static/images/favicon.ico"/><LF>
        </head><LF>
        <body><LF>
        <div class="figure"><LF>
        <img src="https://assets.dropbox.com/www/en-us/illustrations/spot/target-miss.svg" alt="Error: 400"/><LF>
        </div><LF>
        <div id="errorbox"><LF>
        <h1>Error (400)</h1>Something went wrong. Don't worry, your files are still safe and the Dropbox team has been notified. Check out our <a href="https://status.dropbox.com">Status Page</a> to see if there is a known incident, our <a href="https://www.dropbox.com/help">Help Center</a> and <a href="https://forums.dropbox.com">forums</a> for help, or head back to <a href="https://www.dropbox.com/home">home</a>.<LF>
        </div><LF>
        <LF>
        </body><LF>
        </html><LF>
        <LF><CR>

         

        Can you please help identify the incompatible format part? Thanks

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    sz3324 I just wanted to follow up here to let you know we believe we've tracked down and replicated the issue here. Please refer to the post here for more information.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,910 PostsLatest Activity: 4 days ago
333 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!