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

No mutex on Writer #22

Open
chrisDeFouRire opened this issue Mar 17, 2018 · 0 comments
Open

No mutex on Writer #22

chrisDeFouRire opened this issue Mar 17, 2018 · 0 comments

Comments

@chrisDeFouRire
Copy link

I'm tracking a bug where Graylog says it has received invalid GELF JSON (TCP transport, from docker GELF logger which is using this Writer).

It looks like this mu Mutex is never used...

mu sync.Mutex

Here is the calling code in the Docker logger..

https://github.com/moby/moby/blob/master/daemon/logger/gelf/gelf.go#L184

And here's an extract from my Graylog logs...

2018-03-17 09:27:23,810 ERROR: org.graylog2.inputs.codecs.GelfCodec - Could not parse JSON, first 400 characters: {"version":"1.1","host":"france2.sslping.com","short_message":"2018/03/17 09:27:22 twr1.thewaiting-room.net (80.82.112.63:443): true","timestamp":1521278842.705,"level":3,"_command":"./main","_container_id":"95abe5c05bde85e05a460b4d2a0875d779d23e9469722846430e96bbf8e5afec","_container_name":"nats_cve20162107.3.43d8bhzvc82qkc6ir2lrziyyi","_created":"2018-03-16T17:43:35.735128942Z","_image_id":"sha2...

com.fasterxml.jackson.core.JsonParseException: Unexpected character ('v' (code 118)): was expecting comma to separate Object entries
 at [Source: {"version":"1.1","host":"france2.sslping.com","short_message":"2018/03/17 09:27:22 twr1.thewaiting-room.net (80.82.112.63:443): true","timestamp":1521278842.705,"level":3,"_command":"./main","_container_id":"95abe5c05bde85e05a460b4d2a0875d779d23e9469722846430e96bbf8e5afec","_container_name":"nats_cve20162107.3.43d8bhzvc82qkc6ir2lrziyyi","_created":"2018-03-16T17:43:35.735128942Z","_image_id":"sha256:a70d979f79007e38f57a0b77310145102934eee96c80a4df3f03b642e76aad6e","_image_name":"registry.gitlab.com/chrishartwig/sslping/nats_cve20162107:latest","_tag":"vul{"version":"1.1","host":"france2.sslping.com","short_message":"2018/03/17 09:27:22 pip.lade.io (13.32.214.118:443): false","timestamp":1521278842.831,"level":3,"_command":"./main","_container_id":"8e68654e1ff2ec9838a10362141ac432ca0301dfa246ae52cfa8c81cbe59f9d7","_container_name":"nats_heartbleed.2.fx9blxsrii95z3w7a59t539s1","_created":"2018-03-16T17:42:22.48917432Z","_image_id":"sha256:6d1aed1d88d0b2b38f6f6435396670fa27f060656701efe86e731d3163759624","_image_name":"registry.gitlab.com/chrishartwig/sslping/nats_heartbleed:latest","_tag":"vuln"}; line: 1, column: 565]

It does occur under moderate load (13k messages in 4min) and from the logs, it looks like the 2 mingled messages are always from the same host, possibly from the same container (hard to tell with corrupted JSON)...
I don't know if it's a graylog issue, or a Docker logger issue (maybe the logger should use a mutex)...

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