Openmrs-SDK failed to setup server

Failed again

Heres proof though the DB one was set up

@raff thank you so much for your time.

Any further suggestions to help me get connected are most welcome :slight_smile:

@mikejg Could you try connecting to your MySQL server using the TCP port and not the unix socket.

mysql -h 127.0.0.1

If that does not work, then it may be that the mysqld config file is not allowing TCP connections. This was the default on some versions of mysql installer for Mac OS X.

1 Like

@tansentim thanks for your thoughts. If the following means Iā€™m connected, then yes. ~ default$ mysql -h 127.0.0.1 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 44 Server version: 5.6.35 MySQL Community Server (GPL)

Copyright Ā© 2000, 2016, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Type ā€˜help;ā€™ or ā€˜\hā€™ for help. Type ā€˜\cā€™ to clear the current input statement.

mysql>

Iā€™m looking into setting up through Whale docker, yet another learning curve!

One last clueā€¦ It says you used the ā€œdefaultā€ user and not ā€œrootā€ to connect. Could you please try to connect as ā€œrootā€ same as when running openmrs-sdk:setup? Run:

mysql -u root -p

@raff thanks again for your thoughts :slight_smile:. I seem to have made a breakthrough by choosing the H2 database. But then I ran into another problem when I mvn openmrs-sdk:create-project. Iā€™m not sure what the H@ database is, but at least it connects. Iā€™m getting to my wits end!

/ default$ mvn openmrs-sdk:setup [INFO] Scanning for projectsā€¦ [INFO]
[INFO] ------------------------------------------------------------------------ [INFO] Building Maven Stub Project (No POM) 1 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] ā€” openmrs-sdk-maven-plugin:3.8.2:setup (default-cli) @ standalone-pom ā€”

Setting up a new serverā€¦

Specify server id (-DserverId) (default: ā€˜serverā€™):

You can setup the following servers:

  1. Distribution
  2. Platform

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

You can deploy the following versions of a platform:

  1. 2.1.0-SNAPSHOT
  2. 2.0.4.1
  3. 2.0.4
  4. 1.12.0
  5. 1.11.7
  6. 1.10.4
  7. Otherā€¦

Which one do you choose? [1/2/3/4/5/6/7]: 1 [INFO] Configured Artifact: org.openmrs.distro:platform:2.1.0-SNAPSHOT:jar [INFO] Copying platform-2.1.0-SNAPSHOT.jar to /Users/default/openmrs/server/openmrs-distro.jar [INFO] Configured Artifact: org.openmrs.web:openmrs-webapp:2.1.0-SNAPSHOT:war [INFO] Copying openmrs-webapp-2.1.0-SNAPSHOT.war to /Users/default/openmrs/server/openmrs-2.1.0-SNAPSHOT.war [INFO] Configured Artifact: org.openmrs.module:fhir-omod:1.7.0-SNAPSHOT:jar [INFO] Configured Artifact: org.openmrs.module:webservices.rest-omod:2.17:jar [INFO] Configured Artifact: org.openmrs.module:owa-omod:1.6.3:jar [INFO] Copying fhir-omod-1.7.0-SNAPSHOT.jar to /Users/default/openmrs/server/modules/fhir-1.7.0-SNAPSHOT.omod [INFO] Copying webservices.rest-omod-2.17.jar to /Users/default/openmrs/server/modules/webservices.rest-2.17.omod [INFO] Copying owa-omod-1.6.3.jar to /Users/default/openmrs/server/modules/owa-1.6.3.omod

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ā€™): 1044

Which database would you like to use?:

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

Which one do you choose? [1/2/3/4]: 1 [INFO] Configured Artifact: com.h2database:h2:1.4.190:jar [INFO] Copying h2-1.4.190.jar to /Users/default/openmrs/server/h2-1.4.190.jar

The specified database openmrs-server does not exist and it will be created for you.

Note: JDK 1.8 is needed for platform version 2.1.0-SNAPSHOT.

Which JDK would you like to use to run this server?:

  1. JAVA_HOME (currently: /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre)
  2. Otherā€¦

Which one do you choose? [1/2]: 1 [INFO] Server configured successfully, path: /Users/default/openmrs/server [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 47.067 s [INFO] Finished at: 2017-04-04T18:40:59+09:30 [INFO] Final Memory: 19M/180M

/ default$ mvn openmrs-sdk:create-project [INFO] Scanning for projectsā€¦ [INFO]
[INFO] ------------------------------------------------------------------------ [INFO] Building Maven Stub Project (No POM) 1 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] ā€” openmrs-sdk-maven-plugin:3.8.2:create-project (default-cli) @ standalone-pom ā€”

What kind of project would you like to create?:

  1. Platform module
  2. Reference Application module
  3. Open Web App

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

Module id uniquely identifies your module in the OpenMRS world.

It is advised to consult your module id on https://talk.openmrs.org to eliminate possible collisions.

Module id must consists of lowercase letters, must start from a letter, can contain alphanumerics and dots, e.g. webservices.rest, metadatasharing, reporting, htmlformentry.

Please specify module id (default: ā€˜basicexampleā€™):

Module name is a user friendly name displayed to the user instead of the module id.

By convention it is a module id with spaces between words.

Please specify module name (default: ā€˜Basicexampleā€™):

Describe your module in a few sentences (default: ā€˜no descriptionā€™):

GroupId, artifactId and version combined together identify your module in the maven repository.

By convention OpenMRS modules use ā€˜org.openmrs.moduleā€™ as a groupId (must follow convention for naming java packages) and the module id as an artifactId. The version should follow maven versioning convention, which in short is: major.minor.maintenance(-SNAPSHOT).

Please specify groupId (default: ā€˜org.openmrs.moduleā€™):

Please specify initial version (default: ā€˜1.0.0-SNAPSHOTā€™):

What is the lowest version of the platform (-Dplatform) you want to support? (default: ā€˜1.11.6ā€™): [INFO] Archetype: openmrs-sdk-archetype-module-platform [INFO] Generating project in Batch mode [INFO] Archetype defined by properties [INFO] ---------------------------------------------------------------------------- [INFO] Using following parameters for creating project from Archetype: openmrs-sdk-archetype-module-platform:3.8.2 [INFO] ---------------------------------------------------------------------------- [INFO] Parameter: groupId, Value: org.openmrs.module [INFO] Parameter: artifactId, Value: basicexample [INFO] Parameter: version, Value: 1.0.0-SNAPSHOT [INFO] Parameter: package, Value: org.openmrs.module.basicexample [INFO] Parameter: packageInPathFormat, Value: org/openmrs/module/basicexample [INFO] Parameter: moduleClassnamePrefix, Value: Basicexample [INFO] Parameter: moduleName, Value: Basicexample [INFO] Parameter: moduleAuthor, Value: default [INFO] Parameter: moduleDescription, Value: no description [INFO] Parameter: groupId, Value: org.openmrs.module [INFO] Parameter: version, Value: 1.0.0-SNAPSHOT [INFO] Parameter: package, Value: org.openmrs.module.basicexample [INFO] Parameter: openmrsPlatformVersion, Value: 1.11.6 [INFO] Parameter: artifactId, Value: basicexample [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 16.155 s [INFO] Finished at: 2017-04-04T18:59:13+09:30 [INFO] Final Memory: 19M/109M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:3.8.2:create-project (default-cli) on project standalone-pom: org.apache.maven.archetype.exception.ArchetypeGenerationFailure: Error merging velocity templates: /basicexample/pom.xml (No such file or directory) -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [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/MojoFailureException

I used default name ā€œserverā€ without quotation ā€¦ and it works for me.

j tried to follow the above instructions but this is the same error, j get Failed to setup server: Failed to connect to the specified database jdbc:mysql://localhost:3306/2?autoReconnect=true&sessionVariables=default_storage_engine%3DInnoDB&useUnicode=true&characterEncoding=UTF-8 . any updated help

Was your issue sorted out?

yes it was sorted after following the convention on this page https://wiki.openmrs.org/display/docs/OpenMRS+SDK+Step+By+Step+Tutorials j finally figured out the issue

1 Like

kindly explain what you did in solving the error in order to help other people who might face the same error here!!

@herbert24 j guess this might be for @mikejg .but for my case since j had the same issue. after following this thread https://wiki.openmrs.org/display/docs/OpenMRS+SDK+Step+By+Step+Tutorial , all errors were solved, j think we need to hear from @mikejg, how fur he have gone

1 Like

I am facing the same issue. Did anyone solved this issue for mysql db server?

@aman where did u got stuck from?

@aman Honestly, its hard to figure out the error you are getting.Is it okay you share the error log through pastebin?

Here are the logs: https://pastebin.com/q8A5LXF3

The problem is that it is not able to connect to the local mysql server running even though I am giving the correct credentials.

@jwnasambu @sharif any ideas?

I am thinking of going with the docker option.