Skip to content
This repository has been archived by the owner on Nov 10, 2024. It is now read-only.

Authentication issue: Error in file(con, "w") : cannot open the connection #421

Closed
fernandojru opened this issue May 14, 2020 · 1 comment

Comments

@fernandojru
Copy link

Hello, I am encountering the following issues with both create_token() and search_tweets()

With search_tweets

It opens my browser and lets me authenticate showing: "Authentication complete. Please close this page and return to R."

rt <- search_tweets(
  "#gay", n = 180, include_rts = FALSE
)

Requesting token on behalf of user...
Waiting for authentication in browser...
Press Esc/Ctrl + C to abort
Authentication complete.
Error in file(con, "w") : cannot open the connection
In addition: Warning message:
In file(con, "w") : cannot open file '.Renviron': Permission denied

With create_token

I try to use my own credentials (consumer_key, consumer_secret, access_token, access_secret) but when executing create_token() got a similar error

token <- create_token(
  app = "Twitter in R fernandojru",
  consumer_key = api_key,
  consumer_secret = api_secret_key,
  access_token = access_token,
  access_secret = access_token_secret)

Error in file(con, "w") : cannot open the connection
In addition: Warning message:
In file(con, "w") : cannot open file '.Renviron': Permission denied

rtweet version

packageVersion("rtweet")
[1] ‘0.7.0’

Session info

R version 3.6.2 (2019-12-12)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Catalina 10.15.4

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] rtweet_0.7.0 httpuv_1.5.2

loaded via a namespace (and not attached):
[1] httr_1.4.1 compiler_3.6.2 magrittr_1.5 R6_2.4.1 promises_1.1.0 later_1.0.0
[7] tools_3.6.2 curl_4.3 Rcpp_1.0.4.6 jsonlite_1.6.1 openssl_1.4.1 askpass_1.1

Token

## copy/paste output
rtweet::get_token()

Requesting token on behalf of user...
Waiting for authentication in browser...
Press Esc/Ctrl + C to abort
Authentication complete.
Error in file(con, "w") : cannot open the connection
In addition: Warning message:
In file(con, "w") :
cannot open file '/Users/fernandorodriguez/.Renviron': Permission denied

@llrs
Copy link
Collaborator

llrs commented Feb 17, 2021

This seems to be related to #417 but could be that you specify a different app name than on your Twitter developer page. Closing for now, but let me know if you have more questions about this

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

No branches or pull requests

2 participants