Setting Up OpenMRS-SDK

Hello I am experiencing problems trying to setup the SDK using a postgres database. Steps:

  1. run mvn openmrs-sdk:setup
  2. Select beta 16
  3. Select option 4(use postgres)
  4. Decline option to retain data in database
  5. Error failed to drop database

If I try to use a dockerized mysql version I get this error [ERROR] Failed to execute goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:5.5.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.5.0:run-db failed: Unsupported protocol scheme found: ’ http://127.0.0.1:2375/ **->

Oh sorry! kindly have you verified if the docker host URL is specified correctly? It should be something like tcp://127.0.0.1:2375 .

Thanks @jwnasambu . Where should I check for this host url?

Also if it helps in troubleshooting I am on windows not linux.

  1. Right-click on the Docker Desktop icon in the system tray and select “Settings.”
  2. Navigate to the “Docker Engine” tab.
  3. Add or modify the "hosts" field in the JSON configuration. Ensure it includes both the TCP and Unix socket URLs:

{
  "hosts": ["tcp://127.0.0.1:2375", "npipe://./pipe/docker_engine"]
}

Click “Apply & Restart” to save the changes.

Got it let me try this

@jwnasambu thank you for the feedback

I have tried this and my daemon wouldn’t start. Any other suggestions please?

Sorry! which error are you getting?

The docker engine does not starte unless I use the following config instead for my daemon.json “hosts”: [ “tcp://127.0.0.1:2375”, “unix:///var/run/docker.sock” ]

If you’re on Windows, Unix sockets aren’t supported (the unix:// part). You might be able to make things work with:

[ "tcp://127.0.0.1:2375", "http://127.0.0.1:2375/" ]

I assume you are having docker desktop if you are on windows. I suggest you go to settings > general > and check ‘Expose daemon on tcp://localhost:2375 without TLS’. That is how mine got working.

Thanks @seremba it worked but now I am getting a new error when I select an existing mysql docker container

[ERROR] Failed to execute goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:5.5.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.5.0:run-db failed: Unsupported protocol scheme found: 'http://127.0.0.1:2375/ → [Help 1] [ERROR]

sorry about that @piuskariuki19 . You can try locating the sdk.properties file and change the dockerHost to dockerHost=tcp://localhost:2375 from dockerHost=http://127.0.0.1:2375 and try again. The sdk.properties file is usually found in C:\Users\whatever\openmrs\sdk.properties replace “whatever” with appropriate name on your system. Then try again.

Thanks @seremba

I finally figured it out. Steps

  1. Expose daemon on tcp://localhost:2375 without TLS
  2. Go to C:\Users\whatever\openmrs\sdk.properties
  3. Replace the value of dockerHost with tcp://127.0.0.1:2375/
  4. Restart your computer
  5. Run the setup again
1 Like