Neo4j: Planner was unable to find a plan within the constraints provided

Created on 8 May 2020  路  5Comments  路  Source: neo4j/neo4j

Initially reported in #12434 as a way to report an error in doc, but after more diligence (and clarifying from neo4j team), it may be indeed a bug.

I am getting this error immediately after I try to run a cypher query:

Neo.DatabaseError.General.UnknownError

Neo4jError: Unfortunately, the planner was unable to find a plan within the constraints provided.
Try increasing the config values unsupported.cypher.idp_solver_table_threshold
and unsupported.cypher.idp_solver_duration_threshold to allow
for a larger sub-plan table and longer planning time.

Since the error only happens when we have some data I was able to reproduce it by adding some sample data, which is not directly related to the cypher query itself.

Step 1 - Create and use a blank database

:use system
CREATE DATABASE test
:use test

Step 2 - Initialize it with some data

:play northwind-graph

Execute all the steps of the demo dataset

Step 3 - Initialize cypher paramters

:params {"createdBy":"79224171-10e7-4162-a062-bded2c200572","polyglotID":"29754318-1faf-4189-8983-fc3d32608785","created":1588752876836,"modified":1588752876836,"labels":[{"createdBy":"","polyglotID":"29754318-1faf-4189-8983-fc3d32608785","created":1588752876836,"modified":1588752876836,"name":"test","properties":{"test":"number"}},{"createdBy":"","polyglotID":"29754318-1faf-4189-8983-fc3d32608785","created":1588752876836,"modified":1588752876836,"name":"test1","properties":{"ID":"string","test":"number"}},{"createdBy":"","polyglotID":"29754318-1faf-4189-8983-fc3d32608785","created":1588752876837,"modified":1588752876837,"name":"test2","properties":{"ID":"string","test":"number"}}],"labelNames":["test","test1","test2"],"name":"Test Model","identifierProperty":"test","modelItems":[{"createdBy":"79224171-10e7-4162-a062-bded2c200572","polyglotID":"7152d100-e764-425a-8ce2-31b9db30a7d5","created":1588752876836,"modified":1588752876836,"labels":[{"createdBy":"","polyglotID":"7152d100-e764-425a-8ce2-31b9db30a7d5","created":1588752876836,"modified":1588752876836,"name":"test1","properties":{"ID":"string","system":"number"}}],"labelNames":["test1"],"name":"test1","identifierProperty":"ID","parentPolyglotId":"29754318-1faf-4189-8983-fc3d32608785"},{"createdBy":"79224171-10e7-4162-a062-bded2c200572","polyglotID":"1267e9b3-cd46-488a-ba67-683915df13b1","created":1588752876837,"modified":1588752876837,"labels":[{"createdBy":"","polyglotID":"1267e9b3-cd46-488a-ba67-683915df13b1","created":1588752876837,"modified":1588752876837,"name":"test2","properties":{"ID":"string","system":"number"}}],"labelNames":["test2"],"name":"test2","identifierProperty":"ID","parentPolyglotId":"29754318-1faf-4189-8983-fc3d32608785"}],"relationships":{"connects":[{"polyglotID":"29754318-1faf-4189-8983-fc3d32608785","created":1588752876837,"modified":1588752876837,"alias":"test1connectstest2","from":"test1","fromIdentifier":"sourceid","to":"test2","toIdentifier":"toid","properties":{"identity":"string"},"identifierProperty":"identity"},{"polyglotID":"29754318-1faf-4189-8983-fc3d32608785","created":1588752876837,"modified":1588752876837,"alias":"test2connectstest1","from":"test2","fromIdentifier":"sourceid","to":"test1","toIdentifier":"toid","properties":{"identity":"string"},"identifierProperty":"identity"}]}}

Step 4 - Execute the query to get the planner error

MATCH (m:Elements:Creation:Model{polyglotID:$polyglotID})
WITH *
UNWIND keys($relationships) as relationType UNWIND $relationships[relationType] as relation MATCH (a:Elements:`799cc536-3180-47f7-9bab-b154f3ab2204`:Artefact:ModelItem{name:relation.from})
<-[:contains]-(m) MATCH (b:Elements:`799cc536-3180-47f7-9bab-b154f3ab2204`:Artefact:ModelItem{name:relation.to})
<-[:contains]-(m) CALL apoc.merge.relationship(a, relationType, NULL, {alias: relation.alias, identifierProperty: relation.identifierProperty, fromIdentifier: relation.fromIdentifier, toIdentifier: relation.toIdentifier}, b) YIELD rel
RETURN *

Neo Specs

Neo4j version: 4.0.4 enterprise
Operating system: Original neo4j docker image
API/Driver: Neo4j browser

bug team-cypher

All 5 comments

I started getting this in our app (built on aura) after I added an index. I deleted the index for now. Let me know if another example would be useful.

Thanks, for the report. We're investigating and should have a fix soon.

Any update @mnd999?

Yes, I think we have a fix in 5db461f. This should be included in the next set of patch releases.

I tested with neo4j v4.0.5 and apoc 4.0.0.12 and it seems to have fixed the issue, at least for this scenario and repro steps.

Was this page helpful?
0 / 5 - 0 ratings