OHDSI Home | Forums | Wiki | Github

Problem with Achilles runs when is used parameterized

Hi all,
i have the following question/bug that i found while i am working with OHDSI tools.
When i run my script from the Rstudio of R CMD of achilles in which i compute the reporting tables
i observe that if the parameters in the functions of the program are hardcoded it is working as a charm(without errors).
However when they are in a form of variables

imaging the following:

#connectionDetails <- createConnectionDetails(dbms = “postgresql”,

server = “localhost@@@@/@@@@@”,

user = “@@@@@”,

password = “@@@@@@@”,

port=“5432”,pathToDriver = “/home/yannis/code/composition/”) ###this ###version works

###the following doesnt work with the exactly same parameters
connectionDetails <- createConnectionDetails(dbms = args[1],
server =args[2],
user = args[3],
password = args[4],
port=args[5],pathToDriver =args[6])

the error i get is when i run
achilles(connectionDetails = connectionDetails,
cdmDatabaseSchema = args[7],
resultsDatabaseSchema = args[8],
vocabDatabaseSchema = args[7],
sourceName = “default”,
scratchDatabaseSchema = args[9],
cdmVersion = “5.3.1”,
numThreads = 5,
runHeel = TRUE)

2021-05-13 16:27:08 Thread 1 returns error: “object of type ‘closure’ is not subsettable” when using argument(s): DROP TABLE IF EXISTS scratch.tmpach_dist_1803;
Thread 1 returns error: “object of type ‘closure’ is not subsettable” when using argument(s): DROP TABLE IF EXISTS scratch.tmpach_dist_1803;
|=========================================================================== | 97%2021-05-13 16:27:08 Thread 2 returns error: “object of type ‘closure’ is not subsettable” when using argument(s): DROP TABLE IF EXISTS scratch.tmpach_dist_1510;
Thread 2 returns error: “object of type ‘closure’ is not subsettable” when using argument(s): DROP TABLE IF EXISTS scratch.tmpach_dist_1510;
|============================================================================ | 97%2021-05-13 16:27:08 Thread 3 returns error: “object of type ‘closure’ is not subsettable” when using argument(s): DROP TABLE IF EXISTS scratch.tmpach_dist_1511;
Thread 3 returns error: “object of type ‘closure’ is not subsettable” when using argument(s): DROP TABLE IF EXISTS scratch.tmpach_dist_1511;
2021-05-13 16:27:08 Thread 1 returns error: “object of type ‘closure’ is not subsettable” when using argument(s): DROP TABLE IF EXISTS scratch.tmpach_dist_1815;
Thread 1 returns error: “object of type ‘closure’ is not subsettable” when using argument(s): DROP TABLE IF EXISTS scratch.tmpach_dist_1815;
|============================================================================ | 98%2021-05-13 16:27:08 Thread 3 returns error: “object of type ‘closure’ is not subsettable” when using argument(s): DROP TABLE IF EXISTS scratch.tmpach_dist_1817;
Thread 3 returns error: “object of type ‘closure’ is not subsettable” when using argument(s): DROP TABLE IF EXISTS scratch.tmpach_dist_1817;
2021-05-13 16:27:08 Thread 5 returns error: “object of type ‘closure’ is not subsettable” when using argument(s): DROP TABLE IF EXISTS scratch.tmpach_dist_1806;
Thread 5 returns error: “object of type ‘closure’ is not subsettable” when using argument(s): DROP TABLE IF EXISTS scratch.tmpach_dist_1806;
|============================================================================= | 98%2021-05-13 16:27:08 Thread 1 returns error: “object of type ‘closure’ is not subsettable” when using argument(s): DROP TABLE IF EXISTS scratch.tmpach_dist_2106;
Thread 1 returns error: “object of type ‘closure’ is not subsettable” when using argument(s): DROP TABLE IF EXISTS scratch.tmpach_dist_2106;
|============================================================================= | 99%2021-05-13 16:27:08 Thread 3 returns error: “object of type ‘closure’ is not subsettable” when using argument(s): DROP TABLE IF EXISTS scratch.tmpach_Drug_cost_raw;
Thread 3 returns error: “object of type ‘closure’ is not subsettable” when using argument(s): DROP TABLE IF EXISTS scratch.tmpach_Drug_cost_raw;
2021-05-13 16:27:08 Thread 5 returns error: “object of type ‘closure’ is not subsettable” when using argument(s): DROP TABLE IF EXISTS scratch.tmpach_Procedure_cost_raw;
Thread 5 returns error: “object of type ‘closure’ is not subsettable” when using argument(s): DROP TABLE IF EXISTS scratch.tmpach_Procedure_cost_raw;
2021-05-13 16:27:08 Thread 4 returns error: “object of type ‘closure’ is not subsettable” when using argument(s): DROP TABLE IF EXISTS scratch.tmpach_dist_1608;
Thread 4 returns error: “object of type ‘closure’ is not subsettable” when using argument(s): DROP TABLE IF EXISTS scratch.tmpach_dist_1608;
|==============================================================================| 100%2021-05-13 16:27:08 Thread 2 returns error: “object of type ‘closure’ is not subsettable” when using argument(s): DROP TABLE IF EXISTS scratch.tmpach_dist_1816;
Thread 2 returns error: “object of type ‘closure’ is not subsettable” when using argument(s): DROP TABLE IF EXISTS scratch.tmpach_dist_1816;

Error in ParallelLogger::clusterApply(cluster = cluster, x = dropSqls, :
Error(s) when calling function ‘fun’, see earlier messages for details

Am i doing something wrong? i am using it with postgres(13.2)
Is this a bug?

Congratulations for the great community and great sharing of information and knowledge!!!

1 Like

Oh my goodness! I am so glad you posted this as it led to me figuring out a very similar issue I was having with the DQD function executeDqChecks - which also hits a snag when it runs ParallelLogger::clusterApply. (The error I was getting was 2021-06-01 21:07:10 [Thread 1] FATAL DatabaseConnector server object 'server' not found.)

I just started having this issue after I updated DQD and its dependencies (including DatabaseConnector). Reverting DatabaseConnector to its previous version (3.0.0) fixed the issue.

For reference, I am on Redshift and R version 4.1.0.

Did you already file a GitHub issue for this or get guidance on it from a maintainer?

Hi,
unfortunately i have not filed an issue on github

i will try to revert the database connector to the version you mention

@schuemie hello! Tagging you as DatabaseConnector author - do you know if this would be an issue with DatabaseConnector or with the libraries that are consuming the connectionDetails object? I want to make sure I report an issue in the right place.

Thanks :slight_smile:

PS: the failing fun function in my ParallelLogger::clusterApply was .runCheck, a DQD function which in turn runs .processCheck, which uses the connectionDetails object to connect to the DB (DataQualityDashboard/execution.R at d333d68a0a8b25079a831682b93e92ad6bc0d568 · OHDSI/DataQualityDashboard · GitHub)

1 Like
t