docker-py: client and server don't have same version (client : 1.16, server: 1.15)")

  • Last Update :
  • Techknowledgy :

Say you want to connect to your docker service like this:

docker_client = Client(base_url = 'tcp://127.0.0.1:2376')
# Alternatively:
   # docker_client = Client(base_url = 'unix://var/run/docker.sock')

If the client version is newer than the server version, this leads to an error message like this:

docker.errors.NotFound: 404 Client Error:
   Not Found("client and server don't have same version (client : 1.22, server: 1.18)")

You can solve the problem by setting the version property of the docker.Client object (as @sredni suggested). Given the error above, you need to change the line to:

docker_client = Client(base_url = 'tcp://127.0.0.1:2376', version = '1.18')

Suggestion : 2

docker-py 0.7.0 gives me the following error against a local Docker installation of Docker 1.3.2 and docker-py 0.7.0. The host ist running CentOS 6.6. How can this be fixed?, Resetting the “DOCKER_API_VERSION” variable can fix an error when the Docker client is not running the same version as the incompatible Docker API. Read this discussion of solving incompatible Docker API and client . , 1 week ago I am getting this exception after running import docker cli = docker.Client(base_url="unix:///var/run/docker.sock") cli.images() I have installed on … , 1 week ago Jul 05, 2014  · In case you use docker-machine to manage a local VirtualBox-based machines the solution is as simple as for boot2docker:. docker-machine upgrade MACHINE_NAME It asks docker-machine to download the latest boot2docker.iso and place it as a new root filesystem in the upgraded VM.. By the way, the VirtualBox-backed docker machine has its root filesystem …


[email protected] myproject]$ bin/python d.py Traceback (most recent call last): File "d.py", line 3, in <module> c.create_container(image='zopyx/xmldirector-plone') File "/home/xxxx/sandboxes/myproject/lib/python2.7/site-packages/docker/client.py", line 546, in create_container return self.create_container_from_config(config, name) File "/home/xxxx/sandboxes/myproject/lib/python2.7/site-packages/docker/client.py", line 554, in create_container_from_config return self._result(res, True) File "/home/xxxx/sandboxes/myproject/lib/python2.7/site-packages/docker/client.py", line 98, in _result self._raise_for_status(response) File "/home/xxxx/sandboxes/myproject/lib/python2.7/site-packages/docker/client.py", line 94, in _raise_for_status raise errors.APIError(e, response, explanation=explanation) docker.errors.APIError: 404 Client Error: Not Found ("client and server don't have same version (client : 1.16, server: 1.15)") >>docker --version Docker version 1.3.2, build 39fa2fa/1.3.2 >>docker version Client version: 1.3.2 Client API version: 1.15 Go version (client): go1.3.3 Git commit (client): 39fa2fa/1.3.2 OS/Arch (client): linux/amd64 Server version: 1.3.2 Server API version: 1.15 Go version (server): go1.3.3 Git commit (server): 39fa2fa/1.3.2
[email protected] myproject]$ bin/python d.py Traceback (most recent call last): File "d.py", line 3, in <module>c.create_container(image='zopyx/xmldirector-plone') File "/home/xxxx/sandboxes/myproject/lib/python2.7/site-packages/docker/client.py", line 546, in create_containerreturn self.create_container_from_config(config, name) File "/home/xxxx/sandboxes/myproject/lib/python2.7/site-packages/docker/client.py", line 554, in create_container_from_configreturn self._result(res, True) File "/home/xxxx/sandboxes/myproject/lib/python2.7/site-packages/docker/client.py", line 98, in _resultself._raise_for_status(response) File "/home/xxxx/sandboxes/myproject/lib/python2.7/site-packages/docker/client.py", line 94, in _raise_for_statusraise errors.APIError(e, response, explanation=explanation) docker.errors.APIError: 404 Client Error: Not Found ("client and server don't have same version (client : 1.16, server: 1.15)") >>docker --version Docker version 1.3.2, build 39fa2fa/1.3.2 >>docker version Client version: 1.3.2 Client API version: 1.15 Go version (client): go1.3.3 Git commit (client): 39fa2fa/1.3.2 OS/Arch (client): linux/amd64 Server version: 1.3.2 Server API version: 1.15 Go version (server): go1.3.3 Git commit (server): 39fa2fa/1.3.2
docker_client = Client(base_url = 'tcp://127.0.0.1:2376') # Alternatively: # docker_client = Client(base_url = 'unix://var/run/docker.sock')
docker.errors.NotFound: 404 Client Error: Not Found("client and server don't have same version (client : 1.22, server: 1.18)")
docker_client = Client(base_url = 'tcp://127.0.0.1:2376', version = '1.18')

