Bug 1422798

Summary: [3.3]Custom build failed due to 'client is newer than server' -- docker-1.10.3
Product: OpenShift Container Platform Reporter: XiuJuan Wang <xiuwang>
Component: BuildAssignee: Cesar Wong <cewong>
Status: CLOSED ERRATA QA Contact: Wenjing Zheng <wzheng>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.3.1CC: aos-bugs, bparees, tdawson, xiuwang
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Known Issue
Doc Text:
Cause: Running a custom build with an image that contains a Docker binary that is a different version than the Docker running on the OpenShift node, will result in an error. Consequence: The build will fail with a message about mismatched Docker API version. Workaround (if any): Set the DOCKER_API_VERSION environment variable in the BuildConfig to match the API version running on the node. For example: oc set env bc/buildcfg DOCKER_API_VERSION=1.22 Note that this will only work if the version of the Docker binary on the custom builder image is newer than the version running on the OpenShift node.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-04-12 19:13:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description XiuJuan Wang 2017-02-16 09:39:46 UTC
Description of problem:
Create env with docker 1.10.3.
Custom build will fail due to 'client is newer than server'(client API version: 1.24, server API version: 1.22)

Version-Release number of selected component (if applicable):
docker-1.10.3

#oc version
oc v3.3.1.14
kubernetes v1.3.0+52492b4
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://ip-172-18-14-198.ec2.internal
openshift v3.3.1.14
kubernetes v1.3.0+52492b4


How reproducible:
always

Steps to Reproduce:
1.Check 'docker version' in master
# docker version
Client:
 Version:         1.10.3
 API version:     1.22
 Package version: docker-common-1.10.3-59.el7.x86_64
 Go version:      go1.6.2
 Git commit:      429be27-unsupported
 Built:           Fri Nov 18 17:03:44 2016
 OS/Arch:         linux/amd64

Server:
 Version:         1.10.3
 API version:     1.22
 Package version: docker-common-1.10.3-59.el7.x86_64
 Go version:      go1.6.2
 Git commit:      429be27-unsupported
 Built:           Fri Nov 18 17:03:44 2016
 OS/Arch:         linux/amd64

2.Create a custom build
3.

Actual results:
#oc  build-logs ruby-sample-build-2
Command "build-logs" is deprecated, use "oc logs build/<build-name>" instead.
Sending build context to Docker daemon 124.9 kB
Error response from daemon: client is newer than server (client API version: 1.24, server API version: 1.22)
Error response from daemon: client is newer than server (client API version: 1.24, server API version: 1.22)


Expected results:
Custom build should succeed.

Additional info:

Comment 1 Cesar Wong 2017-02-16 13:23:34 UTC
Can you please include details about the custom build that you ran? (build config, source repo, etc)

Does the custom builder image include a docker client binary? If it does, and the version doesn't match what we are running on the node, there's really nothing we can do from the product side. As the end-user, if you are going to include a docker client binary in your image, you need to make sure that it's compatible.

Comment 2 XiuJuan Wang 2017-02-17 09:25:00 UTC
Cesar,
I use [1] template with docker.io/openshift/origin-custom-docker-builder image.

The docker version in docker.io/openshift/origin-custom-docker-builder is 1.12.6-cs6, it doesn't match the docker version(1.10.3, api version 1.22) in my env.

Can we do something to allow custom build when the docker versions are dismatch in image and server?

[1] https://raw.githubusercontent.com/openshift/origin/master/examples/sample-app/application-template-custombuild.json

Comment 3 Ben Parees 2017-02-17 15:06:16 UTC
Looks like if you add DOCKER_API_VERSION=1.22 as an environment variable on the buildconfig, that might solve it.  Can you try that?

Comment 4 Ben Parees 2017-02-17 15:07:05 UTC
(based on this thread: https://github.com/docker/machine/issues/2147#issuecomment-237787281)

Comment 5 XiuJuan Wang 2017-02-20 05:53:06 UTC
Ben,
It works when export DOCKER_API_VERSION=1.22 in buildconfig when client is newer than server with docker version.
Thanks.
Move this bug to verified.

Comment 7 errata-xmlrpc 2017-04-12 19:13:09 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:0884