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

logging is broken #4

Closed
seriousben opened this issue Aug 11, 2017 · 5 comments
Closed

logging is broken #4

seriousben opened this issue Aug 11, 2017 · 5 comments

Comments

@seriousben
Copy link

haproxy-systemd-wrapper: executing /usr/local/sbin/haproxy -p /run/haproxy.pid -f /usr/local/etc/haproxy/haproxy.cfg -Ds
[WARNING] 222/173808 (6) : Can't open server state file '/var/lib/haproxy/server-state': No such file or directory
[ALERT] 222/173808 (6) : sendmsg logger #1 failed: No such file or directory (errno=2)
[ALERT] 222/173808 (6) : sendmsg logger #1 failed: No such file or directory (errno=2)
@pedrobaeza
Copy link
Member

My colleague @yajo, who is on charge of this, is on holidays next week, but he will look to this when he returns.

@ghost
Copy link

ghost commented Aug 16, 2017

This is an issue with the parent haproxy docker image. dockerfile/haproxy#3

@ghost
Copy link

ghost commented Aug 18, 2017

It looks like adding the volume mount of -v /dev/log:/dev/log will allow logs to be shown in the hosts logs:

$ docker container run \
    -d --privileged \
    --name dockerproxy \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v /dev/log:/dev/log \
    -p 127.0.0.1:2375:2375 \
    tecnativa/docker-socket-proxy
sudo journalctl -f -l SYSLOG_IDENTIFIER=haproxy

Aug 18 16:03:32 localhost.local haproxy[29475]: Proxy dockerbackend started.
Aug 18 16:03:32 localhost.local haproxy[29475]: Proxy dockerfrontend started.
Aug 18 16:03:50 localhost.local haproxy[29479]: 172.17.0.1:37478 [18/Aug/2017:06:03:50.040] dockerfrontend dockerfrontend/<NOSRV> 0/-1/-1/-1/0 403 189 - - PR-- 0/0/0/0/0 0/0 "GET /v1.24/containers/json HTTP/1.1"

While this doesn't fit the standard of logging to stdout for consumption of docker logs it is something. I think to have logging to stdout it would likely require further work to add rsyslog and then something to pipe to stdout from there, or possibly a further customised systemd wrapper - both of which may be best dealt with by not using the haproxy base image.

@yajo
Copy link
Contributor

yajo commented Aug 21, 2017

Actually I proposed a fix, but it has some problems and got stalled: docker-library/haproxy#39

Possibly I should update that PR and make it entrypoint with https://github.com/Yelp/dumb-init

@joao-p-marques
Copy link
Contributor

I think this is fixed now thanks to docker-library/haproxy#39 (comment), right?
We still get

[WARNING] 302/115227 (1) : Can't open server state file '/var/lib/haproxy/server-state': No such file or directory

but logging to stdout seems to be working.

Closing this, but if the problem persists, fell free to reopen.

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

4 participants