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

NPE during docker:logs #612

Closed
tkruse opened this issue Nov 7, 2016 · 4 comments
Closed

NPE during docker:logs #612

tkruse opened this issue Nov 7, 2016 · 4 comments

Comments

@tkruse
Copy link

tkruse commented Nov 7, 2016

Description

when running docker:logs, task fails with NPE. I guess would be easiet to provide Dockerfile, too, but it is confidential.

Info

  • d-m-p version : 0.17.1
  • Maven version (mvn -v) : 3.3.9
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.fabric8:docker-maven-plugin:0.17.1:logs (default-cli) on project
ven-plugin:0.17.1:logs failed.
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal io.fabric8:docker-maven-plugin:0.17.1:logs failed.
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        ... 20 more
Caused by: java.lang.NullPointerException
        at io.fabric8.maven.docker.LogsMojo.executeInternal(LogsMojo.java:55)
        at io.fabric8.maven.docker.AbstractDockerMojo.execute(AbstractDockerMojo.java:193)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        ... 21 more
  • Docker version : 1.12.0
  • OS: Windows 7

My docker config:

<image>
							<name>%g/my_api:01</name>
							<alias>my_api</alias>
							<build>
								<dockerFileDir>${project.basedir}/dockerfiles/my_api</dockerFileDir>
								 <cmd>
									<!-- By default, start weblogic on docker start -->
						            <shell>/rms/dev/wls/domainA/startWebLogic.sh</shell>
								</cmd>
							</build>
							<run>
								<ports>
									<!-- Weblogic admin port -->
									<port>7001:7001</port>
								</ports>
							</run>
						</image>
@tkruse
Copy link
Author

tkruse commented Nov 7, 2016

Additionally I can say that this image has a problem (that I wanted to debug using logs), such that after mvn docker:start, the container seems to be stopped, not running.

@tkruse
Copy link
Author

tkruse commented Nov 7, 2016

And fixinf my problem, docker:logs works fine. So the issue happens when the container is not started after docker:start.

@rhuss
Copy link
Collaborator

rhuss commented Nov 11, 2016

Thanks for the report.

Yes, you are right, the logs assume that there is that the container is still running. I will add the proper check in case the container has been already stopped.

@rhuss rhuss closed this as completed in afcb9ab Nov 11, 2016
@tkruse
Copy link
Author

tkruse commented Nov 16, 2016

thx

rhuss added a commit that referenced this issue Dec 17, 2016
Fixes #612.

Signed-off-by: Roland Huß <roland@ro14nd.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants