Cannot setup openmrs server using sdk

Hi everyone,

I’ve been trying from days to setup openmrs server using sdk in my laptop. (I’m trying to setup ‘Distribution’ using Reference Application 2.6.0 ) I need to setup data integrity module over it after that. @ssmusoke and @dkayiwa helped me to a large extend but now I’m stuck at a point. I’m basically getting ‘Failed to import database’ error which is due to unknown variable ‘storage_engine’ . Please note that I’m not using ‘storage_engine’ in database connection string. See full log here: https://pastebin.com/cxHuFTSj

Here is my system configuration: MVN

Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-04T01:09:06+05:30)
Maven home: /usr/local/apache-maven-3.5.0
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.3", arch: "x86_64", family: "mac"

JAVA

java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

MySQL

 mysql  Ver 14.14 Distrib 5.7.18, for osx10.12 (x86_64) using  EditLine wrapper

As many of you know its been almost 2 weeks since starting of community bonding and I’m really need to setup the module otherwise it will be too late. I really appreciate any kind of help. Thanks

What server are you trying to create Platform or Distribution? And what version?

@ssmusoke, I’m trying to setup ‘distribution’ type server using ‘Reference Application 2.6.0’ .

@dkayiwa What is the fix for this issue which I know is to do with MySQL 5.7, @raff any suggestions on the SDK side?

@ssmusoke, dkayiwa suggested changing database connection uri (refer here for the fix suggested ) to jdbc:mysql://localhost:3306/@DBNAME@?autoReconnect=true&sessionVariables=default_storage_engine=InnoDB&useUnicode=true&characterEncoding=UTF-8 which I did, but I’m still getting same error.

If you don’t mind, you could downgrade to MySQL 5.6 and install this. I actually setup the Reference Application 2.6 and also 2.7-SNAPSHOT using OpenMRS SDK latest version having MySQL 5.6.

You can upgrade to the latest version of the OpenMRS SDK by running: mvn openmrs-sdk:setup-sdk -U

There was no error on SDK or Distribution for me.

Note that for running a distribution you will most likely need to have MySQL 5.6 installed.

See server setup installation guide.

@shivtej, looking at the pastebin I see your error message is

Could not create connection to database server. Attempted reconnect 3 times. Giving up.

This implies that you’ve got the wrong db connection string, username, or password. Have you verified these by connecting to mysql with some other utility?

Also, have you tried with MySQL 5.6? What I personally do in development is that I run mysql via docker, so I can try different versions, easily reset everything, etc.

My docker command:

docker run --name omrs-sdk-mysql -v mysqldata:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=openmrs -p 3306:3306 -d mysql:5.6

I once saw such error though I can’t remember the exact error. But that’s because I didn’t have mysql installed. What about try running sdk-setup with a H2 database instead of mysql?

Update Ohh I see! H2 is not an option for you. Never mind :slight_smile:

Things I’d try.

  • Reinstall and reconfigure mysql
  • Running mvn with -X flag

@shivtej I would recommend going down to MySQL 5.6 which does not have this issue for now so that we can get moving

Thanks everyone. Finally I came back to linux and downgraded to mysql 5.6 and this resolved the problem. Thank for your help. :slight_smile:

I also had a similar problem: trying to create a server but once I downgrade from mysql 5.7 to mysql 5.6 everything worked perfectly. your recommendation was really helpful

This was eventually fixed. So even MySQL 5.7 should now work well with the latest release of the SDK.

2 Likes