Skip to content

java.lang.NegativeArraySizeException: array size must be positive but was: -1 #157664

Description

@andreidan

Elasticsearch Version

main

Installed Plugins

No response

Java Version

bundled

OS Version

Problem Description

Seen this in an environment.
Unfortunately don't have steps to reproduce but we should be able to tighten things based on the stacktrace:

java.lang.NegativeArraySizeException: array size must be positive but was: -1
	at [email protected]/org.elasticsearch.common.io.stream.StreamInput.throwNegative(StreamInput.java:1504)
	at [email protected]/org.elasticsearch.common.io.stream.StreamInput.readArraySize(StreamInput.java:1494)
	at [email protected]/org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput.readNamedWriteableCollectionAsList(NamedWriteableAwareStreamInput.java:38)
	at org.elasticsearch.xpack.sql.execution.search.CompositeAggCursor.<init>(CompositeAggCursor.java:85)
	at [email protected]/org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput.readNamedWriteable(NamedWriteableAwareStreamInput.java:57)
	at [email protected]/org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput.readNamedWriteable(NamedWriteableAwareStreamInput.java:33)
	at org.elasticsearch.xpack.sql.session.Cursors.internalDecodeFromStringWithZone(Cursors.java:149)
	at org.elasticsearch.xpack.sql.session.Cursors.decodeFromStringWithZone(Cursors.java:122)
	at org.elasticsearch.xpack.sql.plugin.TransportSqlQueryAction.operation(TransportSqlQueryAction.java:223)
	at org.elasticsearch.xpack.sql.plugin.TransportSqlQueryAction.lambda$loggedOperation$0(TransportSqlQueryAction.java:171)
	at [email protected]/org.elasticsearch.common.logging.activity.ActivityLogger.wrapAndRun(ActivityLogger.java:131)
	at org.elasticsearch.xpack.sql.plugin.TransportSqlQueryAction.loggedOperation(TransportSqlQueryAction.java:168)
	at org.elasticsearch.xpack.sql.plugin.TransportSqlQueryAction.doExecute(TransportSqlQueryAction.java:143)
	at org.elasticsearch.xpack.sql.plugin.TransportSqlQueryAction.doExecute(TransportSqlQueryAction.java:71)

Steps to Reproduce

don't have them

Logs (if relevant)

No response

Activity

  1. added
    needs:triageRequires assignment of a team area label
    and removed
    needs:triageRequires assignment of a team area label
    on Aug 25, 2026
  2. elasticsearchmachine commented on Aug 25, 2026

    @elasticsearchmachine
    Collaborator

    Pinging @elastic/es-analytical-engine (Team:Analytics)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Analytics/SQLSQL querying>bugTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions