-
Notifications
You must be signed in to change notification settings - Fork 644
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
Invalid log format for ... Failed to' (expected: "<timestamp> <txt>") #259
Comments
No, no, we love bug reports ;-) (because it manifests that ppl are using the software :) Seems to be a bug when parsing the streaming answers. Could you provide a little bit more context, i.e. the point in the stack trace where the plugin kicks in ? |
So I'm not sure if the stack trace in the image is related to the datetime bugs. If I run the same to provide some more context, I have the maven docker plugin hooked into the pre-integration-phase of maven. Once that phase hits, it starts the docker containers. After starting the docker containers I run the tests within one of the running images. The tests fail due to misconfiguration and I get an invalid log error. I ran the clean install a few times and I was able to generate a stacktrace from within the plugin.
|
I've been doing some debugging and I've narrowed it down to:
|
Now a proper JSONTokener wrapping the input stream is used.
I just pushed some changes which are supposed to fix this issue (can't really reproduce it here). Could you please try out 0.13.4-SNAPSHOT ? It has been pushed to Maven central or you can build it on you own from branch |
Hey it didn't seem to work. Sorry for the late response. I deleted my ~/.m2 and did mvn clean install. The data coming through is still malformed when it gets printed to the screen. I am going to have to use a custom solution to my problem. Once this issue is resolved I will take another look. In the meantime I can work with you to get it resolved, but it will be one of the last things on my list of things to do since I am very busy with work. |
Seems there are going some special symbols at the beggining of line in log:
Why the build should be broken because of such thing ? Why for searching log is not used simple String.contains or something similar to avoid such blockers? Why is so necessary to parse the date or log format? Can we skip that? |
I agree it should not fail the build when a log statement is unparseable. The logger implementation as it looks now makes me think it is hard to avoid. It could be easier to simplify that part of the code at the price of some features. I get the impression that there is more that one thread writing to the logger. When I run two containers simultaneously I sometimes get one of the outputs and sometimes two. Is it thread safe? |
The problem is, that each log line sent by the Docker daemon has a fixed format:
That's also the reason for the funny bytes in the beginning (also they should have been already consumed). That had been fixed a while ago, so I need to check why this fix doesn't work. Unfortunately this format is not officially defined in the documentation so it has been found empirically. It would help tremendously if I could get hands on a (minimal) example which reproducably exhibits this behaviour. @CyborTronik @mason @andreasaronsson @sebastiankirsch could you help me here ? |
I have started trying to reproduce in a minimal example but not succeeded yet. As I already indicated I currently suspect there might be some thread safeness that is missing. In the full setup I was working on before the error appeared intermittently and I was able to run many times without error in succession and then it would fail multiple times in a row without touching the setup. This makes it harder to reproduce reliably and predictably. I will post again if/when I find the time to make the error appear more often. At least there is some information in the repo at this time. Sorry for not being able to be more helpful right away. |
Similar for me, although I gave it a shot: https://github.com/sebastiankirsch/docker-maven-plugin-issue259 To reproduce the problem:
Execution of the Maven build step should result in a "successful build" because the application logged a specific string. Maybe you end up experiencing an I even added several threads and all, but the funny thing is that our problematic application is based on Spring Boot and the |
I have updated my example. After several iterations with different values I am not able to provoke the same behaviour. However, I think it is acting in a surprising way. The log output seems to block on one of the images. Also hangs when I expect it to continue. It is as if only one of the containers can produce output at the same time. Maybe I don't understand what the expected behavour is but FWIW.. |
That made me realize that we as well are running 3 containers in parallel, so I updated my example to reflect that: https://github.com/sebastiankirsch/docker-maven-plugin-issue259 First run produced an error with a bad/broken chunk message. Didn't record it, didn't occur again :/ What one can see (after understanding what is logged by the |
Thans for all your feedback. It looks indeed like it is an concurrency issue, so I will try to provoke it here, too. |
when i set |
true seems to not fix my maven build in my environment. I've put more details about my environment in a possibly related issue: #344 |
There seems to be issues with long running HTTP request like fetching logs with chunked encodings and pooling connections. It seems that connections get released to soon and then reused in a different context when there is still log data to read. Now logging uses a non-pooled, single connection client for doing async log fetching which hopefully resolves the issues reported in #344 and #259.
@rhuss After upgrading to v0.15.1, I'm still getting "Invalid format" half the time. However, the hanging issue seems to be gone.
|
After upgrading to 0.15.2 I haven't seen the problem in a good while. |
I've just run into this problem. My environment is starting a gogs container with a git repo in it, then using that container from another container to do a git clone. I've diverted the logs to files, and the output in that file looks like this:
If you want to see it reproduced, it's popping up in: repo: https://github.com/jdcasey/indy This was using 0.15.9, FWIW. |
setting showLogs == true made the problem disappear magically. |
@jdcasey @mason @andreasaronsson @CyborTronik @sebastiankirsch @arman1371 @brian98point6 : When this issue bit you, how did you access the Docker daemon ? Via
?? |
@rhuss I was accessing via unix socket when the issue bit us, but have since switched to TCP. |
It looks like I was using the unix socket. I changed the pom.xml configuration to use:
But I'm still seeing the same error. Maybe I made this change in the wrong place, or using the wrong value format? I put it in the top-level configuration for the plugin. I should also mention that I've got four image sections in my build. One is a test appliance furnishing a gogs server to the others. Of the other three, only one builds the image, while the remaining two provide alternative The log-parsing failures inevitably happen when doing a git clone, but it's random which version of the image will fail to start. |
@jdcasey That's interesting since the the concurrency issue is bound to the unix socket variant. Any chance that you can share your configuration ? (The |
@rhuss I'm probably not configuring things correctly, but I'm having some trouble finding examples to follow. My configuration is at: https://github.com/jdcasey/indy/blob/master/deployments/docker/pom.xml |
Thanks, I will check that tomorrow. |
We've been using the Unix socket (by not setting DOCKER_HOST). |
@sebastiankirsch then you are probably lucky ;-) I dont think its really fixed but might happen less frequently with newer version (btw we are 0.15.10 at the moment, with 0.15.11 coming soon). The alternative which should always work is to switch to TCP as their are no raced conditions. |
Is there a possibility that an OS update fixed the race condition? |
Just occurred for me on dmp:0.15.11 on OSX 10.11.5:
|
Are you using the docker Unix socket ? Gengar003 [email protected] schrieb am Mi., 20. Juli 2016, 17:18:
|
@rhuss I believe so - no Docker connection info is specified in any pom.xml configuration and the |
where the logline pattern was bogus, in the case a frames returns multiple lines at once. I.e. it fixes this issue #259 (comment)
I'm sure you guys hate me by now :)
This is related to: https://github.com/rhuss/docker-maven-plugin/issues/242
I saw it happen in 0.13.3-SNAPSHOT and also 0.13.4-SNAPSHOT. I posted about this in another pull request that got closed(so maybe you guys didn't see it?) but it probably makes sense to make another issue. I was able to replicate the issue here: https://github.com/mason/mvn-docker-plugin-bug
just do
mvn clean install
and you should see. attached is a screenshot.Also this only occurs on ubuntu as well. I've never seen this happen on mac.
The text was updated successfully, but these errors were encountered: