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

Health check issues #6

Closed
gmartinerm opened this issue Apr 3, 2019 · 5 comments
Closed

Health check issues #6

gmartinerm opened this issue Apr 3, 2019 · 5 comments
Assignees

Comments

@gmartinerm
Copy link

Docker container running in OSX

suffix:~ admin$ docker ps
CONTAINER ID        IMAGE                          COMMAND                  CREATED             STATUS                           PORTS                                                                                         NAMES
757b6cb36397        qmcgaw/cloudflare-dns-server   "/bin/sh -c /etc/unb…"   43 hours ago        Up 43 hours (health: starting)   0.0.0.0:5053->53/udp                                                                          cloudflare-suffix
4b2c2b900675        pihole/pihole:latest           "/s6-init"               6 days ago          Up 6 days (healthy)              0.0.0.0:80->80/tcp, 53/tcp, 0.0.0.0:53->53/udp, 0.0.0.0:443->443/tcp, 0.0.0.0:32768->67/udp   pihole
suffix:~ admin$ docker version
Client: Docker Engine - Community
 Version:           18.09.2
 API version:       1.39
 Go version:        go1.10.8
 Git commit:        6247962
 Built:             Sun Feb 10 04:12:39 2019
 OS/Arch:           darwin/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.2
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.6
  Git commit:       6247962
  Built:            Sun Feb 10 04:13:06 2019
  OS/Arch:          linux/amd64
  Experimental:     false
suffix:~ admin$ docker inspect 757b6cb36397
[
    {
        "Id": "757b6cb36397b9d3413987be6ea2c9a6e9f5921a4cd02279fb8a850de8ecdab8",
        "Created": "2019-04-01T19:11:44.225202214Z",
        "Path": "/bin/sh",
        "Args": [
            "-c",
            "/etc/unbound/entrypoint.sh"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 33207,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2019-04-01T19:11:44.967748945Z",
            "FinishedAt": "0001-01-01T00:00:00Z",
            "Health": {
                "Status": "unhealthy",
                "FailingStreak": 0,
                "Log": []
            }
        },
        "Image": "sha256:3abdb3b92fc19d0c0ad835a3e64fac6ed8d19871e035b3aca2254ca15ce2b630",
        "ResolvConfPath": "/var/lib/docker/containers/757b6cb36397b9d3413987be6ea2c9a6e9f5921a4cd02279fb8a850de8ecdab8/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/757b6cb36397b9d3413987be6ea2c9a6e9f5921a4cd02279fb8a850de8ecdab8/hostname",
        "HostsPath": "/var/lib/docker/containers/757b6cb36397b9d3413987be6ea2c9a6e9f5921a4cd02279fb8a850de8ecdab8/hosts",
        "LogPath": "/var/lib/docker/containers/757b6cb36397b9d3413987be6ea2c9a6e9f5921a4cd02279fb8a850de8ecdab8/757b6cb36397b9d3413987be6ea2c9a6e9f5921a4cd02279fb8a850de8ecdab8-json.log",
        "Name": "/cloudflare-suffix",
        "RestartCount": 0,
        "Driver": "overlay2",
        "Platform": "linux",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": null,
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "NetworkMode": "default",
            "PortBindings": {
                "53/udp": [
                    {
                        "HostIp": "",
                        "HostPort": "5053"
                    }
                ]
            },
            "RestartPolicy": {
                "Name": "no",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": null,
            "CapAdd": null,
            "CapDrop": null,
            "Dns": [],
            "DnsOptions": [],
            "DnsSearch": [],
            "ExtraHosts": null,
            "GroupAdd": null,
            "IpcMode": "shareable",
            "Cgroup": "",
            "Links": null,
            "OomScoreAdj": 0,
            "PidMode": "",
            "Privileged": false,
            "PublishAllPorts": false,
            "ReadonlyRootfs": false,
            "SecurityOpt": null,
            "UTSMode": "",
            "UsernsMode": "",
            "ShmSize": 67108864,
            "Runtime": "runc",
            "ConsoleSize": [
                0,
                0
            ],
            "Isolation": "",
            "CpuShares": 0,
            "Memory": 0,
            "NanoCpus": 0,
            "CgroupParent": "",
            "BlkioWeight": 0,
            "BlkioWeightDevice": [],
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": [],
            "DeviceCgroupRules": null,
            "DiskQuota": 0,
            "KernelMemory": 0,
            "MemoryReservation": 0,
            "MemorySwap": 0,
            "MemorySwappiness": null,
            "OomKillDisable": false,
            "PidsLimit": 0,
            "Ulimits": null,
            "CpuCount": 0,
            "CpuPercent": 0,
            "IOMaximumIOps": 0,
            "IOMaximumBandwidth": 0,
            "MaskedPaths": [
                "/proc/asound",
                "/proc/acpi",
                "/proc/kcore",
                "/proc/keys",
                "/proc/latency_stats",
                "/proc/timer_list",
                "/proc/timer_stats",
                "/proc/sched_debug",
                "/proc/scsi",
                "/sys/firmware"
            ],
            "ReadonlyPaths": [
                "/proc/bus",
                "/proc/fs",
                "/proc/irq",
                "/proc/sys",
                "/proc/sysrq-trigger"
            ]
        },
        "GraphDriver": {
            "Data": {
                "LowerDir": "/var/lib/docker/overlay2/1ab19f646797b1fb7c2073bac7aef095adba8c1089174419ad3d8872a5645510-init/diff:/var/lib/docker/overlay2/e646f69de0bcdeb4480c458a031dddc319e5614b2021ea6875dcc7158b85eaf3/diff:/var/lib/docker/overlay2/2dd1ffcbc9102ab9c6db7876076cae261b70cf5d273a1efef39de315c8c461c2/diff:/var/lib/docker/overlay2/3e0214d0cf23a9cc75595651dc17a58be041bc5f462b1fb510cdce7b585e5232/diff:/var/lib/docker/overlay2/1570a4b8101ee5de4051f8321ee64012b4975d429a20f0682b0493a48e1f0322/diff",
                "MergedDir": "/var/lib/docker/overlay2/1ab19f646797b1fb7c2073bac7aef095adba8c1089174419ad3d8872a5645510/merged",
                "UpperDir": "/var/lib/docker/overlay2/1ab19f646797b1fb7c2073bac7aef095adba8c1089174419ad3d8872a5645510/diff",
                "WorkDir": "/var/lib/docker/overlay2/1ab19f646797b1fb7c2073bac7aef095adba8c1089174419ad3d8872a5645510/work"
            },
            "Name": "overlay2"
        },
        "Mounts": [],
        "Config": {
            "Hostname": "757b6cb36397",
            "Domainname": "",
            "User": "root",
            "AttachStdin": false,
            "AttachStdout": true,
            "AttachStderr": true,
            "ExposedPorts": {
                "53/udp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PROVIDER=quad9",
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "VERBOSITY=1",
                "VERBOSITY_DETAILS=0",
                "BLOCK_MALICIOUS=on",
                "LISTENINGPORT=53"
            ],
            "Cmd": null,
            "Healthcheck": {
                "Test": [
                    "CMD-SHELL",
                    "LISTENINGPORT=${LISTENINGPORT:-53}; [ -z $(nslookup duckduckgo.com 127.0.0.1 -port=$LISTENING_PORT -timeout=1 | grep \"no servers could be reached\") ] || exit 1"
                ],
                "Interval": 300000000000,
                "Timeout": 15000000000,
                "StartPeriod": 5000000000,
                "Retries": 1
            },
            "ArgsEscaped": true,
            "Image": "qmcgaw/cloudflare-dns-server",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": [
                "/bin/sh",
                "-c",
                "/etc/unbound/entrypoint.sh"
            ],
            "OnBuild": null,
            "Labels": {
                "cpu-usage": "Low",
                "image-size": "17MB",
                "maintainer": "quentin.mcgaw@gmail.com",
                "org.label-schema.build-date": "2019-03-30T06:24:39Z",
                "org.label-schema.docker.cmd": "docker run -d -p 53:53/udp qmcgaw/cloudflare-dns-server",
                "org.label-schema.docker.cmd.devel": "docker run -it --rm -p 53:53/udp -e VERBOSITY=3 -e VERBOSITY_DETAILS=3 -e BLOCK_MALICIOUS=off qmcgaw/cloudflare-dns-server",
                "org.label-schema.docker.params": "VERBOSITY=from 0 (no log) to 5 (full debug log) and defaults to 1,VERBOSITY_DETAILS=0 to 4 and defaults to 0 (higher means more details),BLOCK_MALICIOUS='on' or 'off' and defaults to 'on' (note that it consumes about 50MB of additional RAM),LISTENING_PORT=1 to 65535 for internal Unbound listening port,PROVIDER=CLOUDFLARE or GOOGLE or QUAD9 or QUADRANT or CLEANBROWSING",
                "org.label-schema.schema-version": "1.0.0-rc1",
                "org.label-schema.url": "https://github.com/qdm12/cloudflare-dns-server",
                "org.label-schema.vcs-description": "Runs a local DNS server connected to Cloudflare DNS server 1.1.1.1 over TLS (and more)",
                "org.label-schema.vcs-ref": "98fc026",
                "org.label-schema.vcs-url": "https://github.com/qdm12/cloudflare-dns-server",
                "org.label-schema.vcs-usage": "https://github.com/qdm12/cloudflare-dns-server/blob/master/README.md#setup",
                "ram-usage": "13.2MB to 70MB"
            }
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "27064633baca78f8a84ce3aeb8ac11e6be2590c1d97714e298eff588168f1a94",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {
                "53/udp": [
                    {
                        "HostIp": "0.0.0.0",
                        "HostPort": "5053"
                    }
                ]
            },
            "SandboxKey": "/var/run/docker/netns/27064633baca",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "eab6194dd92f99eef1259b5c969dd285135d05b238cd62176045906c76f9af0b",
            "Gateway": "172.17.0.1",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "172.17.0.3",
            "IPPrefixLen": 16,
            "IPv6Gateway": "",
            "MacAddress": "02:42:ac:11:00:03",
            "Networks": {
                "bridge": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "59cdd7d69340b2139e39e809bcbb212ffeb5555b3bbc71e7c572d6a20564ad3c",
                    "EndpointID": "eab6194dd92f99eef1259b5c969dd285135d05b238cd62176045906c76f9af0b",
                    "Gateway": "172.17.0.1",
                    "IPAddress": "172.17.0.3",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:ac:11:00:03",
                    "DriverOpts": null
                }
            }
        }
    }
]
suffix:~ admin$

