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

Unable to specify Docker host on Windows using named pipes #4748

Closed
godefroi opened this issue Jul 25, 2017 · 5 comments
Closed

Unable to specify Docker host on Windows using named pipes #4748

godefroi opened this issue Jul 25, 2017 · 5 comments
Labels

Comments

@godefroi
Copy link

I'm using Metricbeat 5.4.2 on Windows Server 2016. I have configured the Docker module as so:

- module: docker
  metricsets:
    - container
  hosts: ["npipe://./pipe/docker_engine"]
  enabled: true
  period: 30s

This configuration passes metricbeat -configtest, but it doesn't actually work. The error message reported in Elasticsearch is this:

Get http://unix.sock/containers/json?: open /pipe/docker_engine: The system cannot find the path specified.

If I use npipe:////./pipe/docker_engine as the host (which matches what I use for Registrator), metricbeat -configtest complains:

PS C:\Program Files\Metricbeat> .\metricbeat.exe -configtest
Exiting: 1 error: host parsing failed for docker-container: error parsing URL: empty host
@exekias exekias added bug Metricbeat Metricbeat labels Jul 25, 2017
@godefroi
Copy link
Author

It looks to me like the Docker module is using fsouza's go-dockerclient, which is the same client used by Registrator. As Registrator works correctly, this looks to me like it is simply an issue in URI validation. Maybe all that is needed is a special case in ParseURL (beats/metricbeat/mb/parse/url.go) where if the URI starts with npipe:// it just returns the raw string?

@exekias
Copy link
Contributor

exekias commented Jul 25, 2017

I've opened #4751, do you have any way to build and test that branch? Unfortunately, I don't have a Windows scenario to test this fix 😇

@godefroi
Copy link
Author

Hm; I built Registrator, it's possible I could work out how to build Metricbeat. Note that it would probably be more correct to use npipe:////./pipe/docker_engine in your tests because that's the URI that go-dockerclient is going to require.

@godefroi
Copy link
Author

I put my comments in the PR. I don't know if my simple test is enough to get your PR merged, but it LGTM.

@exekias
Copy link
Contributor

exekias commented Jul 26, 2017

Thanks for the report @godefroi, this fix should make it to next release! (6.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants