Opster Team
Before you begin reading this guide, we recommend you try running the Elasticsearch Error Check-Up which analyzes 2 JSON files to detect many configuration errors.
To easily locate the root cause and resolve this issue try AutoOps for Elasticsearch & OpenSearch. It diagnoses problems by analyzing hundreds of metrics collected by a lightweight agent and offers guidance for resolving them.
Take a self-guided product tour to see for yourself (no registration required).
This guide will help you check for common problems that cause the log ” cannot modify setting ” + k + ” on restore ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: restore.

Overview
In Elasticsearch, restore refers to the snapshot restore mechanism, which returns indices or clusters to a previous, saved state. You can restore the entire cluster from the snapshot or restore an individual index or selected indices.
Examples
To restore the whole snapshot:
POST /_snapshot/my_backup/snapshot-01-11-2019/_restore
To restore an individual index:
POST /_snapshot/my_backup/snapshot-01-11-2019/_restore { "indices": "my_index" }
Notes
- If you are using a security tool like Searchguard, the snapshot restore capability must be enabled in elasticsearch.yml. Otherwise, it will throw a security exception.
Common issues
- If an index or indices already exist with the same names as those you are going to restore, they need to either be closed or deleted before you can restore from a snapshot. Otherwise, the restore operation will fail due to an error that the index already exists.
Log Context
Log “cannot modify setting [” + k + “] on restore”classname is RestoreService.java We extracted the following from Elasticsearch source code for those seeking an in-depth context :
} } return true; })).put(normalizedChangeSettings.filter(k -> { if (UNMODIFIABLE_SETTINGS.contains(k)) { throw new SnapshotRestoreException(snapshot; "cannot modify setting [" + k + "] on restore"); } else { return true; } })); settingsBuilder.remove(MetadataIndexStateService.VERIFIED_BEFORE_CLOSE_SETTING.getKey());
Find & fix Elasticsearch problems
Opster AutoOps diagnoses & fixes issues in Elasticsearch based on analyzing hundreds of metrics.
Fix Your Cluster IssuesConnect in under 2 minutes
Arpit Ghiya
Senior Lead SRE at Coupa