From 642bdd2e302abf4fac18a835b8b64c34f8332ab0 Mon Sep 17 00:00:00 2001 From: Aaron Lehmann Date: Tue, 7 Mar 2017 16:50:39 -0800 Subject: [PATCH] cluster: Proceed with startup if cluster component can't be created The current behavior is for dockerd to fail to start if the swarm component can't be started for some reason. This can be difficult to debug remotely because the daemon won't be running at all, so it's not possible to hit endpoints like /info to see what's going on. It's also very difficult to recover from the situation, since commands like "docker swarm leave" are unavailable. Change the behavior to allow startup to proceed. Signed-off-by: Aaron Lehmann Upstream-commit: f7d846094a5dc642198cc4939df646a3e889a750 Component: engine --- components/engine/daemon/cluster/cluster.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/components/engine/daemon/cluster/cluster.go b/components/engine/daemon/cluster/cluster.go index fe7ac34f86..5c62453435 100644 --- a/components/engine/daemon/cluster/cluster.go +++ b/components/engine/daemon/cluster/cluster.go @@ -39,7 +39,6 @@ package cluster // import ( - "crypto/x509" "fmt" "net" "os" @@ -171,13 +170,8 @@ func New(config Config) (*Cluster, error) { logrus.Error("swarm component could not be started before timeout was reached") case err := <-nr.Ready(): if err != nil { - if errors.Cause(err) == errSwarmLocked { - return c, nil - } - if err, ok := errors.Cause(c.nr.err).(x509.CertificateInvalidError); ok && err.Reason == x509.Expired { - return c, nil - } - return nil, errors.Wrap(err, "swarm component could not be started") + logrus.WithError(err).Error("swarm component could not be started") + return c, nil } } return c, nil