{"record":{"id":"9c0a304d4ef48a4d","repo":"stanfordnlp/CoreNLP","slug":"error-processing-attrsfile-unknown-attribute","errorCode":null,"errorMessage":"Error processing ${attrsFile}:Unknown attribute ${attrname}: from line ${line}","messagePattern":"Error processing (.+?):Unknown attribute (.+?): from line (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/edu/stanford/nlp/time/SUTimeMain.java","lineNumber":706,"sourceCode":"      String attrname = fields[6];\n      String attrvalue = fields[7];\n\n      // Find entry\n      TimexAttributes timex = findTimex(timexMap, docName, tid);\n      assert(timex.sentIndex == sentNo);\n      assert(timex.tokenStart <= tokenNo && timex.tokenEnd > tokenNo);\n\n      switch (attrname) {\n        case \"type\":\n          assert (timex.type == null || timex.type.equals(attrvalue));\n          timex.type = attrvalue;\n          break;\n        case \"value\":\n          assert (timex.value == null || timex.value.equals(attrvalue));\n          timex.value = attrvalue;\n          break;\n        default:\n          throw new RuntimeException(\"Error processing \" + attrsFile + \":\" +\n              \"Unknown attribute \" + attrname + \": from line \" + line);\n      }\n    }\n    attrBr.close();\n    return timexMap;\n  }\n\n  public static void processTempEval2Tab(AnnotationPipeline pipeline, String in, String out, Map<String,String> docDates) throws IOException\n  {\n    Map<String,List<TimexAttributes>> timexMap = readTimexAttrExts(in  + \"/timex-extents.tab\", in  + \"/timex-attributes.tab\");\n    BufferedReader br = IOUtils.readerFromString(in  + \"/base-segmentation.tab\");\n    PrintWriter debugPw = IOUtils.getPrintWriter(out + \"/timex-debug.out\");\n    PrintWriter attrPw = IOUtils.getPrintWriter(out + \"/timex-attrs.res.tab\");\n    PrintWriter extPw = IOUtils.getPrintWriter(out + \"/timex-extents.res.tab\");\n    PrintWriter attrDebugPwGold = IOUtils.getPrintWriter(out + \"/timex-attrs.debug.gold.tab\");\n    PrintWriter attrDebugPw = IOUtils.getPrintWriter(out + \"/timex-attrs.debug.res.tab\");\n    String line;\n    String curDocName = null;","sourceCodeStart":688,"sourceCodeEnd":724,"githubUrl":"https://github.com/stanfordnlp/CoreNLP/blob/1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a/src/edu/stanford/nlp/time/SUTimeMain.java#L688-L724","documentation":"SUTimeMain, when loading an attribute file describing TimeBank/TEMPEVAL timex attributes, encounters an attribute name it does not recognize and aborts with a RuntimeException naming the file, the attribute, and the line. It indicates the attrs file contains a key outside the supported set (id, type, value, etc.), or the file is from an incompatible corpus version.","triggerScenarios":"Running SUTimeMain in TEMPEVAL2/TEMPEVAL3 or TIMEBANK_CSV mode with a -attrs / attribute mapping file containing an attribute name not handled by the parser's switch statement, at the reported line.","commonSituations":"Using attribute files from a newer/different corpus release, hand-edited attr files with typos, or files with extra columns/keys the tool was never taught to read.","solutions":["Open attrsFile at the reported line and remove or rename the unknown attribute to one the tool supports (id, type, value, ...)","Verify the attrs file matches the corpus version expected by your CoreNLP version","Update CoreNLP to a version whose SUTimeMain knows the newer attribute names","Patch/extend the switch in SUTimeMain to handle the new attribute and re-run"],"exampleFix":"// before (line 42 of attrs file)\nunknownattr=X\n// after\nvalue=X\n","handlingStrategy":"validation","validationCode":"Set<String> known = Set.of(\"id\",\"type\",\"value\",\"start\",\"end\");\nfor (String attr : readAttrNames(attrsFile)) { if (!known.contains(attr)) throw new IllegalStateException(\"Unknown attribute: \" + attr); }","typeGuard":null,"tryCatchPattern":"try { timexMap = loadAttrs(attrsFile); } catch (RuntimeException e) { /* parse message for file/line, sanitize the attrs file, retry */ }","preventionTips":["Keep attrs files matching the corpus version your CoreNLP supports","Diff hand-edited attr files against a known-good sample","Pre-validate attribute names before running SUTimeMain"],"tags":["java","parser","corpus","config"],"backgroundTag":"schema-validation-failed","analyzedSha":"1b7edd19c4d0d7b1f13a2591425b9b60a0b1af7a","analyzedAt":"2026-09-10T02:24:07.274Z","contentChangedAt":"2026-09-10T02:24:07.274Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}