{"record":{"id":"e2cd3e560850b352","repo":"pentaho/pentaho-kettle","slug":"repositorymeta-error-readinginfo","errorCode":null,"errorMessage":"RepositoryMeta.Error.ReadingInfo","messagePattern":"RepositoryMeta\\.Error\\.ReadingInfo","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/RepositoriesMeta.java","lineNumber":217,"sourceCode":"    try {\n      // Check and open XML document\n      DocumentBuilderFactory dbf = XMLParserFactoryProducer.createSecureDocBuilderFactory();\n      DocumentBuilder db = dbf.newDocumentBuilder();\n      Document doc;\n      try {\n        doc = db.parse( file );\n      } catch ( FileNotFoundException ef ) {\n        try ( InputStream is = getClass().getResourceAsStream( \"/org/pentaho/di/repository/repositories.xml\" ) ) {\n          if ( is != null ) {\n            doc = db.parse( is );\n          } else {\n            throw new KettleException( BaseMessages.getString( PKG, \"RepositoryMeta.Error.OpeningFile\", file.getAbsoluteFile() ), ef );\n          }\n        }\n      }\n      parseRepositoriesDoc( doc );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"RepositoryMeta.Error.ReadingInfo\" ), e );\n    }\n\n    return true;\n  }\n\n  public String getKettleUserRepositoriesFile() {\n    return Const.getKettleUserRepositoriesFile();\n  }\n\n  String getKettleLocalRepositoriesFile() {\n    return Const.getKettleLocalRepositoriesFile();\n  }\n\n  public void readDataFromInputStream( InputStream is ) throws KettleException {\n    // Clear the information\n    //\n    clear();\n","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/RepositoriesMeta.java#L199-L235","documentation":"RepositoriesMeta.readData throws KettleException with RepositoryMeta.Error.ReadingInfo as a catch-all when parsing repositories.xml fails (parseRepositoriesDoc or the DocumentBuilder parse throws) — the file exists but its content is unreadable or invalid. The cause is chained.","triggerScenarios":"parseRepositoriesDoc(doc) receiving a null doc, or db.parse throwing on malformed XML inside the try block — anything after the file is opened that throws Exception.","commonSituations":"Corrupted or truncated repositories.xml; XML with wrong encoding (e.g. UTF-16 file read as UTF-8); root element not <repositories>; XML entities/namespace surprises from manual editing.","solutions":["Inspect e.getCause() for the exact parse error (line/column from the XML parser)","Validate repositories.xml against expected <repositories><repository>...</repository></repositories> structure","Fix encoding declaration to match the file's actual encoding","Regenerate the file via Spoon or restore a backup"],"exampleFix":"// before: malformed XML\n<repositories><repository><name>prod</name></repositories>\n// after\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<repositories><repository><id>KettleDatabaseRepository</id><name>prod</name></repository></repositories>","handlingStrategy":"validation","validationCode":"// Validate XML parses before handing to RepositoriesMeta\njavax.xml.parsers.DocumentBuilderFactory f = javax.xml.parsers.DocumentBuilderFactory.newInstance();\nf.setValidating(false);\ntry {\n  f.newDocumentBuilder().parse(repoXmlFile);\n} catch (Exception ex) {\n  throw new IllegalStateException(\"repositories.xml is not well-formed: \" + ex.getMessage(), ex);\n}","typeGuard":"static boolean isWellFormedXml(java.io.File f) {\n  try { javax.xml.parsers.DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(f); return true; }\n  catch (Exception e) { return false; }\n}","tryCatchPattern":"try {\n  reposMeta.readData(file);\n} catch (KettleException e) {\n  if (e.getMessage() != null && e.getMessage().endsWith(\"ReadingInfo\")) {\n    throw new IllegalStateException(\"repositories.xml unreadable/invalid: \" + e.getCause(), e);\n  }\n  throw e;\n}","preventionTips":["Validate encoding declaration matches the file's real encoding","Run xmllint --noout on repositories.xml after any edit","Ensure root element is <repositories>","Keep an atomic-write + backup strategy for repositories.xml"],"tags":["repository","xml","parse-error"],"backgroundTag":"xml-parse-error","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}