Running a shiny app with multiple folders served on shinyapps.io. The app has a function which pulls data from S3 (using a wrapper around get_bucket()
), which works fine locally as I set the AWS secret and credentials in my project .Renviron file, but once pushed I get a HTTP 403 error:
Error in value[[3L]](cond) : Forbidden (HTTP 403).
Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted
Things I have tried:
get_bucket()
call sys.setenv()
I'm completely out of ideas on this one. It stems into a broader question of how to set .Renviron variables in a shinyapps.io app. Things I've read say to add to the main folder or other options, but as I say above hasn't worked.
I am reading the data in with shiny::reactivePoll()
but don't see how this is the issue.
Thanks for your help, been stuck on this for days.
So, all along, the answer was in directly calling Sys.getenv()
in the get_bucket()
get_bucket(s3BucketName,
"AWS_ACCESS_KEY_ID" = Sys.getenv("AWS_ACCESS_KEY_ID"),
"AWS_SECRET_ACCESS_KEY" = Sys.getenv("AWS_SECRET_ACCESS_KEY")
Which could call on the .Renviron I had in the main directory. I think in my previous attempts I had either a) not called on it correctly with Sys.getenv()
or forget to address it properly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With