Suggestion : 3

Fixed the OpenSSL version mismatch error when shelling out to the SSH client (via bump to docker-py 4.4.4 which contains the fix)., Fixed the OpenSSL version mismatch error when shelling out to the SSH client (via bump to docker-py 4.4.4 which contains the fix). ,Pinned Kubernetes dependencies to the same version as in buildx.,Fixed SSH hostname parsing when it contains a leading ‘s’/’h’, and removed the quiet option that was hiding the error (via docker-py bump to 4.4.2).

build:
   context: .
args:
   buildno: 1
ports:
   -"3000-3005" -
   "9000-9001:8000-8001"
$ echo 'redis: {"image": "redis"}' | docker - compose--file - up
  $ docker - compose up--x - smart - recreate
environment:
   RACK_ENV: development
SESSION_SECRET:
volumes_from:
   -service_name -
   container_name

Suggestion : 4

The latest Go release, version 1.16, arrives six months after Go 1.15. Most of its changes are in the implementation of the toolchain, runtime, and libraries. As always, the release maintains the Go 1 promise of compatibility. We expect almost all Go programs to continue to compile and run as before. , Servers will now prefer other available AEAD cipher suites (such as ChaCha20Poly1305) over AES-GCM cipher suites if either the client or server doesn't have AES hardware support, unless both Config.PreferServerCipherSuites and Config.CipherSuites are set. The client is assumed not to have AES hardware support if it does not signal a preference for AES-GCM cipher suites. , Clients now return a handshake error if the server selects an ALPN protocol that was not in the list advertised by the client. , The cgo tool will no longer try to translate C struct bitfields into Go struct fields, even if their size can be represented in Go. The order in which C bitfields appear in memory is implementation dependent, so in some cases the cgo tool produced results that were silently incorrect.

Calls to these methods stop the execution of the created goroutine and not the Test* or Benchmark* function. So these are required to be called by the goroutine running the test or benchmark function. For example:

func TestFoo(t * testing.T) {
   go func() {
      if condition() {
            t.Fatal("oops") // This exits the inner func instead of TestFoo.
         }
         ...
   }()
}

Code calling t.Fatal (or a similar method) from a created goroutine should be rewritten to signal the test failure using t.Error and exit the goroutine early using an alternative method, such as using a return statement. The previous example could be rewritten as:

func TestFoo(t * testing.T) {
   go func() {
      if condition() {
            t.Error("oops")
            return
         }
         ...
   }()
}

Suggestion : 5

Update the Kubernetes version of your Amazon EKS control plane to one minor version later than its current version with the following command. Replace my-cluster with your cluster name.,Choose the name of the Amazon EKS cluster to update and choose Update cluster version., Choose the name of the Amazon EKS cluster to update and choose Update cluster version. ,When a new Kubernetes version is available in Amazon EKS, you can update your Amazon EKS cluster to the latest version.

Get the Kubernetes version of your cluster control plane with the kubectl version --short command.

kubectl version--short

Get the Kubernetes version of your nodes with the kubectl get nodes command. This command returns all self-managed and managed Amazon EC2 and Fargate nodes. Each Fargate pod is listed as its own node.

kubectl get nodes

By default, the pod security policy admission controller is enabled on Amazon EKS clusters. Before updating your cluster, ensure that the proper pod security policies are in place. This is to avoid potential security issues. You can check for the default policy with the kubectl get psp eks.privileged command.

kubectl get psp eks.privileged

If you receive the following error, see default pod security policy before proceeding.

Error from server(NotFound): podsecuritypolicies.extensions "eks.privileged"
not found

Check to see if your CoreDNS manifest has a line that only has the word upstream.

kubectl get configmap coredns - n kube - system - o jsonpath = '{$.data.Corefile}' | grep upstream

Remove the line near the top of the file that only has the word upstream in the configmap file. Don't change anything else in the file. After the line is removed, save the changes.

kubectl edit configmap coredns - n kube - system - o yaml

This procedure requires eksctl version 0.107.0 or later. You can check your version with the following command:

eksctl version

Update the Kubernetes version of your Amazon EKS control plane to one minor version later than its current version with the following command. Replace my-cluster with your cluster name.

eksctl upgrade cluster--name my - cluster--approve