Setting must be non-negative SHARED CACHE SETTINGS PREFIX size – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 7.12-8.9

Before you dig into reading this guide, have you tried asking OpsGPT what this log means? You’ll receive a customized analysis of your log.

Try OpsGPT now for step-by-step guidance and tailored insights into your Elasticsearch operation.

Briefly, this error occurs when the size setting for the shared cache in Elasticsearch is set to a negative value. Elasticsearch requires this value to be non-negative for proper functioning. To resolve this issue, you can adjust the shared cache size setting in your Elasticsearch configuration file (elasticsearch.yml) to a non-negative value. Alternatively, you can use the Elasticsearch API to update this setting dynamically, again ensuring the value is non-negative.

For a complete solution to your to your search operation, try for free AutoOps for Elasticsearch & OpenSearch . With AutoOps and Opster’s proactive support, you don’t have to worry about your search operation – we take charge of it. Get improved performance & stability with less hardware.

This guide will help you check for common problems that cause the log ” setting [{}] must be non-negative”; SHARED_CACHE_SETTINGS_PREFIX + “size ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin.

Log Context

Log “setting [{}] must be non-negative”; SHARED_CACHE_SETTINGS_PREFIX + “size” class name is We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 }  @Override
 public void validate(final RelativeByteSizeValue value; final Map; Object> settings) {
 if (value.isAbsolute() && value.getAbsolute().getBytes() == -1) {
 throw new SettingsException("setting [{}] must be non-negative"; SHARED_CACHE_SETTINGS_PREFIX + "size");
 if (value.isNonZeroSize()) {
 final List roles = (List) settings.get(NodeRoleSettings.NODE_ROLES_SETTING);
 final var rolesSet = Set.copyOf(roles);


How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?