in Education by
here's my problem. I access Google Analytics API via R with googleAnalyticsR. The whole thing happens in a Markdown script. Local everything runs without problems. But when I load the script on a Shiny Sever the GA token seems to expire after a while (a few hours). The server log gives the following error message: Warning in gzfile(file, mode) : cannot open compressed file '.httr-oauth', probable reason 'Permission denied' The script to create the token looks like this: library(googleAuthR) options(googleAuthR.client_id = "client-id", googleAuthR.client_secret = "client-secret") gar_auth() I read that I should add googleAuthR.httr_oauth_cache = FALSE to the options. But when I do this and try to create a new Token I get follwing error: Error: option('googleAuthR.httr_oauth_cache') must be set to valid cache file location, not TRUE or FALSE - (example: '.httr-oauth') Anybody Ideas? Thanks a lot JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
The issue is not that the token expires, the package googleAnalyticsR takes care of refreshing it if needed. The problem is that the token was not created on the server (I assume you created locally then pushed to server), hence the error: Warning in gzfile(file, mode) : cannot open compressed file '.httr-oauth', probable reason 'Permission denied' The shinyuser which runs your app does not have the permission to open that file. I'm not a security expert so take this lightly. You run the following from the root of your application (on your server) there error will go away. sudo chmod -R 777 .httr-oauth The above will let shiny access the file.

Related questions

0 votes
    In runtime, I want to retrieve the expire time info about some items in memcached. I didn't find ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    Can guest accounts be set to automatically expire at a certain date?...
asked Mar 10, 2021 in Technology by JackTerrance
0 votes
    When using the SOAP API to work with salesforce.com (SFDC) it seems that the primary key in the underlying database ... is all about? Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    (a) In our country, there seems to be lack of awareness regarding reproductive health. Why? (b) Write ... maintain reproductive health? Select the correct answer from above options...
asked Nov 9, 2021 in Education by JackTerrance
0 votes
    Does the model “INVITATION REDEMPTION” still work? Because after December 2020, it seems not to work anymore, like it did before....
asked Mar 10, 2021 in Technology by JackTerrance
0 votes
    I am building a Shiny app with a Leaflet map based on a PostgreSQL spatialdatabase. I succeeded to import spatial data ... Should I make another conversion? Anyone got an idea? ui...
asked May 22, 2022 in Education by JackTerrance
0 votes
    Which of the following statement will install shiny? (a) install.packages( shiny ) (b) install.library( ... and answers pdf, Data Science interview questions for beginners...
asked Oct 28, 2021 in Education by JackTerrance
0 votes
    How many components are involved in shiny? (a) 3 (b) 4 (c) 5 (d) none of the mentioned ... programming questions and answers pdf, Data Science interview questions for beginners...
asked Oct 28, 2021 in Education by JackTerrance
0 votes
    runApp() will run the shiny and open the browser window. (a) True (b) False I had been asked ... questions and answers pdf, Data Science interview questions for beginners...
asked Oct 28, 2021 in Education by JackTerrance
0 votes
    Which of the following can be done by shiny? (a) Tabbed main panels (b) Editable data tables (c) ... questions and answers pdf, Data Science interview questions for beginners...
asked Oct 28, 2021 in Education by JackTerrance
0 votes
    Point out the correct statement. (a) shiny project is a directory containing at least three parts (b) shiny project ... directory containing only one part (d) none of the mentioned...
asked Oct 9, 2021 in Technology by JackTerrance
0 votes
    runApp() will run the shiny and open the browser window. (a) True (b) False...
asked Oct 5, 2021 in Technology by JackTerrance
0 votes
    Which of the following can be done by shiny? (a) Tabbed main panels (b) Editable data tables (c) Dynamic UI (d) All of the mentioned...
asked Oct 5, 2021 in Technology by JackTerrance
...