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

log file output broken in 0.24.0, 0.25.0, 0.25.1, 0.25.2 #1010

Closed
chonton opened this issue Apr 25, 2018 · 4 comments
Closed

log file output broken in 0.24.0, 0.25.0, 0.25.1, 0.25.2 #1010

chonton opened this issue Apr 25, 2018 · 4 comments

Comments

@chonton
Copy link
Contributor

chonton commented Apr 25, 2018

Description

With 0.24.0 container starts and output file is created, but plugin does not complete
With 0.25.0, 0.25.1, 0.25.2 container starts and plugin completes, but output file is not created

With 0.23.0 container starts and output file is created, and plugin completes

Info

  • d-m-p version : 0.24.0, 0.25.0, 0.25.1, 0.25.2
  • Maven version (mvn -v) :
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T00:58:13-07:00)
Java version: 1.8.0_92, vendor: Oracle Corporation
  • Docker version : 18.03.0-ce-mac60 (23751)

  • If it's a bug, how to reproduce :
    Use mvn docker:start with the following pom.

  • Sample project :

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>repro</groupId>
  <artifactId>bug</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <build>
    <plugins>
      <plugin>
        <groupId>io.fabric8</groupId>
        <artifactId>docker-maven-plugin</artifactId>
        <version>0.23.0</version>
        <configuration>
          <images>
            <image>
              <name>docker.io/vault:0.7.2</name>
              <alias>vault</alias>
              <run>
                <namingStrategy>alias</namingStrategy>
                <network>
                  <name>${docker.network}</name>
                </network>
                <env>
                  <!-- hack to allow older docker hosts to start the vault image -->
                  <SKIP_SETCAP>true</SKIP_SETCAP>
                </env>
                <wait>
                  <time>30000</time>
                  <log>Vault server started! Log data will stream in below:</log>
                </wait>
                <log>
                  <file>vault.log</file>
                </log>
              </run>
            </image>
          </images>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>start</goal>
              <goal>stop</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
@hho
Copy link
Contributor

hho commented May 8, 2018

I have no issues with 0.24.0 – but it's true that logging to files is broken in 0.25.x 😢

(Maven 3.5.3, Docker 18.04)

@hho
Copy link
Contributor

hho commented May 8, 2018

@rhuss I have git bisected it to 52e4a05 – since then, no log files are created anymore.

@chonton The "hanging" problem you described might be the one fixed by 6e6aecf – that would explain why it works in 0.25.x

EDIT: Workaround – you have to set <enabled>true</enabled> explicitly in the <log> configuration block.

@rhuss
Copy link
Collaborator

rhuss commented May 15, 2018

@stromnet could you please have a look ? There seem to have been an issue introduced with the properties merging part.

@stromnet
Copy link
Contributor

I'm suspecting LogConfiguration created without Builder gets enabled = null, and the non-property path does not look at the isBlank. A fix might be to change StartMojo return Boolean.TRUE == logConfig.isEnabled(); into return Boolean.TRUE == logConfig.isEnabled() || (Boolean.FALSE != logConfig.isEnabled() && !logConfig.isBlank());, or add some functionally equivalent method.

I cannot look closer today, will take a proper look tomorrow.

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

4 participants