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
ABDUL Salam
3 months agoExplorer | Level 3
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.
- Greg-DBDropbox Staff
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 SalamExplorer | Level 3
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:
payload:{"path":"/MY_DIRECTORY_PATH/MY_FILE_NAME.pdf","url":"https://cdn.customily.com/ExportFile/personalisedfavours/171c5f4e-3c06-42ea-9d62-99638315b4b6.pdf"}uploaded customily orders to dropbox: {".tag": "async_job_id", "async_job_id": "7na9uA-KPmwAAAAAAAAAAQ"}payload:{"path":"/MY_DIRECTORY_PATH/MY_FILE_NAME.pdf","url":"https://cdn.customily.com/ExportFile/personalisedfavours/85b4fe9c-aade-407d-9718-116796b7bf84.pdf"}uploaded customily orders to dropbox: {".tag": "async_job_id", "async_job_id": "cxg9F1PkAXcAAAAAAAAAAQ"}payload:{"path":"/MY_DIRECTORY_PATH/MY_FILE_NAME.pdf","url":"https://cdn.customily.com/ExportFilepersonalisedfavours/518055b4-1fd5-4e8e-9f04-89f119cbc4a7.pdf"}uploaded customily orders to dropbox: {".tag": "async_job_id", "async_job_id": "aLCjk-ilEX4AAAAAAAAAAQ"}payload:{"path":"/MY_DIRECTORY_PATH/MY_FILE_NAME.pdf","url":"https://cdn.customily.com/ExportFile/personalisedfavours/c209a19e-c7e4-46b2-85a0-5ac37d98ed90.pdf"}on checking using job status check api i get tag "complete"
Failed Upload:payload:{"path":"/MY_DIRECTORY_PATH/MY_FILE_NAME.pdf","url":"https://cdn.customily.com/ExportFile/personalisedfavours/c209a19e-c7e4-46b2-85a0-5ac37d98ed90.pdf"}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-DBDropbox Staff
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.
- ЗдравкоLegendary | Level 20
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.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,884 PostsLatest Activity: 4 hours agoIf 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!