Cannot update deprecated index setting mapping.source

Upon upgrading elasticsearch 8.17 a number of my indices have gone red.
This is because they have the setting

index.mapping.source.mode: "STORED"

I have seen that this setting is now a premium feature as described here Elastic 8.17 and _source

However i am unable to modify (or remove) this setting. (on either open or closed indices)

Is there any solution to this?

synthetic source is the new premium feature for 8.17+, there's another thread ongoing about it's impact on storage requirements.

You have written "gone red ... because they have this settling".

Can you elaborate why you believe that is the case? red can be caused by lots of things. Can you share output of

GET _cluster/health

I reported the issue because of the output of

GET _cluster/allocation/explain

{
  "index": "xxxxx",
  "shard": 0,
  "primary": true,
  "current_state": "unassigned",
  "unassigned_info": {
    "reason": "ALLOCATION_FAILED",
    "at": "2025-02-17T11:13:49.958Z",
    "failed_allocation_attempts": 5,
    "details": """failed shard on node [dxvvKFmNSGWdpkPA6UKKTg]: failed to create index, failure java.lang.IllegalArgumentException: unknown setting [index.mapping.source.mode] did you mean [index.mapping.coerce]?
	at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:563)
	at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:509)
	at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:479)
	at org.elasticsearch.indices.IndicesService.createIndexService(IndicesService.java:732)
	at org.elasticsearch.indices.IndicesService.createIndex(IndicesService.java:649)
	at org.elasticsearch.indices.IndicesService.createIndex(IndicesService.java:187)
	at org.elasticsearch.indices.cluster.IndicesClusterStateService.createIndicesAndUpdateShards(IndicesClusterStateService.java:581)

However the issue has now been resolved. It turns out that the cluster upgrade had not been completed, so the issue had been caused by having a mixture of 8.17 and 8.16 nodes. As soon as all the nodes had upgraded, the problem resolved itself, and the cluster is green again. Thanks anyway for your response.

Yes, indeed, as expected the issue was not the setting itself, it was the cluster upgrade was not correctly completed - the node trying to read the config likely had the old version and therefore was unable to allocate the shard.

By the way, if this was not a process error on your part (no idea if it was) then it would IMHO be a bug, There will be periods where nodes are on different versions, this is as expected. But a problem should not occur if you followed the upgrade process correctly.