Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing support in CreateContainer for portBindings and cpuset #66

Merged
merged 1 commit into from May 16, 2015

Conversation

itaior
Copy link

@itaior itaior commented May 5, 2015

Fixed NPE in BuildImageResponseHandler

Add missing support in CreateContainer for portBindings and cpuset
@bmuschko
Copy link
Owner

bmuschko commented May 5, 2015

Thanks for the pull request. Can you give me some more background on when stream can be null?

@itaior
Copy link
Author

itaior commented May 5, 2015

I got NPE when try to push to docker after upgrade docker server to 1.6.0.
But may be it's related to other push error I has. Anyway I can't reproduce

@itaior
Copy link
Author

itaior commented May 6, 2015

Hi ,

I reproduced the error :

11:58:02.056 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Connection can be kept alive indefinitely
11:58:02.940 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection [id: 0][route: {}->http://192.168.33.10:4243] can be kept alive indefinitely
11:58:02.940 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection released: [id: 0][route: {}->http://192.168.33.10:4243][total kept alive: 1; route allocated: 1 of 2; total allocated: 1 of 20]
11:58:02.942 [INFO] [com.bmuschko.gradle.docker.response.BuildImageResponseHandler] Step 0 : FROM myd-vm00941.hpswlabs.adapps.hp.com:5000/thirdparty/centos:7

11:58:02.943 [INFO] [com.bmuschko.gradle.docker.response.BuildImageResponseHandler] ---> 0114405f9ff1

11:58:02.943 [INFO] [com.bmuschko.gradle.docker.response.BuildImageResponseHandler] Step 1 : MAINTAINER Boris Komraz

11:58:02.943 [INFO] [com.bmuschko.gradle.docker.response.BuildImageResponseHandler] ---> Using cache

11:58:02.943 [INFO] [com.bmuschko.gradle.docker.response.BuildImageResponseHandler] ---> 0b2718cf626f

11:58:02.943 [INFO] [com.bmuschko.gradle.docker.response.BuildImageResponseHandler] Step 2 : ADD http://mydtbld0023.isr.hp.com:8081/nexus/service/local/repositories/thirdparty/content/com/hp/LinuxCOE-CentOS/0.0.1/LinuxCOE-CentOS-0.0.1.repo /etc/yum.repos.d/

11:58:02.943 [INFO] [com.bmuschko.gradle.docker.response.BuildImageResponseHandler] null
11:58:02.946 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':maas-centos-7:buildImage'
11:58:02.946 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :maas-centos-7:buildImage FAILED
11:58:02.946 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :maas-centos-7:buildImage (Thread[Daemon worker Thread 30,5,main]) completed. Took 1.596 secs.
11:58:02.946 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[Daemon worker Thread 30,5,main]] finished, busy: 1.62 secs, idle: 0.002 secs
11:58:02.947 [ERROR] [org.gradle.BuildExceptionReporter]
11:58:02.947 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
11:58:02.947 [ERROR] [org.gradle.BuildExceptionReporter]
11:58:02.947 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
11:58:02.948 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':maas-centos-7:buildImage'.
11:58:02.948 [ERROR] [org.gradle.BuildExceptionReporter] > Cannot invoke method contains() on null object
11:58:02.948 [ERROR] [org.gradle.BuildExceptionReporter]
11:58:02.948 [ERROR] [org.gradle.BuildExceptionReporter] * Try:
11:58:02.948 [ERROR] [org.gradle.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.
11:58:02.948 [LIFECYCLE] [org.gradle.BuildResultLogger]
11:58:02.948 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED
11:58:02.948 [LIFECYCLE] [org.gradle.BuildResultLogger]

After the fix:

12:02:41.273 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Connection can be kept alive indefinitely
12:02:42.774 [INFO] [com.bmuschko.gradle.docker.response.PushImageResponseHandler] Step 0 : FROM myd-vm00941.hpswlabs.adapps.hp.com:5000/infra/maas-centos:7

12:02:42.775 [INFO] [com.bmuschko.gradle.docker.response.PushImageResponseHandler] ---> 25ca39856eb2

12:02:42.775 [INFO] [com.bmuschko.gradle.docker.response.PushImageResponseHandler] Step 1 : MAINTAINER Boris Komraz

12:02:42.775 [INFO] [com.bmuschko.gradle.docker.response.PushImageResponseHandler] ---> Using cache

12:02:42.775 [INFO] [com.bmuschko.gradle.docker.response.PushImageResponseHandler] ---> c5db5a6fac12

12:02:42.775 [INFO] [com.bmuschko.gradle.docker.response.PushImageResponseHandler] Step 2 : ENV CONSUL_TEMPLATE_HOME /opt/template-client

12:02:42.775 [INFO] [com.bmuschko.gradle.docker.response.PushImageResponseHandler] ---> Using cache

12:02:42.775 [INFO] [com.bmuschko.gradle.docker.response.PushImageResponseHandler] ---> e6361456eeb6

12:02:42.776 [INFO] [com.bmuschko.gradle.docker.response.PushImageResponseHandler] Step 3 : ADD http://mydtbld0023.isr.hp.com:8081/nexus/service/local/artifact/maven/content?g=com.hashicorp.consul&a=consul-template&v=0.7.0&c=linux&r=thirdparty&p=bin $CONSUL_TEMPLATE_HOME/consul-template

12:02:43.323 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection [id: 0][route: {}->http://192.168.33.10:4243] can be kept alive indefinitely
12:02:43.323 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection released: [id: 0][route: {}->http://192.168.33.10:4243][total kept alive: 1; route allocated: 1 of 2; total allocated: 1 of 20]
12:02:43.323 [INFO] [com.bmuschko.gradle.docker.response.PushImageResponseHandler] null
12:02:43.323 [INFO] [com.bmuschko.gradle.docker.response.PushImageResponseHandler] ---> Using cache

12:02:43.324 [INFO] [com.bmuschko.gradle.docker.response.PushImageResponseHandler] ---> d1d85b778310

12:02:43.324 [INFO] [com.bmuschko.gradle.docker.response.PushImageResponseHandler] Step 4 : RUN mkdir $CONSUL_TEMPLATE_HOME/templates && chmod +x $CONSUL_TEMPLATE_HOME/consul-template

12:02:43.324 [INFO] [com.bmuschko.gradle.docker.response.PushImageResponseHandler] ---> Using cache

12:02:43.324 [INFO] [com.bmuschko.gradle.docker.response.PushImageResponseHandler] ---> f5fb62495cf3

12:02:43.324 [INFO] [com.bmuschko.gradle.docker.response.PushImageResponseHandler] Successfully built f5fb62495cf3

Also have to change the logger:

Logger logger = Logging.getLogger(PushImageResponseHandler)

to Logger logger = Logging.getLogger(BuildImageResponseHandler)

in BuildImageResponseHandler.java

Thanks ,

Itai

@bmuschko bmuschko self-assigned this May 6, 2015
@bmuschko bmuschko added the bug label May 6, 2015
@bmuschko bmuschko added this to the v2.3.2 milestone May 6, 2015
@bmuschko
Copy link
Owner

bmuschko commented May 6, 2015

Thanks. I am going to merge soon.

@bmuschko bmuschko modified the milestones: v2.4, v2.3.2 May 16, 2015
@bmuschko bmuschko merged commit 2f3e415 into bmuschko:master May 16, 2015
bmuschko added a commit that referenced this pull request May 16, 2015
@bmuschko
Copy link
Owner

Thanks for the pull request. It has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants