OHDSI Home | Forums | Wiki | Github

R - Achilles - Error message

Hi folks,

I am just start playing with Achilles. For the db connection, I got errors like this and would appreciate your help.


connectionDetails ← createConnectionDetails(

cdmDatabaseSchema = “cdm”,
outputFolder = ‘OHDSI_ACHI’
Connecting using PostgreSQL driver
Error in achilles(connectionDetails, cdmDatabaseSchema = “cdm”, resultsDatabaseSchema = “results”, :
Error: Invalid CDM Version number; this function is only for v5 and above.
See Achilles Git Repo to find v4 compatible version of Achilles.
In addition: Warning message:
In value[3L] :
Error ‘cannot open the connection’ when writing log to file 'OHDSI_ACHI/log_achilles.txt. Removing file appender from logger.

How do I update the CDM from v4 to v5?

Ray Zohdsi

Would you explain how you created your OMOP CDM and why it may be CDM version 4.

Hi Don,

Here are the steps:

  1. download the CDM5.4 DDL from https://github.com/OHDSI/CommonDataModel/tree/main/inst/ddl/5.4/postgresql

  2. I downloaded Vocabularies from athena website (a month ago)

  3. I created the postgres DB and schema ‘cdm’ and loaded the vocabularies on my local Win10+postgres computer

  4. My CDM ETL goes to ‘person’ and ‘observation’ tables;

  5. From pgAdmin, backup the schema of ‘cdm’ and loaded to an existing DB ‘OHDSI’ - created by someone else a year ago (WebAPI is on this DB). I create a new schema ‘cdm’ and restore my local copy under it.


This particular error is unlikely to be related to the contents of your CDM database, rather it seems as if either your version of Achilles is out of date or the function is receiving an unexpected value for the cdmVersion parameter. To ensure you are running the latest Achilles you can run the following command in R.


The default value of the cdmVersion parameter is “5” so you should not need to specify it however you can attempt to specify it with cdmVersion = “5.3”.

To build your CDM I would suggest using the CommonDataModel package which contains the executeDdl function and would simplify your process.

   connectionDetails = cd,
   cdmVersion = "5.3",
   cdmDatabaseSchema = "ohdsi_demo"

Thank you very much, Frank. It is very helpful.

Just one thing: it looks you have to specify cdmVersion="5" when I ran the R code.