We Want to Hear From You! What Do You Want to See on the Community? Tell us here!

Forum Discussion

ABDUL Salam's avatar
ABDUL Salam
Explorer | Level 3
10 months ago

Handling download_failed Errors in Dropbox API Jobs

I have a cron script that fetches PDF URLs and saves them to our Dropbox. Sometimes, I encounter a download_failed error for some files.

When using the save_url endpoint, I receive an asyn_job_id, which I then use to check the job status via the check_job_status endpoint. The response I get looks like this:
{
".tag": "failed",
"failed": {
".tag": "download_failed"
}
}
I s there a way I can see why it failed ?
Thanks.

5 Replies

  • Здравко's avatar
    Здравко
    Legendary | Level 20
    10 months ago

    ABDUL Salam wrote:

    ...
    I s there a way I can see why it failed ?
    ...


    Hi ABDUL Salam,

    Yes, probably there is. Just take a look on the code producing your error and see why it does that. If somebody else coded it, ask this person. In all cases, that's not Dropbox API error.

    Good luck.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 months ago

    ABDUL Salam A 'download_failed' error from /2/files/save_url/check_job_status should indicate that the save job failed because the supplied URL wasn't accessible. So as Здравко said, check out the code supplying the URL, as well as the URL itself, to make sure it's sending a working URL.

     

    If you've done so and you're sure the URL itself is/was working though, feel free to open a ticket here and supply a sample URL so we can reproduce the error and we'll be happy to look into it to check why it's failing.

  • ABDUL Salam's avatar
    ABDUL Salam
    Explorer | Level 3
    10 months ago

    Hi Greg-DB 

    Thank you for your guidance regarding the 'download_failed' error. I appreciate your support.


    I maintain detailed cron logs and record the payloads sent to the Dropbox API. I’ve reviewed the logs, and I can confirm that all URLs except one were successfully saved. There are couple of instances in which I have faced same problem. If there’s a code-side issue, I would expect that the other URLs would have failed as well.

    Here’s the relevant payload from the logs for reference:

    Successful Uploads:

    uploaded customily orders to dropbox: {".tag": "async_job_id", "async_job_id": "7na9uA-KPmwAAAAAAAAAAQ"}
    uploaded customily orders to dropbox: {".tag": "async_job_id", "async_job_id": "cxg9F1PkAXcAAAAAAAAAAQ"}
    uploaded customily orders to dropbox: {".tag": "async_job_id", "async_job_id": "aLCjk-ilEX4AAAAAAAAAAQ"}

    on checking using job status check api i get tag "complete"
    Failed Upload:

    Response: {".tag": "async_job_id", "async_job_id": "bSXBts0RiioAAAAAAAAAAQ"

    on checking using job status check api i get download_failed for this job
    Please let me know if you’d like me to open a ticket with this information.

    Thank you for your assistance!

     

     

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 months ago

    ABDUL Salam Thanks for sharing the sample. It looks like this is hitting an internal constraint. We'll look into what we may be able do about that. In the meantime, to work around this, you may want to add an automatic retry or two (i.e., starting at save_url again for the relevant URL) when this occurs.

  • ABDUL Salam's avatar
    ABDUL Salam
    Explorer | Level 3
    10 months ago

    Thanks for your quick response Greg-DB  I appreciate your help in looking into the internal constraint. I’d be happy to stay updated on any developments regarding that.

    I understand the need for a workaround, but I was hoping to minimize extra API calls in my script, particularly with the save URL and status checker endpoint. In the meantime, I’ll go ahead and implement the retry mechanism to reduce the impact.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,033 PostsLatest Activity: 4 hours ago
409 Following

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

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!