fabiogiglietto/CooRnet

object '.Depends' not found for get_ctshares

zarinekharazian opened this issue · 8 comments

Hello CooRnet team!

Running into a weird error I haven't seen before... when i run

ctshares <- get_ctshares(urls, "url", "date")

I get Request failed [429]. Retrying in 30 seconds... and this Traceback:

object '.Depends' not found

9. Sys.sleep(length) 8. backoff_full_jitter(i, resp, pause_base, pause_cap, pause_min, quiet = quiet) 7. httr::RETRY(verb = "GET", url = query.string, times = 3, terminate_on = c(401), pause_base = sleep_time, pause_cap = 10, pause_min = sleep_time) 6. doTryCatch(return(expr), name, parentenv, handler) 5. tryCatchOne(expr, names, parentenv, handlers[[1L]]) 4. tryCatchList(expr, classes, parentenv, handlers) 3. tryCatch({ httr::RETRY(verb = "GET", url = query.string, times = 3, terminate_on = c(401), pause_base = sleep_time, pause_cap = 10, pause_min = sleep_time) ... 2. query_link_enpoint(query.string, sleep_time) 1. get_ctshares(urls, "url", "date", platforms = "facebook"

Any ideas what may be the culprit? I am using the latest version of CooRnet and R 4.1.3.

-Zarine

Hi Zarine,
weird message. Let me try to replicate the issue. I'll get back to you asap.

Best, Fabio

Hi Zarine,
we tried to replicate the issue without success. Are you still experiencing this problem?

Weird , yes, I even reinstalled R and RStudio, still getting the same issue.

Can you upload the code you are using and a sample (or all) of your URLs?

Yes, the code thus far is just:

#load CoorNet
library(CooRnet)
library(tidyverse)

#Get urls 
urls <- get_urls_from_ct_histdata(ct_histdata_csv="2022-04-22-19-07-36-EDT-Historical-Report-MINUSCA-casques-bleus-casque-bleu-ONU-AND-RCA-Centrafrique-2020-12-01--2022-04-01.csv")

#Get  list of urls shared by these pages 
ctshares <- get_ctshares(urls, "url", "date")

Here's a random sample of the file generated by get_urls_from_ct_histdata:

sample_urls.csv

Hi Zarine,
we used your code and urls to replicate your issue. With our enhanced token (you may ask to increase the rate limit of your token at https://www.facebook.com/help/contact/908993259530156) everything is completed without warnings. With a standard token we got multiple 429 warning us that we reached the rate limit. This is however just a warning. The app pauses and then tries again after a certain amount of time (depending from the sleep time). That said, even in this case the process completed successfully.

Thing I would try: Apply for increased rate limit; Upgrade the httr package; Using a different set of URLs; Using a different value for the sleep time parameter when calling get_ctshares.

Please keep us posted. Best, Fabio

Thank you for checking! Just got my rate limit for the dashboard upped to 60/calls per min and tried again... had no problem with the smaller sample dataset of just ~200 urls and it generated ctshares. The larger dataset of ~27,000 urls is still giving a lot of warnings. Although maybe that's okay as the app tries again, and I just need to let it run for a few hours or split up into smaller datasets.

Excellent. You may want to increase the sleep_rate parameter to avoid the errors. However, as you said, it just retries until it succeeds. Best, Fabio