OHDSI / CohortDiagnostics

An R package for performing various cohort diagnostics.
https://ohdsi.github.io/CohortDiagnostics
40 stars 45 forks source link

Error Viewing Results Using Diagnostics Explorer #1123

Open vittoriaramella opened 2 weeks ago

vittoriaramella commented 2 weeks ago

Hi everyone,

I'm getting an error while trying to view the results of CohortDiagnostics in the Diagnostics Explorer.

Once I have converted the csv results to an sqlite database file, I get this error running the launchDiagnosticsExplorer(sqliteDbPath = "MyCohortDiagnosticsResults.sqlite"):

Using DatabaseConnector jdbc driver.
Initalizing pooled connection
Connecting using SQLite driver
Error in `DatabaseConnector::getTableNames()`:
! Pool, R6 connection not supported

This is what I get if i run rlang::last_trace()

<error/rlang_error>
Error in `DatabaseConnector::getTableNames()`:
! Pool, R6 connection not supported
---
Backtrace:
     ▆
  1. ├─CohortDiagnostics::launchDiagnosticsExplorer(...)
  2. │ └─shiny::runApp(appDir = appDir)
  3. │   └─appParts$onStart()
  4. │     └─shiny::loadSupport(appDir, renv = sharedEnv, globalrenv = globalenv())
  5. │       ├─withr::with_dir(...)
  6. │       │ └─base::force(code)
  7. │       └─shiny:::sourceUTF8(basename(globalPath), envir = globalrenv)
  8. │         └─base::eval(exprs, envir)
  9. │           └─base::eval(exprs, envir)
 10. ├─shiny::..stacktraceon..(...)
 11. └─OhdsiShinyModules::createCdDatabaseDataSource(...) at global.R:94:3
 12.   └─OhdsiShinyModules:::.availableTables(connectionHandler, resultDatabaseSettings$schema)
 13.     ├─base::tolower(...)
 14.     └─DatabaseConnector::getTableNames(connectionHandler$getConnection(), databaseSchema = schema)

I'm running R version 4.2.3, DatabaseConnector v6.3.2 and CohortDiagnostics v3.2.5.

I don't know if this could be an issue related to the way the sqlite file is built or an issue related to the DatabaseConnector package (so I should report this on their GitHub).

Thanks in advance, Vittoria

ggamit commented 1 week ago

Hi, I'm getting the exact same error same, using a similar configuration.

It seems that in global.R (line 82) the call connectionHandler <- ResultModelManager::PooledConnectionHandler$new(shinySettings$connectionDetails)

returns a connection object of class "R6", which is not supported by DatabaseConnector > class(connectionHandler) [1] "PooledConnectionHandler" "ConnectionHandler" "R6"

A fix or a suggestion for a workaround will be appreciated, thanks! Guy.

frankcorneliusmartin commented 1 week ago

class(connectionHandler) [1] "PooledConnectionHandler" "ConnectionHandler" "R6"

We are also experiencing the same

frankcorneliusmartin commented 1 week ago

We got it working by downgrading a bunch of packages. The last package we downgraded was the ShinyModules:

remotes::install_github('OHDSI/OhdsiShinyModules@v2.0.2')

But we also downgraded the siny version itself (and some other packages): remotes::install_version('shiny',version='1.7.4',repos = "http://cran.us.r-project.org")

Not sure yet what the root cause is.