daroczig / fbRads

Analyze and manage Facebook ads from R using this client library to access their Marketing APIs
GNU Affero General Public License v3.0
153 stars 57 forks source link

Unsupported get request. Object with ID 'vhttps:' does not exist #141

Closed thomiko closed 3 years ago

thomiko commented 3 years ago

Since mid last week I keep getting these error messages with fbRads without having changed anything in my scripts (here I anonymised the IDs):

ERROR [2021-07-18 23:17:36] Header: {"Vary":["Origin"],"Vary.1":["Accept-Encoding"],"Access-Control-Allow-Origin":["*"],"x-app-usage":["{\"call_count\":0,\"total_cputime\":0,\"total_time\":0}"],"x-fb-rlafr":["0"],"Content-Type":["application/json; charset=UTF-8"],"WWW-Authenticate":["OAuth \"Facebook Platform\" \"invalid_request\" \"Unsupported get request. Object with ID 'vhttps:' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api\""],"facebook-api-version":["v10.0"],"Strict-Transport-Security":["max-age=15552000; preload"],"Pragma":["no-cache"],"Cache-Control":["no-store"],"Expires":["Sat, 01 Jan 2000 00:00:00 GMT"],"x-fb-request-id":["XXXXX"],"x-fb-trace-id":["XXX"],"x-fb-rev":["1004123960"],"X-FB-Debug":["XXXXXXXXXXXXXXX"],"Date":["Sun, 18 Jul 2021 21:17:37 GMT"],"Priority":["u=3,i"],"Transfer-Encoding":["chunked"],"Alt-Svc":["h3-29=\":443\"; ma=3600,h3-27=\":443\"; ma=3600"],"Connection":["keep-alive"],"status":["400"],"statusMessage":["Bad Request"]} ERROR [2021-07-18 23:17:36] Body: {"error":{"message":"Unsupported get request. Object with ID 'vhttps:' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https:\/\/developers.facebook.com\/docs\/graph-api","type":"GraphMethodException","code":100,"error_subcode":33,"fbtrace_id":"XXXXXXXXXX"}} Fehler in fbad_request(path = url$path, method = "GET", params = url$params, : Unsupported get request. Object with ID 'vhttps:' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api

Does anyone have a clue what the problem is and how to fix it? I also tested it with the latest facebook-api-version v11.0 but it gives me the same errors.

Thanks in advance!

Thomas

daroczig commented 3 years ago

Please share your session info. Are you using the dev version of fbRads?

thomiko commented 3 years ago

ERROR [2021-07-18 23:17:36] URL: https://graph.facebook.com/vhttps://graph.facebook.com/v10.0/4458965264114082/insights?access_token=XXXXXXX&limit=25&after=MjQZD/https://graph.facebook.com/v10.0/4458965264114082/insights?access_token=XXXXXXX&limit=25&after=MjQZD

Somehow the request URL seems to be constructed very badly. Here I only replaced the access token with XXXXXXX The rest is exactly as is.

thomiko commented 3 years ago

Yes, it's the dev version v10.0.0 Which values do you mean by session info?

thomiko commented 3 years ago

v10.0.0 worked fine from end of May until mid last week.

daroczig commented 3 years ago

Please load the package and share the package versions, e.g.

library(fbRads)
sessioninfo::session_info()

If you cannot install sessioninfo, then a sessionInfo() will do as well.

thomiko commented 3 years ago
- Session info ---------------------------------------------------------------------------------------------------------------------------------------
 setting  value                       
 version  R version 3.5.2 (2018-12-20)
 os       Windows Server 2012 R2 x64  
 system   x86_64, mingw32             
 ui       RStudio                     
 language (EN)                        
 collate  German_Germany.1252         
 ctype    German_Germany.1252         
 tz       Europe/Berlin               
 date     2021-07-19                  

- Packages -------------------------------------------------------------------------------------------------------------------------------------------
 ! package        * version  date       lib source                          
   assertthat       0.2.0    2017-04-11 [2] CRAN (R 3.5.2)                  
   backports        1.1.3    2018-12-14 [2] CRAN (R 3.5.2)                  
   base64enc        0.1-3    2015-07-28 [2] CRAN (R 3.5.2)                  
   bit              1.1-15.2 2020-02-10 [2] CRAN (R 3.5.3)                  
   bit64            0.9-7    2017-05-08 [2] CRAN (R 3.5.3)                  
   bitops           1.0-6    2013-08-17 [2] CRAN (R 3.5.2)                  
   broom            0.5.5    2020-02-29 [2] CRAN (R 3.5.3)                  
   cellranger       1.1.0    2016-07-27 [2] CRAN (R 3.5.2)                  
   cli              2.0.2    2020-02-28 [2] CRAN (R 3.5.3)                  
   colorspace       1.3-2    2016-12-14 [2] CRAN (R 3.5.2)                  
   crayon           1.3.4    2017-09-16 [2] CRAN (R 3.5.2)                  
   curl             4.3      2019-12-02 [2] CRAN (R 3.5.3)                  
   data.table       1.12.8   2019-12-09 [2] CRAN (R 3.5.3)                  
   DBI              1.0.0    2018-05-02 [2] CRAN (R 3.5.2)                  
   dbplyr           1.4.2    2019-06-17 [2] CRAN (R 3.5.3)                  
   digest           0.6.27   2020-10-24 [2] CRAN (R 3.5.2)                  
   dplyr          * 0.8.5    2020-03-07 [2] CRAN (R 3.5.3)                  
   evaluate         0.14     2019-05-28 [2] CRAN (R 3.5.3)                  
   fansi            0.4.0    2018-10-05 [2] CRAN (R 3.5.2)                  
   fbRads         * 10.0.0   2021-05-26 [2] Github (daroczig/fbRads@e3f3053)
   forcats        * 0.5.0    2020-03-01 [2] CRAN (R 3.5.3)                  
   formatR          1.10     2021-05-25 [2] CRAN (R 3.5.2)                  
   fs               1.4.1    2020-04-04 [2] CRAN (R 3.5.3)                  
   futile.logger    1.4.3    2016-07-10 [2] CRAN (R 3.5.2)                  
   futile.options   1.0.1    2018-04-20 [2] CRAN (R 3.5.2)                  
   generics         0.0.2    2018-11-29 [2] CRAN (R 3.5.2)                  
   ggplot2        * 3.3.0    2020-03-05 [2] CRAN (R 3.5.3)                  
   glue             1.4.0    2020-04-03 [2] CRAN (R 3.5.3)                  
   googlesheets   * 0.3.0    2018-06-29 [2] CRAN (R 3.5.2)                  
   gtable           0.2.0    2016-02-26 [2] CRAN (R 3.5.2)                  
   haven            2.2.0    2019-11-08 [2] CRAN (R 3.5.3)                  
   hms              0.5.3    2020-01-08 [2] CRAN (R 3.5.3)                  
   htmltools        0.3.6    2017-04-28 [2] CRAN (R 3.5.2)                  
   httr           * 1.4.2    2020-07-20 [2] CRAN (R 3.5.2)                  
   jsonlite       * 1.7.2    2020-12-09 [2] CRAN (R 3.5.2)                  
   kableExtra     * 1.1.0    2019-03-16 [2] CRAN (R 3.5.3)                  
   knitr            1.21     2018-12-10 [2] CRAN (R 3.5.2)                  
   lambda.r         1.2.4    2019-09-18 [2] CRAN (R 3.5.3)                  
   lattice          0.20-38  2018-11-04 [2] CRAN (R 3.5.2)                  
   lifecycle        0.2.0    2020-03-06 [2] CRAN (R 3.5.3)                  
   lubridate        1.7.4    2018-04-11 [2] CRAN (R 3.5.2)                  
   magrittr         1.5      2014-11-22 [2] CRAN (R 3.5.2)                  
   modelr           0.1.6    2020-02-22 [2] CRAN (R 3.5.3)                  
   munsell          0.5.0    2018-06-12 [2] CRAN (R 3.5.2)                  
   nlme             3.1-137  2018-04-07 [2] CRAN (R 3.5.2)                  
   pillar           1.4.3    2019-12-20 [2] CRAN (R 3.5.3)                  
   pkgconfig        2.0.2    2018-08-16 [2] CRAN (R 3.5.2)                  
   plyr           * 1.8.6    2020-03-03 [2] CRAN (R 3.5.3)                  
   purrr          * 0.3.3    2019-10-18 [2] CRAN (R 3.5.3)                  
   R6               2.4.1    2019-11-12 [2] CRAN (R 3.5.3)                  
   Rcpp             1.0.6    2021-01-15 [2] CRAN (R 3.5.2)                  
   RCurl            1.98-1.2 2020-04-18 [2] CRAN (R 3.5.3)                  
   readr          * 1.3.1    2018-12-21 [2] CRAN (R 3.5.2)                  
   readxl           1.3.1    2019-03-13 [2] CRAN (R 3.5.3)                  
   reprex           0.3.0    2019-05-16 [2] CRAN (R 3.5.3)                  
 R rlang            0.4.11   <NA>       [2] <NA>                            
   rmarkdown        1.11     2018-12-08 [2] CRAN (R 3.5.2)                  
   rstudioapi       0.11     2020-02-07 [2] CRAN (R 3.5.3)                  
   rvest            0.3.5    2019-11-08 [2] CRAN (R 3.5.3)                  
   scales           1.0.0    2018-08-09 [2] CRAN (R 3.5.2)                  
   sendmailR      * 1.2-1    2014-09-21 [2] CRAN (R 3.5.2)                  
   sessioninfo      1.1.1    2018-11-05 [2] CRAN (R 3.5.2)                  
   stringi          1.2.4    2018-07-20 [2] CRAN (R 3.5.2)                  
   stringr        * 1.4.0    2019-02-10 [2] CRAN (R 3.5.3)                  
   textutils      * 0.2-0    2020-01-07 [2] CRAN (R 3.5.3)                  
   tibble         * 2.1.3    2019-06-06 [2] CRAN (R 3.5.3)                  
   tidyr          * 1.0.2    2020-01-24 [2] CRAN (R 3.5.3)                  
   tidyselect       1.1.0    2020-05-11 [2] CRAN (R 3.5.2)                  
   tidyverse      * 1.3.0    2019-11-21 [2] CRAN (R 3.5.3)                  
   tinytex          0.10     2019-01-10 [2] CRAN (R 3.5.2)                  
   vctrs            0.2.4    2020-03-10 [2] CRAN (R 3.5.3)                  
   viridisLite      0.3.0    2018-02-01 [2] CRAN (R 3.5.2)                  
   webshot          0.5.1    2018-09-28 [2] CRAN (R 3.5.2)                  
   withr            2.4.1    2021-01-26 [2] CRAN (R 3.5.2)                  
   xfun             0.13     2020-04-13 [2] CRAN (R 3.5.3)                  
   xml2             1.3.2    2020-04-23 [2] CRAN (R 3.5.3)   
thomiko commented 3 years ago

In a couple of weeks we will update our central R installations to the latest R version but for the time being we have to stick to 3.5.2 because we have a lot of automated tasks running on it.

daroczig commented 3 years ago

Can you retry after devtools::instsall_github('daroczig/fbRads@v10-plus-digits')? Hopefully that solves the problem. If not, I'm pretty sure it's in fbRads:::url_parse, as using some ugly regular expressions there. Please run debugonce on that function or similar and check what might be the problem (as I won't be able to reproduce without an exact URL etc).

thomiko commented 3 years ago

Thanks for the fix with 'daroczig/fbRads@v10-plus-digits' ! It works fine with several scripts.

daroczig commented 3 years ago

Thanks for the report, merged to the main branch.