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
151 stars 57 forks source link

Requests stopped working yesterday with v15 #147

Open thomiko opened 1 year ago

thomiko commented 1 year ago

Unfortunately yesterday all our requests to the Facebook Marketing API via fbRads stopped and we don't have a clue why this happens.

When we do the first call to fbad_init, the following error message appears:

image

Each subsequent call brings up this error message:

image

Some context: about 4 weeks ago we upgraded from marketing API v14 because it was deprecated. We first tested v16 but we got error messages straight away. I'm not 100% sure but I think it was the same error message as now: "TLS versions older than v1.2 are not supported."

Since then (4 weeks ago) v15 worked without any problems ... until the day before yesterday. Since yesterday we always get the error messages from the screenshots above. We haven't changed the R scripts and no changes were made to the configuration on the remote computer where the R scripts are run automatically. We checked that TLS 1.2 is actually activated there.

Any ideas, comments, suggestions?

Thanks!

Thomas

daroczig commented 1 year ago

There was a similar issue at #123, can you please check if the PR created for that helps in your case? See the line installing the ssl_version_6 branch of the repo. Also, please post your sessionInfo()

thomiko commented 1 year ago

After installing this one ...

devtools::install_github('daroczig/fbRads@ssl_version_6')

... I always get the same error message:

image

session_info()

image

RCurl::curlVersion()

image

Is there anything else I can test or try out? Thx!

daroczig commented 1 year ago

Thanks for sharing the above!

It seems that your OpenSSL version is super old ... can you please try updating it?

I think the issue is that FB started to enforce newer versions of TLS for better security, see e.g. https://developers.facebook.com/blog/post/2023/02/02/introducing-facebook-graph-and-marketing-api-v16/

We will also reject web traffic to developer.facebook.com after May 1, 2023 from browsers using older TLS versions (older than TLS 1.2 and using static RSA ciphers [AES128-GCM-SHA256, AES256-GCM-SHA384, AES128-SHA, AES256-SHA, DES-CBC3-SHA] if using TLS1.2).

It's possible that they actually started to enforce that a few days ago.

daroczig commented 1 year ago

Also see this related thread https://github.com/omegahat/RCurl/issues/37

daroczig commented 1 year ago

Honestly, best would be to update fbRads to move away from RCurl (either to another HTTP client in R, or using the FB Python Business SDK via reticulate), but I won't have time to make this happen in the near future.

thomiko commented 1 year ago

Hi, we checked the OpenSSL versions. System-wide it has already been set to 1.1.1

image

In R we updated OpenSSL from 1.4.6 to 2.0.6:

image

We also reinstalled the R packages openssl and RCurl but RCurl still displays the old OpenSSL version:

image

Is there anything else we can try out? In #123 you mentioned "What you could try is building RCurl with a most recent version of OpenSSL" Is this complicated and a lot of work? So far we never had to build any packages.

Thanks!