Here is the status of this container

suffix:~ admin$ docker ps
CONTAINER ID        IMAGE                          COMMAND                  CREATED             STATUS                           PORTS                                                                                         NAMES
757b6cb36397        qmcgaw/cloudflare-dns-server   "/bin/sh -c /etc/unb…"   43 hours ago        Up 43 hours (health: starting)   0.0.0.0:5053->53/udp                                                                          cloudflare-suffix
4b2c2b900675        pihole/pihole:latest           "/s6-init"               6 days ago          Up 6 days (healthy)              0.0.0.0:80->80/tcp, 53/tcp, 0.0.0.0:53->53/udp, 0.0.0.0:443->443/tcp, 0.0.0.0:32768->67/udp   pihole
suffix:~ admin$

The container works but I am getting this health starting for 43 hours now. Happy to share how my two piholes interact with each other if that is necessary

@qdm12
Copy link
Owner

qdm12 commented Apr 3, 2019

Can you try the following command?

suffix:~admin$ docker exec cloudflare-suffix nslookup duckduckgo.com 127.0.0.1 -port=53 -timeout=1

The output should be

Server:         127.0.0.1
Address:        127.0.0.1#53

Non-authoritative answer:
Name:   duckduckgo.com
Address: 79.125.105.113
Name:   duckduckgo.com
Address: 176.34.155.23
Name:   duckduckgo.com
Address: 46.51.179.90

Let me know if you obtain something different. Thanks

EDIT: Also do you still have to run the Docker container as root? You should not have to normally

@gmartinerm
Copy link
Author

Here is the answer

suffix:~ admin$ docker exec cloudflare-suffix nslookup duckduckgo.com 127.0.0.1 -port=53 -timeout=1
Server:         127.0.0.1
Address:        127.0.0.1#53

Non-authoritative answer:
Name:   duckduckgo.com
Address: 184.72.104.138
Name:   duckduckgo.com
Address: 23.21.193.169
Name:   duckduckgo.com
Address: 107.20.240.232

suffix:~ admin$

@qdm12
Copy link
Owner

qdm12 commented Apr 3, 2019

Ok so the healthcheck should work, that's what the healthcheck is basically. It just tries to resolve duckduckgo.com. Try restarting the container maybe?

docker restart cloudflare-suffix
docker ps | grep cloudflare-suffix

@gmartinerm
Copy link
Author

done. I will wait few minutes or even few hours and then I will post an update

suffix:~ admin$ docker restart cloudflare-suffix
cloudflare-suffix
suffix:~ admin$ docker ps | grep cloudflare-suffix
757b6cb36397        qmcgaw/cloudflare-dns-server   "/bin/sh -c /etc/unb…"   46 hours ago        Up 7 seconds (health: starting)   0.0.0.0:5053->53/udp                                                                          cloudflare-suffix

@qdm12 qdm12 self-assigned this Apr 3, 2019
@gmartinerm
Copy link
Author

Seems to be better now

suffix:~ admin$ docker ps | grep cloudflare-suffix
757b6cb36397        qmcgaw/cloudflare-dns-server   "/bin/sh -c /etc/unb…"   47 hours ago        Up 44 minutes (healthy)   0.0.0.0:5053->53/udp                                                                          cloudflare-suffix
suffix:~ admin$

I think you can close this issue for now. Happy to help if ever need anything tested on my mac

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

2 participants