mvn openmrs-sdk:setup gives "invalid JSON: ParseAddr(\"localhost\"): unable to parse IP"

Running the steps from here: https://openmrs.atlassian.net/wiki/spaces/docs/pages/25477418/Set+Up+OpenMRS+Server+with+OpenMRS+SDKhttps://openmrs.atlassian.net/wiki/spaces/docs/pages/25477418/Set+Up+OpenMRS+Server+with+OpenMRS+SDK . Given the doc says Docker is preferred, I’d like to get that option running. docker image ls shows

IMAGE ID DISK USAGE CONTENT SIZE EXTRA hello-world:latest 05813aedc15f 25.9kB 9.52kB U mysql:8.4.1 a7dc4a4e07a9 813MB 183MB mysql:latest 6b18d01fb632 1.27GB 283MB U

Thanks in advance for any help!

Did you Google AI Search?

I did, Daniel, thanks, but nothing yet. I’ll keep digging.

Still trying to diagnose the problem.

I added debug/diagnostic switches to the maven command:

mvn -e -X openmrs-sdk:setup | tee openmrs-sdk_setup_1.txt

Which produced this output:

[DEBUG] http-outgoing-0 >> "{"name":"openmrs-sdk-mysql-v8-4-1","authConfig":null,"Hostname":null,"Domainname":null,"User":null,

"AttachStdin":null,"AttachStdout":true,"AttachStderr":null,"PortSpecs":null,"Tty":null,"OpenStdin":null,"StdinOnce":null,

"Env":["MYSQL_ROOT_PASSWORD=Admin123"],"Cmd":null,"Healthcheck":null,"ArgsEscaped":null,"Entrypoint":null,"Image":"mysql:8.4.1","Volumes":{},"WorkingDir":null,"MacAddress":null,"OnBuild":null,"NetworkDisabled":null,"ExposedPorts":{},"StopSignal":null,"StopTimeout":null,"HostConfig":{"Binds":["openmrs-sdk-mysql-v8-4-1-data:/var/lib/mysql:rw"],"BlkioWeight":null,"BlkioWeightDevice":null,"BlkioDeviceReadBps":null,"BlkioDeviceWriteBps":null,"BlkioDeviceReadIOps":null,"BlkioDeviceWriteIOps":null,"MemorySwappiness":null,"NanoCpus":null,"CapAdd":null,"CapDrop":null,"ContainerIDFile":null,"CpuPeriod":null,"CpuRealtimePeriod":null,"CpuRealtimeRuntime":null,"CpuShares":null,"CpuQuota":null,"CpusetCpus":null,"CpusetMems":null,"Devices":null,"DeviceCgroupRules":null,"DeviceRequests":null,"DiskQuota":null,"Dns":null,"DnsOptions":null,"DnsSearch":null,"ExtraHosts":null,"GroupAdd":null,"IpcMode":null,"Cgroup":null,"Links":null,"LogConfig":null,"LxcConf":null,"Memory":null,"MemorySwap":null,"MemoryReservation":null,"KernelMemory":null,"NetworkMode":null,"OomKillDisable":null,"Init":null,"AutoRemove":null,"OomScoreAdj":null,"PortBindings":{"3306/tcp":[{"HostIp":"localhost","HostPort":"3308"}]},"Privileged":null,"PublishAllPorts":null,"ReadonlyRootfs":null,"RestartPolicy":null,"Ulimits":null,"CpuCount":null,"CpuPercent":null,"IOMaximumIOps":null,"IOMaximumBandwidth":null,"VolumesFrom":null,"Mounts":null,"PidMode":null,"Isolation":null,"SecurityOpt":null,"StorageOpt":null,"CgroupParent":null,"VolumeDriver":null,"ShmSize":null,"PidsLimit":null,"Runtime":null,"Tmpfs":null,"UTSMode":null,"UsernsMode":null,"Sysctls":null,"ConsoleSize":null},"Labels":{"openmrs-sdk-mysql-v8-4-1":"true"},"Shell":null,"NetworkingConfig":null}"

[DEBUG] http-outgoing-0 << "HTTP/1.1 400 Bad Request[\r][\n]"

[DEBUG] http-outgoing-0 << "Api-Version: 1.52[\r][\n]"

[DEBUG] http-outgoing-0 << "Content-Type: application/json[\r][\n]"

[DEBUG] http-outgoing-0 << "Docker-Experimental: false[\r][\n]"

[DEBUG] http-outgoing-0 << "Ostype: linux[\r][\n]"

[DEBUG] http-outgoing-0 << "Server: Docker/29.1.5 (linux)[\r][\n]"

[DEBUG] http-outgoing-0 << "Date: Tue, 27 Jan 2026 17:30:08 GMT[\r][\n]"

[DEBUG] http-outgoing-0 << "Content-Length: 73[\r][\n]"

[DEBUG] http-outgoing-0 << "[\r][\n]"

[DEBUG] http-outgoing-0 << "{"message":"invalid JSON: ParseAddr(\"localhost\"): unable to parse IP"}[\n]"

My current assumptions:

  • Something is sending a JSON string to a Docker instance on an http port

  • Some process in that Docker instance is running some JavaScript containing the ParseAddr command

  • “localhost” is a (syntactically) valid IP address

  • Some network configuration in that Docker instance does not include “localhost” as a valid IP address

  • I therefore need to manually run the Docker instance, log into it, and diagnose why localhost isn’t being resolved

If any of my assumptions are incorrect, please let me know. I will continue down this path for a few more days, then try removing Docker from my system and using local mySql.

FYI, these are my inputs to the various command prompts that happen during “mvn openmrs-sdk:setup”

  • Default: “server”

    1. Reference Application 3.x
    1. 3.6.0-SNAPSHOT
  • Default port (8080)

  • Debug port: 1044

    1. MySQL 8.4.1 and above in SDK docker container (requires pre-installed Docker)

Thank you.

Did you try connecting to MySQL which is not in a docker container?

I think our SDK hasn’t been updated to work with Docker 29 yet, which forces a new API version as well as a few other breaking changes. There’s no real customization, though, we just install and setup a base MySQL container. You can run pretty much the same thing with something like:

docker run --detach --name openmrs-sdk-mysql-v8-4-1 --env MYSQL_ROOT_PASSWORD=<password of your choice> -p "3308:3306" -v openmrs-data:/var/lib/mysql:z mysql:8.4.1

Then you can use the option to connect to an existing MySQL database (though note that this runs things on port 3308 rather than port 3306 by default).

I got past this by using Docker 27:

sudo apt-get purge docker-ce docker-ce-cli ``containerd.io`` docker-buildx-plugin docker-compose-plugin docker-engine

Reboot

Running commands in https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository

VERSION_STRING=5:27.5.1-1~ubuntu.22.04~jammy

sudo apt install docker-ce=$VERSION_STRING docker-ce-cli=$VERSION_STRING containerd.io docker-buildx-plugin docker-compose-plugin

Thank you.