{"record":{"id":"85b40f6c88f5bd1f","repo":"apache/druid","slug":"exception-during-reading-lookups-from-s","errorCode":null,"errorMessage":"Exception during reading lookups from [%s]","messagePattern":"Exception during reading lookups from \\[(.+?)\\]","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/query/lookup/LookupSnapshotTaker.java","lineNumber":76,"sourceCode":"\n  public synchronized List<LookupBean> pullExistingSnapshot(final String tier)\n  {\n    final File persistFile = getPersistFile(tier);\n\n    List<LookupBean> lookupBeanList;\n    try {\n      if (!persistFile.isFile()) {\n        LOGGER.warn(\"could not find any snapshot file under working directory [%s]\", persistDirectory);\n        return Collections.emptyList();\n      } else if (persistFile.length() == 0) {\n        LOGGER.warn(\"found empty file no lookups to load from [%s]\", persistFile.getAbsolutePath());\n        return Collections.emptyList();\n      }\n      lookupBeanList = objectMapper.readValue(persistFile, new TypeReference<>() {});\n      return lookupBeanList;\n    }\n    catch (IOException e) {\n      throw new ISE(e, \"Exception during reading lookups from [%s]\", persistFile.getAbsolutePath());\n    }\n  }\n\n  public synchronized void takeSnapshot(String tier, List<LookupBean> lookups)\n  {\n    final File persistFile = getPersistFile(tier);\n\n    try {\n      FileUtils.writeAtomically(\n          persistFile,\n          out -> {\n            objectMapper.writeValue(out, lookups);\n            return null;\n          }\n      );\n    }\n    catch (IOException e) {\n      throw new ISE(e, \"Exception during serialization of lookups using file [%s]\", persistFile.getAbsolutePath());","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/query/lookup/LookupSnapshotTaker.java#L58-L94","documentation":"LookupSnapshotTaker.pullExistingSnapshot deserializes the persisted lookup tier snapshot file (JSON list of LookupBean) with the ObjectMapper. If reading the file raises IOException (missing file access, corrupt snapshot, unreadable permissions), it wraps it in this ISE.","triggerScenarios":"Calling pullExistingSnapshot (via actualList) when getPersistFile(tier) exists but objectMapper.readValue throws IOException — e.g. truncated/corrupt JSON snapshot, permission denied, or the file disappearing between existence check and read.","commonSituations":"Druid nodes restoring lookups at startup after an unclean shutdown that left a partial snapshot, wrong directory permissions on the lookup persistence path, or filesystem errors on the tier's snapshot file.","solutions":["Inspect the snapshot file at the reported path and delete/replace the corrupt file so a fresh snapshot can be taken","Fix filesystem permissions/ownership on the persistence directory for the Druid process user","Verify disk health and available space; check logs for earlier takeSnapshot failures"],"exampleFix":"// before\n// corrupt snapshot file causes ISE at startup\n// after\nrm /path/to/lookups/<tier>.json && restart node // snapshot recreated from cluster state","handlingStrategy":"try-catch","validationCode":"File f = snapshotTaker.getPersistFile(tier);\nif (!f.isFile()) return Collections.emptyList();\nif (!f.canRead()) throw new IllegalStateException(\"No read permission on \" + f);","typeGuard":null,"tryCatchPattern":"try {\n  return snapshotTaker.pullExistingSnapshot(tier);\n} catch (ISE e) {\n  if (e.getMessage().startsWith(\"Exception during reading lookups\")) {\n    logger.warn(e, \"Snapshot unreadable, starting with empty lookup set\");\n    return Collections.emptyList();\n  }\n  throw e;\n}","preventionTips":["Validate snapshot files at startup (log and quarantine corrupt files) rather than crashing","Ensure the lookup persistence directory is readable by the Druid process user","Monitor disk health; takeSnapshot failures usually precede read failures"],"tags":["io","lookup","snapshot","json-deserialization"],"backgroundTag":"file-read-failed","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}