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

Garbled container logs #652

Closed
hwellmann opened this issue Dec 16, 2016 · 0 comments
Closed

Garbled container logs #652

hwellmann opened this issue Dec 16, 2016 · 0 comments

Comments

@hwellmann
Copy link
Contributor

Description

I'm running a container with the following configuration:

<run>
    <wait>
        <http>
            <url>http://localhost:${tomcat.http.port}/foo/</url>
        </http>
        <time>600000</time>
        <exec>
            <postStart>initialize.sh</postStart>
        </exec>
    </wait>
    <log>
        <file>${basedir}/backend.log</file>
    </log>
</run>

The problem is that the resulting logfile backend.log is garbled. It contains the output of my postStart command (which I'm not really interested in), followed by a large block of null bytes, followed by some but not all standard output and standard error messages from the container.

A large chunk of container messages is missing (possibly overwritten by the null bytes).

Using docker.keepContainer and

docker logs mycontainer > out.txt 2> err.txt

I can see that the Docker logs are complete, so I believe d-m-p is to blame.

Is it intended that postStart messages automatically go to the log file as soon as there is a <log> element? Is there a way to route postStart, preStop and normal container messages to different sinks (i.e. files or the console)?

In any case, log messages should not be corrupted.

Looking at the source code, it seems that DefaultLogCallback is lacking proper synchronization.

Info

  • d-m-p version : 0.18.1
  • Maven version (mvn -v) : 3.3.9
  • Docker version : 1.12.3
hwellmann added a commit to hwellmann/docker-maven-plugin that referenced this issue Dec 17, 2016
This avoids corrupted log files.

Fixes fabric8io#652.
hwellmann added a commit to hwellmann/docker-maven-plugin that referenced this issue Dec 21, 2016
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

1 participant