Error in SDK setup (3.10.0) for mac

Application Name: OpenMRS SDK Version Number: 3.10.1

Question: Hi, I’m having trouble setting up the OpenMRS SDK. I’m following the steps given here: https://wiki.openmrs.org/display/docs/OpenMRS+SDK

I’m using, Java 1.8 Apache Maven 3.3.9 MySql 5.6

The sdk has been installed successfully. I get a BUILD SUCCESS on running

mvn openmrs-sdk:help

But on running the setup command I’m getting an error

mvn openmrs-sdk:setup -e

I want to setup a Distribution server named “testserver” with Ref App version 2.6.0 for a MySQL database. I’ve kept the default values for all other wizard questions.

But I’m getting an error - Failed to setup server: Failed to connect to the specified database jdbc:mysql://localhost:3306/testserver?autoReconnect=true&sessionVariables=default_storage_engine%3DInnoDB&useUnicode=true&characterEncoding=UTF-8 -> [Help 1]

Here is the full stack-trace of the the error:

Java HotSpot™ 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0 [INFO] Error stacktraces are turned on. [INFO] Scanning for projects… [INFO]
[INFO] ------------------------------------------------------------------------ [INFO] Building Maven Stub Project (No POM) 1 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] — openmrs-sdk-maven-plugin:3.10.1:setup (default-cli) @ standalone-pom —

Setting up a new server…

Specify server id (-DserverId) (default: ‘server’): testserver

You can setup the following servers:

  1. Distribution
  2. Platform

Which one do you choose? [1/2]: 1

You can deploy the following versions of distribution:

  1. Reference Application 2.7.0-SNAPSHOT
  2. Reference Application 2.6.0
  3. Reference Application 2.5
  4. Reference Application 2.4
  5. Reference Application 2.3.1
  6. Other…

Which one do you choose? [1/2/3/4/5/6]: 2 [INFO] Configured Artifact: org.openmrs.distro:referenceapplication-package:2.6.0:jar [INFO] Copying referenceapplication-package-2.6.0.jar to /Users/nehagoel/openmrs/testserver/openmrs-distro.jar [INFO] Configured Artifact: org.openmrs.web:openmrs-webapp:2.0.5:war [INFO] Copying openmrs-webapp-2.0.5.war to /Users/nehagoel/openmrs/testserver/openmrs-2.0.5.war [INFO] Configured Artifact: org.openmrs.module:legacyui-omod:1.3.1:jar [INFO] Configured Artifact: org.openmrs.module:metadatadeploy-omod:1.8.1:jar [INFO] Configured Artifact: org.openmrs.module:reportingrest-omod:1.8.0:jar [INFO] Configured Artifact: org.openmrs.module:owa-omod:1.7.0:jar [INFO] Configured Artifact: org.openmrs.module:serialization.xstream-omod:0.2.12:omod [INFO] Configured Artifact: org.openmrs.module:registrationapp-omod:1.8.0:jar [INFO] Configured Artifact: org.openmrs:event-omod:2.5:jar [INFO] Configured Artifact: org.openmrs.module:uilibrary-omod:2.0.4:jar [INFO] Configured Artifact: org.openmrs.module:htmlwidgets-omod:1.9.0:jar [INFO] Configured Artifact: org.openmrs.module:dataexchange-omod:1.3.2:jar [INFO] Configured Artifact: org.openmrs.module:appui-omod:1.8.0:jar [INFO] Configured Artifact: org.openmrs.module:allergyui-omod:1.7.0:jar [INFO] Configured Artifact: org.openmrs.module:providermanagement-omod:2.6.0:jar [INFO] Configured Artifact: org.openmrs.module:appointmentschedulingui-omod:1.6.0:jar [INFO] Configured Artifact: org.openmrs.module:formentryapp-omod:1.4.1:jar [INFO] Configured Artifact: org.openmrs.module:idgen-omod:4.4.1:jar [INFO] Configured Artifact: org.openmrs.module:metadatamapping-omod:1.3.2:jar [INFO] Configured Artifact: org.openmrs.module:chartsearch-omod:2.0:jar [INFO] Configured Artifact: org.openmrs.module:htmlformentryui-omod:1.6.3:jar [INFO] Configured Artifact: org.openmrs.module:referencedemodata-omod:1.4.3:jar [INFO] Configured Artifact: org.openmrs.module:emrapi-omod:1.21.0:jar [INFO] Configured Artifact: org.openmrs.module:referenceapplication-omod:2.6.0:jar [INFO] Configured Artifact: org.openmrs.module:htmlformentry-omod:3.3.2:jar [INFO] Configured Artifact: org.openmrs.module:appframework-omod:2.10.0:jar [INFO] Configured Artifact: org.openmrs.module:referencemetadata-omod:2.6.0:jar [INFO] Configured Artifact: org.openmrs.module:reportingui-omod:1.3.0:jar [INFO] Configured Artifact: org.openmrs.module:coreapps-omod:1.13.0:jar [INFO] Configured Artifact: org.openmrs.module:reportingcompatibility-omod:2.0.2:jar [INFO] Configured Artifact: org.openmrs.module:reporting-omod:1.12.0:jar [INFO] Configured Artifact: org.openmrs.module:adminui-omod:1.2.2:jar [INFO] Configured Artifact: org.openmrs.module:registrationcore-omod:1.7.1:jar [INFO] Configured Artifact: org.openmrs.module:appointmentscheduling-omod:1.8.0:jar [INFO] Configured Artifact: org.openmrs.module:calculation-omod:1.2:jar [INFO] Configured Artifact: org.openmrs.module:webservices.rest-omod:2.19.0:jar [INFO] Configured Artifact: org.openmrs.module:atlas-omod:2.2:omod [INFO] Configured Artifact: org.openmrs.module:uicommons-omod:2.3.0:jar [INFO] Configured Artifact: org.openmrs.module:uiframework-omod:3.11.0:jar [INFO] Configured Artifact: org.openmrs.module:metadatasharing-omod:1.2.2:jar [INFO] Copying legacyui-omod-1.3.1.jar to /Users/nehagoel/openmrs/testserver/modules/legacyui-1.3.1.omod [INFO] Copying metadatadeploy-omod-1.8.1.jar to /Users/nehagoel/openmrs/testserver/modules/metadatadeploy-1.8.1.omod [INFO] Copying reportingrest-omod-1.8.0.jar to /Users/nehagoel/openmrs/testserver/modules/reportingrest-1.8.0.omod [INFO] Copying owa-omod-1.7.0.jar to /Users/nehagoel/openmrs/testserver/modules/owa-1.7.0.omod [INFO] Copying serialization.xstream-omod-0.2.12.omod to /Users/nehagoel/openmrs/testserver/modules/serialization.xstream-0.2.12.omod [INFO] Copying registrationapp-omod-1.8.0.jar to /Users/nehagoel/openmrs/testserver/modules/registrationapp-1.8.0.omod [INFO] Copying event-omod-2.5.jar to /Users/nehagoel/openmrs/testserver/modules/event-2.5.omod [INFO] Copying uilibrary-omod-2.0.4.jar to /Users/nehagoel/openmrs/testserver/modules/uilibrary-2.0.4.omod [INFO] Copying htmlwidgets-omod-1.9.0.jar to /Users/nehagoel/openmrs/testserver/modules/htmlwidgets-1.9.0.omod [INFO] Copying dataexchange-omod-1.3.2.jar to /Users/nehagoel/openmrs/testserver/modules/dataexchange-1.3.2.omod [INFO] Copying appui-omod-1.8.0.jar to /Users/nehagoel/openmrs/testserver/modules/appui-1.8.0.omod [INFO] Copying allergyui-omod-1.7.0.jar to /Users/nehagoel/openmrs/testserver/modules/allergyui-1.7.0.omod [INFO] Copying providermanagement-omod-2.6.0.jar to /Users/nehagoel/openmrs/testserver/modules/providermanagement-2.6.0.omod [INFO] Copying appointmentschedulingui-omod-1.6.0.jar to /Users/nehagoel/openmrs/testserver/modules/appointmentschedulingui-1.6.0.omod [INFO] Copying formentryapp-omod-1.4.1.jar to /Users/nehagoel/openmrs/testserver/modules/formentryapp-1.4.1.omod [INFO] Copying idgen-omod-4.4.1.jar to /Users/nehagoel/openmrs/testserver/modules/idgen-4.4.1.omod [INFO] Copying metadatamapping-omod-1.3.2.jar to /Users/nehagoel/openmrs/testserver/modules/metadatamapping-1.3.2.omod [INFO] Copying chartsearch-omod-2.0.jar to /Users/nehagoel/openmrs/testserver/modules/chartsearch-2.0.omod [INFO] Copying htmlformentryui-omod-1.6.3.jar to /Users/nehagoel/openmrs/testserver/modules/htmlformentryui-1.6.3.omod [INFO] Copying referencedemodata-omod-1.4.3.jar to /Users/nehagoel/openmrs/testserver/modules/referencedemodata-1.4.3.omod [INFO] Copying emrapi-omod-1.21.0.jar to /Users/nehagoel/openmrs/testserver/modules/emrapi-1.21.0.omod [INFO] Copying referenceapplication-omod-2.6.0.jar to /Users/nehagoel/openmrs/testserver/modules/referenceapplication-2.6.0.omod [INFO] Copying htmlformentry-omod-3.3.2.jar to /Users/nehagoel/openmrs/testserver/modules/htmlformentry-3.3.2.omod [INFO] Copying appframework-omod-2.10.0.jar to /Users/nehagoel/openmrs/testserver/modules/appframework-2.10.0.omod [INFO] Copying referencemetadata-omod-2.6.0.jar to /Users/nehagoel/openmrs/testserver/modules/referencemetadata-2.6.0.omod [INFO] Copying reportingui-omod-1.3.0.jar to /Users/nehagoel/openmrs/testserver/modules/reportingui-1.3.0.omod [INFO] Copying coreapps-omod-1.13.0.jar to /Users/nehagoel/openmrs/testserver/modules/coreapps-1.13.0.omod [INFO] Copying reportingcompatibility-omod-2.0.2.jar to /Users/nehagoel/openmrs/testserver/modules/reportingcompatibility-2.0.2.omod [INFO] Copying reporting-omod-1.12.0.jar to /Users/nehagoel/openmrs/testserver/modules/reporting-1.12.0.omod [INFO] Copying adminui-omod-1.2.2.jar to /Users/nehagoel/openmrs/testserver/modules/adminui-1.2.2.omod [INFO] Copying registrationcore-omod-1.7.1.jar to /Users/nehagoel/openmrs/testserver/modules/registrationcore-1.7.1.omod [INFO] Copying appointmentscheduling-omod-1.8.0.jar to /Users/nehagoel/openmrs/testserver/modules/appointmentscheduling-1.8.0.omod [INFO] Copying calculation-omod-1.2.jar to /Users/nehagoel/openmrs/testserver/modules/calculation-1.2.omod [INFO] Copying webservices.rest-omod-2.19.0.jar to /Users/nehagoel/openmrs/testserver/modules/webservices.rest-2.19.0.omod [INFO] Copying atlas-omod-2.2.omod to /Users/nehagoel/openmrs/testserver/modules/atlas-2.2.omod [INFO] Copying uicommons-omod-2.3.0.jar to /Users/nehagoel/openmrs/testserver/modules/uicommons-2.3.0.omod [INFO] Copying uiframework-omod-3.11.0.jar to /Users/nehagoel/openmrs/testserver/modules/uiframework-3.11.0.omod [INFO] Copying metadatasharing-omod-1.2.2.jar to /Users/nehagoel/openmrs/testserver/modules/metadatasharing-1.2.2.omod

What port would you like your server to use? (default: ‘8080’):

If you want to enable remote debugging by default when running the server, specify the port number here (e.g. 1044). Leave blank to disable debugging. (Do not do this on a production server) (default: ‘no debugging’):

Which database would you like to use?:

  1. MySQL 5.6 (requires pre-installed MySQL 5.6)
  2. MySQL 5.6 in SDK docker container (requires pre-installed Docker)
  3. Existing docker container (requires pre-installed Docker)

Which one do you choose? [1/2/3]: 1

The distribution requires MySQL database. Please specify database uri (-DdbUri) (default: ‘jdbc:mysql://localhost:3306/@DBNAME@’):

Please specify database username (-DdbUser) (default: ‘root’): Please specify database password (-DdbPassword) (default: ’ '): [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 19.518 s [INFO] Finished at: 2017-06-09T16:58:21+05:30 [INFO] Final Memory: 19M/244M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:3.10.1:setup (default-cli) on project standalone-pom: Failed to setup server: Failed to connect to the specified database jdbc:mysql://localhost:3306/testserver?autoReconnect=true&sessionVariables=default_storage_engine%3DInnoDB&useUnicode=true&characterEncoding=UTF-8 -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:3.10.1:setup (default-cli) on project standalone-pom: Failed to setup server at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to setup server at org.openmrs.maven.plugins.Setup.setup(Setup.java:276) at org.openmrs.maven.plugins.Setup.executeTask(Setup.java:630) at org.openmrs.maven.plugins.AbstractTask.execute(AbstractTask.java:181) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) … 20 more Caused by: java.lang.IllegalStateException: Failed to connect to the specified database jdbc:mysql://localhost:3306/testserver?autoReconnect=true&sessionVariables=default_storage_engine%3DInnoDB&useUnicode=true&characterEncoding=UTF-8 at org.openmrs.maven.plugins.Setup.setup(Setup.java:213) … 24 more [ERROR] [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Thanks in advance for the help!

@dbarretto

The two most common issues are:

  1. MySQL 5.7?

  2. Having a root user have a blank password

I’m using MySQL 5.6

And I tried running the setup with a password, but I’m still getting the same error :frowning:

The latest SDK also supports MySQL 5.7, hence should not be a problem any more.

@ngoel2 can you confirm that your mysql service is running and you can connect to it using the user name root and the password that you are providing? You can use any MySQL GUI to test this.

1 Like

I used MySQL workbench to verify that mysql service is running. Also tried this shell script

mysqladmin -u root -p status

And got this output

Enter password: Uptime: 1078623 Threads: 2 Questions: 220 Slow queries: 0 Opens: 68 Flush tables: 1 Open tables: 61 Queries per second avg: 0.000

So it seems to br working.

However when I’m running the SDK setup, it doesn’t seem to be creating a server instance at all.

Does it work if you just go with the defaults apart from the root password?

1 Like

Thank you, it turned out to be a blank root password issue after all.