apoc icon indicating copy to clipboard operation
apoc copied to clipboard

apoc.path.combine(path,path1) as paths throws Can't coerce `NO_VALUE` to Path error in linux

Open neo-technology-build-agent opened this issue 2 years ago • 10 comments

Issue by shahadp Tuesday Feb 25, 2020 at 19:57 GMT Originally opened as https://github.com/neo4j-contrib/neo4j-apoc-procedures/issues/1427


Guidelines

Please note that GitHub issues are only meant for bug reports/feature requests. If you have questions on how to use APOC, please ask on the Neo4j Discussion Forum instead of creating an issue here.

Expected Behavior (Mandatory)

apoc.convert.toTree(paths) return valid json response.

Actual Behavior (Mandatory)

Returns error. Neo.ClientError.Statement.TypeError . Can't coerce NO_VALUE to Path

How to Reproduce the Problem

The below issue happens in linux redhat linux neo4j V4.0.0 enterprise & windows V4.0.0 enterprise
Create a category name it root. create sub_category relation subcategory node under that category (this can run into different depth). create products under subcategory. This happens only if you have sub_Category that dont have any product under that and some sub_category have some products match path= (c:Category)-[:SUB_CATEGORY*]->(sc:SubCategory) optional match path1= (sc)-[:PRODUCT*]->(p:product) WITH apoc.path.combine(path,path1) as path0 with collect (path0) as paths call apoc.convert.toTree(paths) yield value return value

