-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Auditbeat] Retain compatibility with older Docker server versions #7542
Comments
If I understand Docker Maintenance Lifecycle correctly, Docker engine I open to ideas here, not sure I have any 😞 Also pinging @andrewkroh |
@exekias Shouldn't our client downgrade to 1.23 automatically? I thought that is what this code was for? beats/libbeat/common/docker/client.go Lines 54 to 56 in 35a7882
|
Old versions of Docker don't report their version number on ping, so Docker fallbacks to beats/libbeat/common/docker/client.go Line 50 in 35a7882
I wonder if this would work if we just write |
For reference, original code is here: https://github.com/moby/moby/blob/master/client/client.go#L339 |
Manually setting it might 🤞 work based on their env client accepting a version string and this post on stack overflow. |
I double-checked my results to be 100% sure. I can reproduce my observations.
@exekias This is the
I will apply this change, create a new build, and test it soon. Thanks! |
I applied the following patch to beats master, diff --git a/libbeat/common/docker/client.go b/libbeat/common/docker/client.go
index 3470602e2..6e7114360 100644
--- a/libbeat/common/docker/client.go
+++ b/libbeat/common/docker/client.go
@@ -47,7 +47,7 @@ func NewClient(host string, httpClient *http.Client, httpHeaders map[string]stri
// try the latest version before versioning headers existed
if ping.APIVersion == "" {
- ping.APIVersion = "1.24"
+ ping.APIVersion = "1.23"
}
// if server version is lower than the client version, downgrade Running This Auditbeat version also seems to be working after I do Do I need to do more testing (i.e. check if docker metadata extraction is working fine) or is this sanity check enough? |
Thank you for testing that! 🎉 It would be really nice if you could test that's working, you can use I will prepare a patch to use |
I am on it. I think I can just use the file output module instead of the Elasticsearch or Logstash output modules for my testing. |
The Docker metadata extraction seems to be working fine 👍 I was able to see the container image URL and name in the output Auditbeat data. My custom patched build of Auditbeat says,
|
Here is the full output document,
|
that's perfect, thank you so much for doing the testing! Will open a PR soon, targeting |
I opened #7553, just in case you want to give that a try. We will both negotiate to a lower API version (that should be compatible with your deploy) + allow to hardcode the API version using an env variable. |
Introducing API version negotiation (elastic#7165) brough support for new Docker versions, but broke support for versions in EOL. This change puts old API version (1.229 back on the default fallback, plus introduces version hardcoding through `DOCKER_API_VERSION` environment variable. I added some integration tests to check things are working. Fixes elastic#7542
Thanks! I will give that PR a try soon. |
Without this PR (#7553) patch,
After this PR patch,
This confirms that I have the right binary. Auditbeat + Docker metadata extraction is working fine with this PR 👍 |
Introducing API version negotiation (#7165) brough support for new Docker versions, but broke support for versions in EOL. This change puts old API version (1.229 back on the default fallback, plus introduces version hardcoding through `DOCKER_API_VERSION` environment variable. I added some integration tests to check things are working. Fixes #7542
Introducing API version negotiation (elastic#7165) brough support for new Docker versions, but broke support for versions in EOL. This change puts old API version (1.229 back on the default fallback, plus introduces version hardcoding through `DOCKER_API_VERSION` environment variable. I added some integration tests to check things are working. Fixes elastic#7542 (cherry picked from commit 2215d24)
Thank you @kholia for all your input, you made this super easy to fix! |
…rsions (#7567) Introducing API version negotiation (#7165) brough support for new Docker versions, but broke support for versions in EOL. This change puts old API version (1.229 back on the default fallback, plus introduces version hardcoding through `DOCKER_API_VERSION` environment variable. I added some integration tests to check things are working. Fixes #7542 (cherry picked from commit 2215d24)
…cker versions (elastic#7567) Introducing API version negotiation (elastic#7165) brough support for new Docker versions, but broke support for versions in EOL. This change puts old API version (1.229 back on the default fallback, plus introduces version hardcoding through `DOCKER_API_VERSION` environment variable. I added some integration tests to check things are working. Fixes elastic#7542 (cherry picked from commit cecb9a8)
Auditbeat version -> 6.3.1
My auditbeat.yml uses the
add_docker_metadata
processor.Running
auditbeat test config --strict.perms=false -c auditbeat.yml
is giving meExiting: error initializing publisher: error initializing processors: Error response from daemon: client is newer than server (client API version: 1.24, server API version: 1.23)
on this box.I believe that Auditbeat 6.3.1 was deployed on this box when this error message occured. After downgrading Auditbeat to version 6.3.0, things are working fine on this box.
Box details,
This is an Ubuntu 16.04.3 LTS 64-bit box (UPDATED!).
Please let me know if more details are required to reproduce/debug this issue.
The text was updated successfully, but these errors were encountered: