StadlerlabRice / WW-CoV2-project

Plotting qPCR and ddPCR data for WWTPs
0 stars 1 forks source link

Client error: (429) : Quota exceeded limit of 'Read requests per 100 seconds' #26

Closed ppreshant closed 4 years ago

ppreshant commented 4 years ago

I occassionally get this error message when doing read_sheet() over multiple google sheets in a short duration of time.

Full error message

Error: Client error: (429) RESOURCE_EXHAUSTED
  * Either out of resource quota or reaching rate limiting. The client should look for google.rpc.QuotaFailure error detail for more information.
  * Quota exceeded for quota group 'ReadGroup' and limit 'Read requests per 100 seconds' of service 'sheets.googleapis.com' for consumer 'project_number:603366585132'.

Error details:
  * Error details of type 'google.rpc.Help' are not implemented yet.
  * Workaround: use `tryCatch()` and inspect error payload yourself.
  * Please open an issue at https://github.com/r-lib/gargle/issues, so we can fix.

This can be solved by creating a google cloud platform project and getting service account (or an API key) to run with the google sheets API through the R package. Here is a great reference linked to a document with all the necessary details.

Can you figure out how to set this up @DavidZong ?

DavidZong commented 4 years ago

made a file called enable_api.r in branch issue26. To use: Restart R studio to clear your old token. Paste in keys (can't upload these to github because security) Source enable_api.r. Run a command to read a sheet, it should ask you to log in to an app called CovidWW.

ppreshant commented 4 years ago

Works great now!

It should be good for right now, but is there anyway this authentication can be done only once and then stored, just like it stores the google account pre-authorized?

In case someone else in our group (Camille knows R) wants to use this, what would be the best practice for this API authentication? Since we can't paste the keys here, it looks like everyone should have this enable_api.r file in their local computer with the keys pasted with the file not tracked in the git, or somehow it should not be pushed to remote.

Is there any other way we can apply this?

DavidZong commented 4 years ago

The API keys should only really be used for heavy use cases. For typical weekly processing, not running enable_api.r will allow you to use your own personal login as usual.

ppreshant commented 4 years ago

That makes sense. Thank you for the clarification

On Tue, Sep 22, 2020, 10:37 AM David Zong notifications@github.com wrote:

The API keys should only really be used for heavy use cases. For typical weekly processing, not running enable_api.r will allow you to use your own personal login as usual.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ppreshant/WW-CoV2-project/issues/26#issuecomment-696801310, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADRLCH7O3YTS7QNDSKZCTFDSHDACXANCNFSM4RSH5X7A .