Continuing the discussion from odbc not working in Rstudio-server ("Can't open lib"), but works in cli:
Hi all,
I'm having a bit too much 'fun' with this problem and it's about time I asked for suggestions.
I am seeing some weird behaviour when trying to run the same code on the Rstudio server open source console & terminal on a Centos7 server.
Weird behaviour
The same code (a fully-qualified DBI::dbConnect(odbc::odbc()...)
call) works perfectly fine when called from an R prompt either in a standalone shell or in the Rstudio terminal, but fails to connect when called from the Rstudio console in the same (fresh) session:
Error: nanodbc/nanodbc.cpp:1021: 00000: [unixODBC][ODBC Firebird Driver]Unable to connect to data source: library '/apps/firebird/2.5.9/libfbembed.so' failed to load
The same is true for system calls (e.g. system('module list')
) from within the R console vs running the same code in the Rstudio terminal, either in bash or an R prompt.
What I've tried so far
I've ruled out environment variables by swapping each of the environments. The odbc connection string works fine too. I suspect it's a permissions/shell setup/.bash_profile problem.
Suspicions
To solve this problem I think I need to understand how each of the Rstudio console & Rstudio terminal launches, & with what permissions - whoami
gives the same result (my username), but each has clearly had a different launch pathway - there are some differences in sourced files, & echo ~
gives quite different results.
Any suggestions on where to go next? Installing the database drivers using a different method (which worked around the problem in the above thread) isn't an option for me. I've got a bit out of my depth at this point!
Thanks
Stuart