Arraycopy: last destination index 799 out of bounds for long[792]

  • Neo4j v4.4
  • Browser v5.9.0
  • Neo4j Driver for dotnet v5.9.0

Hello everybody,
Thanks in advance for looking at my question.

When running larger queries which hit a large quantity of relationships I sometimes get the following error:
arraycopy: last destination index 799 out of bounds for long[792]

I am unable to share the entire query, but this is an example:

WITH DISTINCT tender, tenderVersion
WHERE NOT EXISTS { MATCH ()<-[:NUTS_TREE_PRECOMPUTE_HINT]-(tenderVersion) } 
OR EXISTS { MATCH ()<-[rel:NUTS_TREE_PRECOMPUTE_HINT]-(lot) WHERE rel.NutsCode IN ["NL"] }

When this part is introduced within the query and the query is run it thows the "arraycopy: last destination index 799 out of bounds for long[792]" error.

But when it is changed to:

MATCH (tenderVersion)-[rel:NUTS_TREE_PRECOMPUTE_HINT]->()
WHERE rel.NutsCode IN ["NL"]
OR NOT EXISTS {MATCH ()<-[:NUTS_TREE_PRECOMPUTE_HINT]-(tenderVersion)}

What could be possible causes of this error and how could I monitor its cause?

I understand that the question isn't very specific, but if possible I would like to be able to avoid this error in the future.

It looks like you have an array of Long values of length 792, but you are trying to access element 799. Do you have a list in the other part of your query?

The first query seems a little odd. You have a condition for a match that is not related to the variables tender nor tenderVersion.

Can you share more details?