{"record":{"id":"2dae3595cde9e908","repo":"stanfordnlp/CoreNLP","slug":"failed-to-find-node-ie-target-ie-targe","errorCode":null,"errorMessage":"Failed to find node \" + ie.target + \"-\" + ie.targetCopy","messagePattern":"Failed to find node \" \\+ ie\\.target \\+ \"-\" \\+ ie\\.targetCopy","errorType":"exception","errorClass":"RuntimeIOException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/pipeline/AnnotationSerializer.java","lineNumber":169,"sourceCode":"          word.setIndex(in.index);\n        }\n\n        nodeMap.put(word.index(), word.copyCount(), word);\n        graph.addVertex(word);\n        if (in.isRoot) {\n          graph.addRoot(word);\n        }\n      }\n\n      // add all edges to the actual graph\n      for (IntermediateEdge ie: edges) {\n        IndexedWord source = nodeMap.get(ie.source, ie.sourceCopy);\n        if (source == null) {\n          throw new RuntimeIOException(\"Failed to find node \" + ie.source + \"-\" + ie.sourceCopy);\n        }\n        IndexedWord target = nodeMap.get(ie.target, ie.targetCopy);\n        if (target == null) {\n          throw new RuntimeIOException(\"Failed to find node \" + ie.target + \"-\" + ie.targetCopy);\n        }\n        // assert(target != null);\n        synchronized (LOCK) {\n          // this is not thread-safe: there are static fields in GrammaticalRelation\n          GrammaticalRelation rel = GrammaticalRelation.valueOf(ie.dep);\n          graph.addEdge(source, target, rel, 1.0, ie.isExtra);\n        }\n      }\n\n      // compute root nodes if they weren't stored in the graph\n      if ( ! graph.isEmpty() && graph.getRoots().isEmpty()) {\n        graph.resetRoots();\n      }\n\n      return graph;\n    }\n  }\n","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/pipeline/AnnotationSerializer.java#L151-L187","documentation":"RuntimeIOException from AnnotationSerializer's graph reconstruction when an edge references a node (source or target index-copy) that was not found in the deserialized node map — the serialized dependency graph is inconsistent or was produced by an incompatible version.","triggerScenarios":"Deserializing a SemanticGraph whose IntermediateEdge target (nodeId, copy) has no matching node entry — corrupted file, writer/reader version mismatch, or custom code pruning nodes while keeping edges.","commonSituations":"Merging or truncating serialized annotation files, custom serialization pipelines that filter enhanced/ccprocessed dependencies, upgrading CoreNLP between serialization format changes.","solutions":["Regenerate the annotation file with a matching CoreNLP version","Audit any custom serializer/filter code for node removal without edge cleanup","Validate the file against the schema; look for the specific missing target id in the message","Test with a fresh document serialized end-to-end to isolate writer vs. file corruption"],"exampleFix":"// before\n// filter drops punctuation nodes but leaves edges referencing them\n// after\n// drop edges alongside removed nodes:\n// edges.removeIf(e -> removed.contains(e.target));","handlingStrategy":"try-catch","validationCode":"// pre-validate a deserialized graph\nfor (SemanticGraphEdge e : graph.edgeIterable()) {\n  if (e.getSource() == null || e.getTarget() == null)\n    throw new IllegalStateException(\"Dangling edge in graph\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  graph = convertIntermediateGraph(nodes, edges);\n} catch (RuntimeIOException e) {\n  if (e.getMessage().startsWith(\"Failed to find node\")) {\n    log.error(\"Edge references missing node: \" + e.getMessage());\n  } else throw e;\n}","preventionTips":["Avoid custom serialization filters that prune nodes only","Regenerate files after CoreNLP upgrades","Validate serialized files against schema before loading"],"tags":["serialization","dependency-graph","deserialization","java"],"backgroundTag":"internal-invariant-violation","analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}