Open ginoa opened 5 years ago
Thank you for the detailed report.
Seems httr
tries to check token and refresh it. Then httr
tried to write refreshed token to file but can't do it due the permissions.
Hi, thanks for your quick answer! Any guess as to why it fails on first call but succeeds on a second subsequent call? Suggestions on something I need to do to make sure that the first call succeeds?
System user by R-script running should have write access to the token file. I think second request was sent with the refreshed token.
The system user running the R-script has write access to the token file. Here's the permissions to the file
lrwxrwxrwx.
Moreover: in order to issue a refreshed token, isn't it necessary that client.secret
and client.id
be loaded somewhere in the environment or RGA's own namespace? I do not inject client.secret
and client.id
anywhere in the machine that runs the R-script, so token refreshing should fail (unless they are included in the token.rds, I guess).
Context
I am using
RGA::get_realtime
from an openshift environment.Issue observed
Usage of
RGA::get_realtime
results in the following errorError in gzfile(file, mode) : cannot open the connection In addition: Warning message: In gzfile(file, mode) : cannot open compressed file '.<XXXXX>-token.rds', probable reason 'Permission denied'
(instead of<XXXXXX>
there is my GA email address, I removed it from this github issue for safety concerns)NOTE: running
get_realtime
twice in a row with the same parameters results in failure of the first call and success of the second call. Weird behavior.Tests performed
RGA::get_realtime
from my local machine, no problem there. -> Problem appears only on the openshift environment.RGA:::list_mgmt
: callingRGA:::list_mgmt
twice results in the same issue: the first call fails with the error above, the second call succeeds. Maybe the problem is further down inRGA:::get_data
but I don't knowidentical()
whether callingRGA:::list_mgmt
changes the token. It does not.Calling
RGA::get_realtime
a first time wrapped inhttr::with_verbose
results in following (NOTE: I edited out sensitive information by substituting it with<XXXX>
)A second subsequent call with same parameters results in
Additional technical details
The token is created on my local machine with
RGA::authorize
. I changed the name of the created .rds containing the token, and injected the token in the openshift pod as a file. My R script seems to have no problem reading in this token from file withreadRDS()
.