-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Config file not found in current working directory or parent directories #552
Comments
Hey @dylanrussellmd Thanks for the issue. I just gave it a shot with a local SQLite: Here is the pool Here is the config: For the rest, it's default Could you point me to something you'd be doing differently? Thanks |
That looks correct - I'm sure it runs fine locally. The issue is when I deploy to Shinyapps.io. Do you have issues doing so? |
I confirm that I can reproduce the issue on shinyappsio. Looking into it as we speak. Colin |
Any update on this issue? |
Ok I think I've got it: The way you've build your app is:
If you have something called get_pool <- list(
dbname = get_golem_config("db_name"),
host = get_golem_config("db_host"),
username = Sys.getenv("DB_USERNAME"),
password = Sys.getenv("DB_PASSWORD")
) It will fail. Actually you can think of To make this happen, this is the way to go: get_pool <- function() {
list(
dbname = get_golem_config("db_name"),
host = get_golem_config("db_host"),
username = Sys.getenv("DB_USERNAME"),
password = Sys.getenv("DB_PASSWORD")
)
} app_server <- function( input, output, session ) {
pool <- get_pool()
} Does this helps? Colin |
Well the problem is that |
That's the spirit of {golem} : nothing should be available globally :) so if you need this value downstream in the module, yes, you should definitely pass it as an argument to the function. If you want to "hijack" this, you can also use An example of how to handle this is available here with a mongo connection: https://github.com/ColinFay/hexmake/blob/master/R/fct_mongo.R |
As far as I can tell this issue can be closed :) @dylanrussellmd feel free to comment if you want more information about that. Thanks for your feedback. Cheers, |
I am attempting to use the
pool
package in my Shinygolem
application.I have slightly updated the default
golem-config.yml
:In order to use
pool
, I have aR/globals.R
file that contains a single call:My
.Renviron
file is in my project root folder.I can not figure out why I keep getting this error when I deploy to Shinyapps.io:
Config file not found in current working directory or parent directories
It builds locally fine. And, when I hard replace
dbname
andhost
with the actual values from thegolem-config.yml
file, it builds and deploys just fine.So there is something about the
get_golem_config()
function that is causing this error. Here is my function:I think it has something to do with the
config::get
, because when I edit myglobals.R
file to be:The error returns.
The text was updated successfully, but these errors were encountered: