Question about error seen trying to set up development environment on Windows

Hi Everybody,

I’m getting the error shown below trying to install a development invironment on my Windows machine. I’ve used all of the parameter values recommended here: https://wiki.openmrs.org/display/docs/Set+Up+OpenMRS+Server+with+OpenMRS+SDK+and+Docker

The error is occuring at this step: mvn openmrs-sdk:setup

This is the error:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  05:34 min
[INFO] Finished at: 2023-07-20T09:45:09-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:5.1.0:setup (default-cli) on project standalone-pom: Failed to setup server: Unable to execute mojo: Execution null of goal org.openmrs.maven.plugins:openmrs-sdk-docker-maven-plugin:5.1.0:create-mysql failed: Unsupported protocol scheme found: 'http://127.0.0.1:2375/ -> [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/MojoExecutionException

How can I resolve this?

Thanks, John

I think the solution to this might be here:

I’m still seeing an error after setting my sdk.properties to either of the following:

dockerHost=tcp://localhost:2375/

dockerHost=tcp://localhost:2375/

This is the error I’m getting:

Preparing 'openmrs-sdk-mysql-v3-2' DB docker container...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  44.136 s
[INFO] Finished at: 2023-07-20T14:48:23-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:5.1.0:setup (default-cli) on project standalone-pom: Failed to setup server:
[ERROR]
[ERROR]
[ERROR] Could not connect to Docker at tcp://localhost:2375/
[ERROR]
[ERROR]  Please make sure Docker is running.
[ERROR]
[ERROR]  If you are using 'Docker Toolbox', please make sure you run the SDK command
[ERROR]  from the 'Docker  Toolbox' terminal.
[ERROR]
[ERROR] If your Docker is running, try resetting the Docker host by running setup with -DdockerHost parameter.
[ERROR]
[ERROR] You can also set it manually by adding -DdockerHost="tcp://correct/url": org.apache.hc.client5.http.HttpHostConnectException: Connect to http://localhost:2375 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
[ERROR] -> [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/MojoExecutionException
PS D:\_YES_2023-05-28\OpenMrs> docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
PS D:\_YES_2023-05-28\OpenMrs>

Sorry for the error! Which java version are you running?

I’ve tried on Java 11.8.11 and 1.8.0_261.

Doing some research on the topic, it looks like this might be related to anti-virus I have installed on my machine.

I’m uninstalling and retrying now. I’ll let you know how I make out.

I have just revisited your post and basing on the error displayed, the Maven build failed while trying to execute the OpenMRS SDK plugin’s setup goal. The failure is related to Docker, as the plugin requires Docker to be running for the setup process. Docker is used to manage containers, and it seems like the SDK is unable to connect to the Docker daemon. On addition to your finding just incase the issue is not fixed kindly try out these:

  1. Ensure Docker is installed on your system and running. It seems that the SDK plugin is trying to connect to Docker on tcp://localhost:2375/, but it cannot find the Docker daemon. Check your Docker installation and start the Docker service if it’s not running.
  2. Check Docker Toolbox If you are running it on your machine, make sure you run the OpenMRS SDK command from the “Docker Toolbox” terminal. Docker Toolbox sets up a separate environment to work with Docker, and running the SDK command from the standard terminal might not work correctly.
  3. If you have confirmed that Docker is running, but the issue persists, try resetting the Docker host. You can do this by re-running the SDK setup with the additional parameter -DdockerHost as follows: mvn openmrs-sdk:setup -DdockerHost="tcp://correct/url"

FYI Replace the "tcp://correct/url" with the correct URL or IP address of your Docker host.

I was able to get a little bit further (I’m on Windows 11) by doing the following:

The first time I ran the openmrs-sdk:setup it failed giving an error that it could not find a suitable driver for MySql. The second time the build succeeded.

I was also able to get the server up an running and got through all of the initialization steps and was able to log into OpenMRS per the instructions here: Set Up OpenMRS Server with OpenMRS SDK and Docker - Documentation - OpenMRS Wiki

Thank you so much Everybody for all of the help!!!