Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expand upon "Download failed"? #399

Open
sigven opened this issue Oct 4, 2022 · 6 comments
Open

Expand upon "Download failed"? #399

sigven opened this issue Oct 4, 2022 · 6 comments

Comments

@sigven
Copy link

sigven commented Oct 4, 2022

Hi,

Thanks for a very useful package. For reasons I do not fully understand, I experience from time to time download errors when using googledrive to download data from some of my R packages, i.e.

Error in googledrive::drive_download(): ! Download failed.

I suspect it has to do with some download limitations by the Google Drive API, but I am not sure.

Would it be possible to utilize more information regarding the request made, so that the user is somewhat better informed regarding the reason for why the download in fact failed?

kind regards,
Sigve

@jennybc
Copy link
Member

jennybc commented Oct 4, 2022

To work on this, it's very helpful to have a reliable way to experience the problem (the one leading to Download failed). Do you happen to have such a thing? Error handling with these APIs is notoriously hard because it can be hard to get a good example of failure to code against.

@sigven
Copy link
Author

sigven commented Oct 4, 2022

Totally understand. I basically encounter it now and then, and this is why I find it confusing and wanted to figure out why it sometimes fails. But if this is related to some (to me unclear) restrictions that Google imposes on the user download access frequency (?), I guess it's challenging to find a reliable example that I know will fail.

A user of my package just reported an issue where he experienced a download fail, but I have successfully called the same function (oncoEnrichR::load_db()) tonight, so I am fairly unsure.

@jennybc
Copy link
Member

jennybc commented Oct 5, 2022

I can create a branch that actually processes the response in the error case. And then, if you install googledrive from that branch, next time you experience such a failure, you should be able to retrieve the last error from gargle (another package used under the hood). Then you could convey that to me. Do you sometimes see this error yourself?

@sigven
Copy link
Author

sigven commented Oct 5, 2022

Good idea, that sounds like a very helpful strategy. Yes, as I was doing some repeated testing last night, I saw the same error myself.

jennybc added a commit that referenced this issue Oct 5, 2022
jennybc added a commit that referenced this issue Oct 5, 2022
@jennybc
Copy link
Member

jennybc commented Oct 5, 2022

OK if you install googledrive from the (draft) PR or the associated branch, the next time this happens more information may be revealed to you automatically. And you can also call gargle:::gargle_last_response() or gargle:::gargle_last_content() to explicitly get details on the most recent response. Hopefully this will give us more info to decide how to proceed.

devtools::install_github("tidyverse/googledrive#400")
# or
devtools::install_github("tidyverse/googledrive@expose-download-failure")

@sigven
Copy link
Author

sigven commented Oct 6, 2022

Great! Thanks a lot for handling this so quickly.

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

No branches or pull requests

2 participants