{"record":{"id":"9a020cda8680523f","repo":"pentaho/pentaho-kettle","slug":"avroinput-error-schemaerror","errorCode":null,"errorMessage":"AvroInput.Error.SchemaError","messagePattern":"AvroInput\\.Error\\.SchemaError","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/avro-format/core/src/main/java/org/pentaho/di/trans/steps/avro/input/AvroNestedReader.java","lineNumber":1738,"sourceCode":"   * Load a schema from a file\n   *\n   * @param schemaFile the file to load from\n   * @return the schema\n   * @throws KettleException if a problem occurs\n   */\n  protected static Schema loadSchema( Bowl bowl, String schemaFile ) throws KettleException {\n\n    Schema s = null;\n    Schema.Parser p = new Schema.Parser();\n\n    FileObject fileO = KettleVFS.getInstance( bowl ).getFileObject( schemaFile );\n    try {\n      InputStream in = KettleVFS.getInputStream( fileO );\n      s = p.parse( in );\n\n      in.close();\n    } catch ( FileSystemException e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"AvroInput.Error.SchemaError\" ), e );\n    } catch ( IOException e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"AvroInput.Error.SchemaError\" ), e );\n    }\n\n    return s;\n  }\n\n  /**\n   * Load a schema from a Avro container file\n   *\n   * @param containerFilename the name of the Avro container file\n   * @return the schema\n   * @throws KettleException if a problem occurs\n   */\n  protected static Schema loadSchemaFromContainer( Bowl bowl, String containerFilename ) throws KettleException {\n    Schema s = null;\n\n    FileObject fileO = KettleVFS.getInstance( bowl ).getFileObject( containerFilename );","sourceCodeStart":1720,"sourceCodeEnd":1756,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/avro-format/core/src/main/java/org/pentaho/di/trans/steps/avro/input/AvroNestedReader.java#L1720-L1756","documentation":"The step loads the user-supplied Avro schema by parsing the file via KettleVFS; when opening/parsing fails with a FileSystemException, it is wrapped in a KettleException with the generic 'schema error' message. This indicates the schema file could not be accessed through the VFS layer.","triggerScenarios":"Schema file path points to a non-existent/unreadable location, wrong VFS scheme/URL, or the file cannot be opened as an InputStream — thrown as FileSystemException before parsing even begins.","commonSituations":"Typos or stale variables in the schema filename field; missing env variables in paths like ${Internal...}/schema.avsc; no permission on the remote share; using http/ftp schemes without proper setup; file moved after configuration.","solutions":["Verify the schema file path resolves correctly (resolve any ${variables} and check the file exists).","Check VFS connection settings/credentials for remote schemes (SFTP, HTTP, etc.).","Confirm read permissions on the schema file and its containing directory.","Test the exact resolved path with the same runtime user/agent running the transformation."],"exampleFix":"// before\nString schemaFile = \"${AVRO_SCHEMA_DIR}/user.avsc\"; // AVRO_SCHEMA_DIR unset\n// after: set variable at runtime\ntransMeta.setVariable(\"AVRO_SCHEMA_DIR\", \"/opt/schemas\");","handlingStrategy":"validation","validationCode":"FileObject fo = KettleVFS.getFileObject(resolvedPath, space);\nif (!fo.exists() || !fo.isReadable()) {\n  throw new IllegalArgumentException(\"schema file missing or unreadable: \" + resolvedPath);\n}","typeGuard":null,"tryCatchPattern":"try {\n  rows = reader.avroObjectToKettle(row, space);\n} catch (KettleException e) {\n  if (e.getCause() instanceof FileSystemException) { alertBadSchemaPath(e.getCause()); stop(); } else throw e;\n}","preventionTips":["Resolve and test all variables in the schema path at startup.","Check file existence and permissions before the transformation runs.","Use absolute paths or verified VFS connections for schema files."],"tags":["avro","schema","vfs","file-not-found"],"backgroundTag":"file-not-found","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"}