Skip to content

Router liveness probe failures #1504

Closed
Closed

Description

@brenton

I hate filing issues like this (ie we don't yet know exactly how to reproduce the problem) but @sosiouxme, @sdodson, @thoraxe and I have hit an edge case where the router liveness check will fail which results in a tight loop of "destroy the router / launch the router".

Right now we mostly want to raise awareness of this problem to see if anyone is hitting it upstream. The code we're testing with is rarely ever more than a half a day old or so. I'm fairly certain we're dealing with an odd edge case. Any advice for debugging the problem the next time we see it would be appreciated. For starters:

  • How is the default router port 80 tcp liveness probe run? Does it run from the Master or the Node?
  • What ip does it hit? (I'm assuming it's using the published endpoints but I'm not sure where it's being run from).

Activity

  1. brenton commented on Mar 30, 2015

    @brenton
    ContributorAuthor

    After working for almost an hour my router just went in to the liveness probe failure loop. After several minutes of looping it came back.

  2. sdodson commented on Mar 30, 2015

    @sdodson
    Member

    I put in a bit of instrumentation.

    glog.V(3).Infof("TCPSocket Probe PodIP: %s, Port: %s, Timeout: %s", status.PodIP, port, timeout)
    

    And this is what I get

    Mar 30 16:26:37 ose3-master.example.com openshift[1343]: I0330 16:26:37.874785    1343 kubelet.go:1224] Found infra pod for "router-1-u4dra_default"
    Mar 30 16:26:37 ose3-master.example.com openshift[1343]: I0330 16:26:37.874810    1343 kubelet.go:2059] Returning cached status for "router-1-u4dra_default"
    Mar 30 16:26:37 ose3-master.example.com openshift[1343]: I0330 16:26:37.874976    1343 kubelet.go:1239] pod "router-1-u4dra_default" container "router" exists as 98a40eac5adb339520993d42fbeb998356571cea8fcc9646b2c28af28603f7a0
    Mar 30 16:26:37 ose3-master.example.com openshift[1343]: I0330 16:26:37.875017    1343 probe.go:133] TCPSocket Probe PodIP: 10.1.0.2, Port: %!s(int=80), Timeout: 1s
    Mar 30 16:26:37 ose3-master.example.com openshift[1343]: I0330 16:26:37.875400    1343 probe.go:133] TCPSocket Probe PodIP: 10.1.0.2, Port: %!s(int=80), Timeout: 1s
    Mar 30 16:26:37 ose3-master.example.com openshift[1343]: I0330 16:26:37.876031    1343 probe.go:133] TCPSocket Probe PodIP: 10.1.0.2, Port: %!s(int=80), Timeout: 1s
    Mar 30 16:26:37 ose3-master.example.com openshift[1343]: I0330 16:26:37.876202    1343 probe.go:51] Liveness probe unsuccessful: failure
    Mar 30 16:26:37 ose3-master.example.com openshift[1343]: I0330 16:26:37.876251    1343 kubelet.go:1257] pod "router-1-u4dra_default" container "router" is unhealthy (probe result: failure). Container will be killed and re-created.
    
  3. smarterclayton commented on Mar 31, 2015

    @smarterclayton
    Contributor

    Probes are always run from the node. I would increase the timeout.

  4. sdodson commented on Apr 1, 2015

    @sdodson
    Member

    I don't think the timeout is relevant here as it's not waiting a second for the socket, it fires off the three checks in just 1ms based on the output above so the port must be closed. There doesn't seem to be any sleep time between checks which is probably a problem too but I think something else is going on here. Yesterday we tried setting initialDelaySeconds=10 and, at least in my testing, this did not improve the situation.

    @pweil- relevant to your interests

  5. smarterclayton commented on Apr 2, 2015

    @smarterclayton
    Contributor

    What's really interesting is I can think of no good reason for that check to fail. The router should be reusing sockets, which means this is a true failure of the router somewhere. Three checks right after each other also sound wrong but we'll need to run that down upstream.

    On Apr 1, 2015, at 10:49 AM, Scott Dodson [email protected] wrote:

    I don't think the timeout is relevant here as it's not waiting a second for the socket, it fires off the three checks in just 1ms based on the output above so the port must be closed. There doesn't seem to be any sleep time between checks which is probably a problem too but I think something else is going on here. Yesterday we tried setting initialDelaySeconds=10 and, at least in my testing, this did not improve the situation.

    @pweil- relevant to your interests

    —
    Reply to this email directly or view it on GitHub.

  6. jimmidyson commented on Apr 2, 2015

    @jimmidyson
    Contributor

    I'm seeing this on a clean 0.4.2 install. Anything I can add to help diagnose?

  7. pweil- commented on Apr 2, 2015

    @pweil-

    The last significant change to the router was the reaper which is started by the command. I don't think it is the cause but to rule it out, if you can reproduce this can you try commenting out https://github.com/openshift/origin/blob/master/pkg/cmd/infra/router/router.go#L86 and see what happens?

  8. jimmidyson commented on Apr 2, 2015

    @jimmidyson
    Contributor

    @pweil- no that didn't help... updated code, rebuilt image, copied over to server having the problem & still couldn't start router.

    This works fine on my laptop, just not on the cleanly built server I'm running.

    Any more ideas?

  9. pweil- commented on Apr 2, 2015

    @pweil-

    Anything at all in the router logs? I don't think the verbose logging is on by default in the image, you may want to add --loglevel=4 to the image you rebuilt to see if it gives any more clues.

    One other thing that may be worth trying is to create the container, allow it to start coming up and then kill openshift to see if you can diagnose the issue before k8s starts killing and restarting things.

    Or creating the container manually to see if there are any issues. The easiest way to do that is to get the env that the ex router command would use and plop it into a plain old pod definition. So openshift ex router --create -o json --credentials="$KUBECONFIG", copy and paste into https://gist.github.com/pweil-/3bd200f9ad17e77543df and osc create -f <your file>. That will bring a router up without the probe so you can check it out

  10. jimmidyson commented on Apr 2, 2015

    @jimmidyson
    Contributor

    Now I've gone back to it the router seems to have started now & running fine... there are about 350 terminated containers before this one started successfully though!

  11. jimmidyson commented on Apr 2, 2015

    @jimmidyson
    Contributor

    Even with loglevel 4 the container terminates with no log output

  12. pweil- commented on Apr 2, 2015

    @pweil-

    hrm, well that is frustrating :-\

  13. jimmidyson commented on Apr 2, 2015

    @jimmidyson
    Contributor

    Thing is that the container that started did so with same image as those 350 previous failures so must be something timing wise

  14. pweil- commented on Apr 2, 2015

    @pweil-

    My next debugging step would be to eliminate the probe from the ex command in case there is a bug there somewhere. If the router is really the issue it shouldn't come back up magically unless there is an issue with how config is loaded that works on the 350th try (unless you took a different action in between 349 & 350 like making a service or route)

  15. jimmidyson commented on Apr 2, 2015

    @jimmidyson
    Contributor

    Wondering if the health check which is think just tcp connects port 80 is just happening too quickly while container is coming up?

    OK I'll get rid of health check & see if it works.

  16. 2 remaining items

  17. jimmidyson commented on Apr 2, 2015

    @jimmidyson
    Contributor

    @pweil- interestingly the output from -o json doesn't work with create -f - missing kind for one thing. In fact no kind on any objects...

  18. jimmidyson commented on Apr 2, 2015

    @jimmidyson
    Contributor

    This is the output from openshift ex router --create --credentials=openshift.local.certificates/openshift-router/.kubeconfig -o json:

    {
      "metadata": {},
      "items": [
        {
          "metadata": {
            "name": "router",
            "creationTimestamp": null,
            "labels": {
              "router": "router"
            }
          },
          "spec": {
            "port": 80,
            "selector": {
              "router": "router"
            },
            "containerPort": 80
          },
          "status": {}
        },
        {
          "metadata": {
            "name": "router",
            "creationTimestamp": null,
            "labels": {
              "router": "router"
            }
          },
          "triggers": [
            {
              "type": "ConfigChange"
            }
          ],
          "template": {
            "strategy": {
              "type": "Recreate"
            },
            "controllerTemplate": {
              "replicas": 1,
              "selector": {
                "router": "router"
              },
              "template": {
                "metadata": {
                  "creationTimestamp": null,
                  "labels": {
                    "router": "router"
                  }
                },
                "spec": {
                  "volumes": null,
                  "containers": [
                    {
                      "name": "router",
                      "image": "openshift/origin-haproxy-router:v0.4.2",
                      "ports": [
                        {
                          "hostPort": 80,
                          "containerPort": 80
                        },
                        {
                          "hostPort": 443,
                          "containerPort": 443
                        }
                      ],
                      "env": [
                        {
                          "name": "OPENSHIFT_CA_DATA",
                          "value": "-----BEGIN CERTIFICATE-----<SNIP>\n-----END CERTIFICATE-----\n"
                        },
                        {
                          "name": "OPENSHIFT_CERT_DATA",
                          "value": "-----BEGIN CERTIFICATE-----<SNIP>=\n-----END CERTIFICATE-----\n"
                        },
                        {
                          "name": "OPENSHIFT_INSECURE",
                          "value": "false"
                        },
                        {
                          "name": "OPENSHIFT_KEY_DATA",
                          "value": "-----BEGIN RSA PRIVATE KEY-----<SNIP>\n-----END RSA PRIVATE KEY-----\n"
                        },
                        {
                          "name": "OPENSHIFT_MASTER",
                          "value": "https://172.18.25.34:8443"
                        }
                      ],
                      "resources": {},
                      "livenessProbe": {
                        "tcpSocket": {
                          "port": 80
                        }
                      },
                      "imagePullPolicy": "",
                      "capabilities": {}
                    }
                  ]
                }
              }
            }
          }
        }
      ]
    }
    
  19. jimmidyson commented on Apr 2, 2015

    @jimmidyson
    Contributor

    @pweil- Adding the kinds in to the output JSON & removing the livenessProbe all works fine so I'd say it's something wrong with livenessProbes being over eager. Adding in a initialDelaySeconds to the descriptor should do it.

  20. smarterclayton commented on Apr 2, 2015

    @smarterclayton
    Contributor

    That means the output is not versioned which means it not even an api version. This likely broke in the last rebase, or was never right in the first place.

    The root object has to be converted to a version before any output.

    On Apr 2, 2015, at 11:44 AM, Jimmi Dyson [email protected] wrote:

    This is the output from openshift ex router --create --credentials=openshift.local.certificates/openshift-router/.kubeconfig -o json:

    {
    "metadata": {},
    "items": [
    {
    "metadata": {
    "name": "router",
    "creationTimestamp": null,
    "labels": {
    "router": "router"
    }
    },
    "spec": {
    "port": 80,
    "selector": {
    "router": "router"
    },
    "containerPort": 80
    },
    "status": {}
    },
    {
    "metadata": {
    "name": "router",
    "creationTimestamp": null,
    "labels": {
    "router": "router"
    }
    },
    "triggers": [
    {
    "type": "ConfigChange"
    }
    ],
    "template": {
    "strategy": {
    "type": "Recreate"
    },
    "controllerTemplate": {
    "replicas": 1,
    "selector": {
    "router": "router"
    },
    "template": {
    "metadata": {
    "creationTimestamp": null,
    "labels": {
    "router": "router"
    }
    },
    "spec": {
    "volumes": null,
    "containers": [
    {
    "name": "router",
    "image": "openshift/origin-haproxy-router:v0.4.2",
    "ports": [
    {
    "hostPort": 80,
    "containerPort": 80
    },
    {
    "hostPort": 443,
    "containerPort": 443
    }
    ],
    "env": [
    {
    "name": "OPENSHIFT_CA_DATA",
    "value": "-----BEGIN CERTIFICATE-----\nMIIC5jCCAdCgAwIBAgIBATALBgkqhkiG9w0BAQswJjEkMCIGA1UEAwwbb3BlbnNo\naWZ0LXNpZ25lckAxNDI3OTgzMDk1MB4XDTE1MDQwMjEzNTgxNloXDTE2MDQwMTEz\nNTgxN1owJjEkMCIGA1UEAwwbb3BlbnNoaWZ0LXNpZ25lckAxNDI3OTgzMDk1MIIB\nIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApAL0MN/7oSJRVtuRoeFF9KH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c2hpZnQtcm91dGVyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC\nAQEAucn/itx9/AQUIK6SLzWEfW+B6f0vRRR9sbdzhswQjbb1ggH4fdbwwsIz+9M1\ni6YL33fCCAKgeUhppqWQ7VU/gEnuMsktCOyFo9odxmf3/AiZhf0wMtszE0JS44yH\n8QH3O3f89UFYUJllI1YocJp8IvicJ0upUpZi6m1uduKE5iJdAhzMWQQIQEZ2L5s1\nPd8lTfjFogZgiU7/L2vfDX4isuLr+t4x1S9zon6sz2OGSsOyFx+4nyTNWYhgeSS3\nZro1WP7lcVCObEAh160bTUYQ35RzQNilk3e2L4f/VZNpyWkZg5d5zIQXcJj243mb\nPUxH4lUQfJy8ggzvqHM68DrexQIDAQABozUwMzAOBgNVHQ8BAf8EBAMCAKAwEwYD\nVR0lBAwwCgYIKwYBBQUHAwIwDAYDVR0TAQH/BAIwADALBgkqhkiG9w0BAQsDggEB\nACYFyolTPuw86hEslt+YAORbMJrMOvdYdpfCQiedKJRvSoJ5FjqJmp4Y4r4ZWZMZ\n24nOIoRQO0FeVZVvq1X2tLChvjQFVJtpCV4Vbgy4wdgcsPl8Aox9kkcvmYFZO8KI\nSEIuAiRNT1CLMVJ01zbqt55c8NtVjBp6n0aZuJpd3d2yZLCxL122SnEfXhPe5pvq\n0tkk+
    SQENm9E6
    gVhAVI80JmVOReuKF5oRn3MWmBpLEsA0eE73TotQ+6UO2/FT2CV\nVkmZsl5Wsc0KuMGTll3u9Pcv9DsttTkn1OJbIF6Tc5FGB1/ZMmh0fyWrxjAL8qa4\nUujyrbM7c2ki6rdJK2j7o+c=\n-----END CERTIFICATE-----\n"
    },
    {
    "name": "OPENSHIFT_INSECURE",
    "value": "false"
    },
    {
    "name": "OPENSHIFT_KEY_DATA",
    "value": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEAucn/itx9/AQUIK6SLzWEfW+B6f0vRRR9sbdzhswQjbb1ggH4\nfdbwwsIz+9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vJyPBZZYFH26Kfk5/YGflYR/tUyyJ\nUbbIiREgEeIdJH7fWbTgv+RKwUa64W6nsuWXbQuoQs/ePGIFPR6/v8DmeLv6XeOB\nHJpdXY3UJtTY7ntWU5nUrAECgYAzh6ylG0lvOG7AqaWj3G/z7/iWUUJbkzHFubfo\nmz+Mb54ZvRvB0FsTRtSXPnRzYckdk3RpAJYP9GNSUUnHggS7UJlt1zX6TsSQxkwI\n0HG5IDtq8tNW/bK3Ygpd7ZUbRdlUU9qd5xPSPBvJ5r76LGBxuNxlLzGI96NcnZyZ\n7GSjnQKBgQDAXx8dQKlrMJP3Yr9ropuzjhdxvXlrrkHNJCuLu08OVwcLrcIbqXRT\n6xAk5kiI/k1mAkWIbAoScmUM3GFH/PqIXKtdmthCpghCHPR0Z8YC+uivCIhNEWYl\nIi2wbgQzDSS+v94CcdX8Oow+ek+ec5aGHa/Z1ydDvjATSXdY08ALCA==\n-----END RSA PRIVATE KEY-----\n"
    },
    {
    "name": "OPENSHIFT_MASTER",
    "value": "https://172.18.25.34:8443"
    }
    ],
    "resources": {},
    "livenessProbe": {
    "tcpSocket": {
    "port": 80
    }
    },
    "imagePullPolicy": "",
    "capabilities": {}
    }
    ]
    }
    }
    }
    }
    }
    ]
    }
    —
    Reply to this email directly or view it on GitHub.

  21. jimmidyson commented on Apr 2, 2015

    @jimmidyson
    Contributor

    @smarterclayton - this is obviously pretty critical functionality for anything that you want to expose externally. Would really appreciate this being looked at ASAP. This & #1469 are our top 2 issues right now.

  22. added
    kind/bug
    on May 11, 2015
  23. pweil- commented on May 12, 2015

    @pweil-

    @brenton - is this ready to be closed?

  24. brenton commented on May 12, 2015

    @brenton
    ContributorAuthor

    Yeah.

  25. smarterclayton commented on May 12, 2015

    @smarterclayton
    Contributor

    We still need to reintroduce the probe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

component/routingkind/bugpriority/P2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions