Skip to content

Garbled container logs #652

Closed
Closed
@hwellmann

Description

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions