# Master election error after Velero restore

**URL:** <https://discuss.elastic.co/t/master-election-error-after-velero-restore/225906>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Created:** [March 31, 2020, 3:48pm UTC](https://discuss.elastic.co/t/master-election-error-after-velero-restore/225906 "2020-03-31T15:48:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TomaszKlosinski](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tomaszklosinski/32/62717_2.png) [@TomaszKlosinski](https://discuss.elastic.co/u/TomaszKlosinski)\
**Post date:** [March 31, 2020, 3:48pm UTC](https://discuss.elastic.co/t/master-election-error-after-velero-restore/225906/1 "2020-03-31T15:48:00Z")

</div>

Hello,

I've tested backup and restore of ELK stack deployed with Elastic operator and I have problem with restoring Elasticsearch.

I've opened an issue on GitHub as it seems to me it's an ECK bug:

> <https://github.com/elastic/cloud-on-k8s/issues/2792>
>
> Bug Report
> What did you do?
> I've created a schedule with a daily Kubernetes backup in Velero (without Volumes' data). Then I've removed...

In any case, I could also misconfigure something.

Below are the details of the problem:

**What did you do?**  
I've created a schedule with a daily Kubernetes backup in Velero (without Volumes' data). Then I've removed elastic operator, ELK and filebeat for test:

```auto
$ kubectl delete ns elastic-system elk-stack filebeat

```

And then I restored it from the backup:

```auto
$ velero restore create --from-backup kubernetes-daily-20200330000002 --include-namespaces elastic-system,elk-stack,filebeat

```

The restore is successful, but elasticsearch afterwards is not working.

Here're the logs:  
[https://pastebin.com/R8DpUrpH](https://pastebin.com/R8DpUrpH)

It seems to me that this is core of the problem:

```auto
{"type": "server", "timestamp": "2020-03-31T12:52:40,008Z", "level": "WARN", "component": "o.e.c.c.ClusterFormationFailureHelper", "cluster.name": "elk-stack", "node.name": "elk-stack-es-master-green-0", "message": "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and [cluster.initial_master_nodes] is empty on this node: have discovered [{elk-stack-es-master-green-0}{TWEH9Px6TBm92a9dL-mRgg}{pNPr8dRITru5PkbIpXpnew}{10.45.2.132}{10.45.2.132:9300}{lm}{ml.machine_memory=5368709120, xpack.installed=true, zone=GREEN, ml.max_open_jobs=20}, {elk-stack-es-master-eshelter-0}{kAof-xZaQhajOSlukeNXIQ}{Ag0JSqPVShuWBm9NGZG32w}{10.45.3.175}{10.45.3.175:9300}{lm}{ml.machine_memory=5368709120, ml.max_open_jobs=20, xpack.installed=true, zone=ESHELTER}, {elk-stack-es-master-green-1}{qWmtII20SG6UJAl1QANEPQ}{OD1rwvA7TCmQZNvX_gXwcg}{10.45.2.135}{10.45.2.135:9300}{lm}{ml.machine_memory=5368709120, ml.max_open_jobs=20, xpack.installed=true, zone=GREEN}, {elk-stack-es-master-eshelter-1}{wGX7DppyQc2G30WlpuKQAw}{bu3C-bKlTI6c4LgPfXROCw}{10.45.4.207}{10.45.4.207:9300}{lm}{ml.machine_memory=5368709120, ml.max_open_jobs=20, xpack.installed=true, zone=ESHELTER}]; discovery will continue using [127.0.0.1:9300, 127.0.0.1:9301, 127.0.0.1:9302, 127.0.0.1:9303, 127.0.0.1:9304, 127.0.0.1:9305, 10.45.2.135:9300, 10.45.3.175:9300, 10.45.4.207:9300] from hosts providers and [{elk-stack-es-master-green-0}{TWEH9Px6TBm92a9dL-mRgg}{pNPr8dRITru5PkbIpXpnew}{10.45.2.132}{10.45.2.132:9300}{lm}{ml.machine_memory=5368709120, xpack.installed=true, zone=GREEN, ml.max_open_jobs=20}] from last-known cluster state; node term 0, last-accepted version 0 in term 0" }

```

**What did you expect to see?**

Elasticsearch working.

**What did you see instead? Under which circumstances?**

Elasticsearch not working. Errors in logs suggest it can't elect master.

**Environment**

- ECK version:

```auto
	 docker.elastic.co/eck/eck-operator:1.0.0

```

- Kubernetes information:

```auto
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.3", GitCommit:"06ad960bfd03b39c8310aaf92d1e7c12ce618213", GitTreeState:"clean", BuildDate:"2020-02-13T18:08:14Z", GoVersion:"go1.13.8", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"16+", GitVersion:"v1.16.6-beta.0", GitCommit:"e7f962ba86f4ce7033828210ca3556393c377bcc", GitTreeState:"clean", BuildDate:"2020-01-15T08:18:29Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"}

```

---

<div class="post-metadata">

**Author:** ![Anya\_Sabo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anya_sabo/32/49903_2.png) [@Anya\_Sabo](https://discuss.elastic.co/u/Anya_Sabo)\
**Post date:** [March 31, 2020, 10:14pm UTC](https://discuss.elastic.co/t/master-election-error-after-velero-restore/225906/2 "2020-03-31T22:14:43Z")

</div>

This has been answered in the duplicate github issue: [https://github.com/elastic/cloud-on-k8s/issues/2792](https://github.com/elastic/cloud-on-k8s/issues/2792)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 4, 2022, 7:51am UTC](https://discuss.elastic.co/t/master-election-error-after-velero-restore/225906/3 "2022-11-04T07:51:38Z")

</div>


