From c3c983198f4c8c7480c486032ac7a70b267f69da Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Wed, 30 Sep 2020 03:37:45 -0700 Subject: [PATCH] Add temporary fix for issue with interrupted etcd promote This is a minimal fix for https://github.com/rancher/rke2/issues/392 Signed-off-by: Brad Davidson --- pkg/cluster/bootstrap.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/cluster/bootstrap.go b/pkg/cluster/bootstrap.go index dbe7ca1c93..225f10bfc9 100644 --- a/pkg/cluster/bootstrap.go +++ b/pkg/cluster/bootstrap.go @@ -53,6 +53,12 @@ func (c *Cluster) shouldBootstrapLoad(ctx context.Context) (bool, error) { // If the database is initialized we skip bootstrapping; if the user wants to rejoin a // cluster they need to delete the database. logrus.Infof("Managed %s cluster bootstrap already complete and initialized", c.managedDB.EndpointName()) + // This is a workaround for an issue that can be caused by terminating the cluster bootstrap before + // etcd is promoted from learner. Odds are we won't need this info, and we don't want to fail startup + // due to failure to retrieve it as this will break cold cluster restart, so we ignore any errors. + if c.config.JoinURL != "" && c.config.Token != "" { + c.clientAccessInfo, _ = clientaccess.ParseAndValidateTokenForUser(c.config.JoinURL, c.config.Token, "server") + } return false, nil } else if c.config.JoinURL == "" { // Not initialized, not joining - must be initializing (cluster-init)