Simple Dataset (where it's possibile)

//Insert here a set of Cypher statements that helps us to reproduce the problem
match path= (c:Category)-[:SUB_CATEGORY*]->(sc:SubCategory)
optional match path1= (sc)-[:PRODUCT*]->(p:product)
 WITH apoc.path.combine(path,path1) as path0 with collect (path0) as paths call apoc.convert.toTree(paths) yield value return value


### Steps (Mandatory)

  1. Run the above cypher couple of times using browser, the error should appear with in 5-10 execution or repeat until it reproduces. 
  1.
  1.

## Screenshots (where it's possibile)
The below query executes 5 times fine and six time returns an error  Neo.ClientError.Statement.TypeError .
Can't coerce `NO_VALUE` to Path

Until next restart it wont work.
match path= (c:Category)-[:SUB_CATEGORY*]->(sc:SubCategory)
optional match path1= (sc)-[:PRODUCT*]->(p: product)
 WITH apoc.path.combine(path,path1) as path0 with collect (path0) as paths call apoc.convert.toTree(paths) yield value return value

return paths works well, it seems apoc.convert.toTree() yield value may be having some issue not sure . after 5 execution it just returns this error can't coerce .. 

## Specifications (Mandatory)
it seems apoc.convert.toTree() yield value may be having some issue not sure . after 5 execution it just returns this error can't coerce

Currently used versions

### Versions

  - OS: Red Hat Enterprise Linux 8 (HVM), windows 2016 server
  - Neo4j: neo4j V4.0.0 enterprise 
  - Neo4j-Apoc: 4.0.0.4

### Error details from query.log

org.neo4j.exceptions.CypherTypeException: Can't coerce `NO_VALUE` to Path
	at org.neo4j.cypher.operations.CypherCoercions.cantCoerce(CypherCoercions.java:287)
	at org.neo4j.cypher.operations.CypherCoercions.asPathValue(CypherCoercions.java:136)
	at org.neo4j.codegen.Expression46/0x0000000101de1c40.project(Unknown Source)
	at org.neo4j.cypher.internal.runtime.slotted.expressions.CompileWrappingProjection.project(CompiledExpressionConverter.scala:160)
	at org.neo4j.cypher.internal.runtime.pipelined.operators.ProjectOperator.operate(ProjectOperator.scala:41)
	at org.neo4j.cypher.internal.runtime.pipelined.operators.OperatorTask.operateWithProfile(Operator.scala:251)
	at org.neo4j.cypher.internal.runtime.pipelined.operators.OperatorTask.operateWithProfile$(Operator.scala:241)
	at org.neo4j.cypher.internal.runtime.pipelined.operators.ProjectOperator.operateWithProfile(ProjectOperator.scala:23)
	at org.neo4j.cypher.internal.runtime.pipelined.PipelineTask.executeOperators(PipelineTask.scala:65)
	at org.neo4j.cypher.internal.runtime.pipelined.PipelineTask.executeWorkUnit(PipelineTask.scala:48)
	at org.neo4j.cypher.internal.runtime.pipelined.Worker.executeTask(Worker.scala:128)
	at org.neo4j.cypher.internal.runtime.pipelined.Worker.workOnQuery(Worker.scala:84)
	at org.neo4j.cypher.internal.runtime.pipelined.execution.CallingThreadExecutingQuery.request(CallingThreadExecutingQuery.scala:30)
	at org.neo4j.cypher.internal.PipelinedRuntime$PipelinedRuntimeResult.request(PipelinedRuntime.scala:326)
	at org.neo4j.cypher.internal.result.StandardInternalExecutionResult.request(StandardInternalExecutionResult.scala:88)
	at org.neo4j.cypher.internal.result.ClosingExecutionResult.request(ClosingExecutionResult.scala:135)
	at org.neo4j.bolt.runtime.AbstractCypherAdapterStream.handleRecords(AbstractCypherAdapterStream.java:105)
	at org.neo4j.bolt.v3.messaging.ResultHandler.onPullRecords(ResultHandler.java:41)
	at org.neo4j.bolt.v4.messaging.PullResultConsumer.consume(PullResultConsumer.java:42)
	at org.neo4j.bolt.runtime.statemachine.impl.TransactionStateMachine$State.consumeResult(TransactionStateMachine.java:511)
	at org.neo4j.bolt.runtime.statemachine.impl.TransactionStateMachine$State$2.streamResult(TransactionStateMachine.java:355)
	at org.neo4j.bolt.runtime.statemachine.impl.TransactionStateMachine.streamResult(TransactionStateMachine.java:92)
	at org.neo4j.bolt.v4.runtime.InTransactionState.processStreamResultMessage(InTransactionState.java:73)
	at org.neo4j.bolt.v4.runtime.AbstractStreamingState.processUnsafe(AbstractStreamingState.java:49)
	at org.neo4j.bolt.v4.runtime.InTransactionState.processUnsafe(InTransactionState.java:60)
	at org.neo4j.bolt.v3.runtime.FailSafeBoltStateMachineState.process(FailSafeBoltStateMachineState.java:48)
	at org.neo4j.bolt.runtime.statemachine.impl.AbstractBoltStateMachine.nextState(AbstractBoltStateMachine.java:143)
	at org.neo4j.bolt.runtime.statemachine.impl.AbstractBoltStateMachine.process(AbstractBoltStateMachine.java:91)
	at org.neo4j.bolt.messaging.BoltRequestMessageReader.lambda$doRead$1(BoltRequestMessageReader.java:90)
	at org.neo4j.bolt.runtime.DefaultBoltConnection.lambda$enqueue$0(DefaultBoltConnection.java:151)
	at org.neo4j.bolt.runtime.DefaultBoltConnection.processNextBatchInternal(DefaultBoltConnection.java:240)
	at org.neo4j.bolt.runtime.DefaultBoltConnection.processNextBatch(DefaultBoltConnection.java:175)
	at org.neo4j.bolt.runtime.DefaultBoltConnection.processNextBatch(DefaultBoltConnection.java:165)
	at org.neo4j.bolt.runtime.scheduling.ExecutorBoltScheduler.executeBatch(ExecutorBoltScheduler.java:212)
	at org.neo4j.bolt.runtime.scheduling.ExecutorBoltScheduler.lambda$scheduleBatchOrHandleError$2(ExecutorBoltScheduler.java:195)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:834)