OpenMRS SDK with Docker Failing

Just tried to start up my SDK this morning and getting the following error:

[ERROR] Could not connect to Docker at unix:///var/run/docker.sock.
[ERROR] 
[ERROR]  If the Docker host URL is not correct, please reset it by running setup with the -DdockerHost parameter
[ERROR]  or set it manually by adding -DdockerHost="tcp://correct/url": Status 400: client version 1.18 is too old. Minimum supported API version is 1.24, please upgrade your client to a newer version
[ERROR] -> [Help 1]
[ERROR] 

Looking at the SDK code, it does use the client API version 1.18 of Docker. Assumedly my local version of docker recently upgraded and I need to update the client the SDK uses, hopefully it’s enough to just update that variable, will test and report back.

fyi @dkayiwa @dkigen @ibacher @mseaton @raff

Yes, this seems to suggest the version of Docker I’m using requires a minimum of 1.24.0

goodrich@mgoodrich-ThinkPad-P1-Gen-4i:~$ docker version
Client: Docker Engine - Community
 Version:           25.0.3
 API version:       1.44
 Go version:        go1.21.6
 Git commit:        4debf41
 Built:             Tue Feb  6 21:13:09 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          25.0.3
  API version:      1.44 (minimum version 1.24)
  Go version:       go1.21.6
  Git commit:       f417435
  Built:            Tue Feb  6 21:13:09 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.28
  GitCommit:        ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

I can try relying on the lowest-supported version (1.24.0) but it sounds like that may be deprecated in the not-so-distance further, so I will probably try the latest released API, but this may require some people to update?

1 Like

I think we can actually just leave out the explicit API version. See here, especially “API version negotiation was introduced in Docker v1.12.0 (API 1.24), and clients before that used a fixed API version.”. Then it’s just a matter of keeping the docker-java version somewhat up-to-date.

2 Likes

Thanks @ibacher I was wondering that… just running the SDK tests locally before making any changes (they take awhile!) then I will remove explicit version and see what happens…

So ticketed, PRed, merged, and fixed here!

https://openmrs.atlassian.net/browse/SDK-329

The 5.7.0 version of the SDK has been released with this fix!

Thanks all!

3 Likes

Kudos Mark, that was so fast :joy:

1 Like

You are welcome @grace , I love when they are easy fixes!

2 Likes