{"record":{"id":"eac0bc1772198ded","repo":"pentaho/pentaho-kettle","slug":"mysqlbulkloadermeta-exception-errorgettingfields","errorCode":"MySQLBulkLoaderMeta.Exception.ErrorGettingFields","errorMessage":"MySQLBulkLoaderMeta.Exception.ErrorGettingFields","messagePattern":"MySQLBulkLoaderMeta\\.Exception\\.ErrorGettingFields","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/mysql-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/mysqlbulkloader/MySQLBulkLoaderMeta.java","lineNumber":646,"sourceCode":"    if ( databaseMeta != null ) {\n      Database db = new Database( loggingObject, databaseMeta );\n      try {\n        db.connect();\n\n        if ( !Utils.isEmpty( realTableName ) ) {\n          String schemaTable = databaseMeta.getQuotedSchemaTableCombination( realSchemaName, realTableName );\n\n          // Check if this table exists...\n          if ( db.checkTableExists( schemaTable ) ) {\n            return db.getTableFields( schemaTable );\n          } else {\n            throw new KettleException( BaseMessages.getString( PKG, \"MySQLBulkLoaderMeta.Exception.TableNotFound\" ) );\n          }\n        } else {\n          throw new KettleException( BaseMessages.getString( PKG, \"MySQLBulkLoaderMeta.Exception.TableNotSpecified\" ) );\n        }\n      } catch ( Exception e ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"MySQLBulkLoaderMeta.Exception.ErrorGettingFields\" ), e );\n      } finally {\n        db.close();\n      }\n    } else {\n      throw new KettleException( BaseMessages.getString( PKG, \"MySQLBulkLoaderMeta.Exception.ConnectionNotDefined\" ) );\n    }\n\n  }\n\n  /**\n   * @return the schemaName\n   */\n  public String getSchemaName() {\n    return schemaName;\n  }\n\n  /**\n   * @param schemaName","sourceCodeStart":628,"sourceCodeEnd":664,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/mysql-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/mysqlbulkloader/MySQLBulkLoaderMeta.java#L628-L664","documentation":"getRequiredFields wraps its table lookup in a try/catch; any exception raised while connecting to the database, checking table existence, or reading the table fields is rethrown as a KettleException with the message 'MySQLBulkLoaderMeta.Exception.ErrorGettingFields' and the original exception as the cause. It is a wrapper error indicating the required-fields lookup failed for an underlying reason.","triggerScenarios":"Calling getRequiredFields when the inner block throws: connection failure (db.connect), checkTableExists/getTableFields SQL errors, or the TableNotFound/TableNotSpecified exceptions from the same method.","commonSituations":"Database unreachable or credentials wrong; SQL syntax/privilege error reading table metadata; the TableNotFound or TableNotSpecified conditions being wrapped.","solutions":["Inspect the chained cause of this KettleException to find the real failure (connect error, missing table, etc.)","Fix the underlying cause: verify host/port/credentials, create the table, or set the table name","Test the database connection in the step dialog before re-running"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if ( databaseMeta == null ) throw new KettleException( \"No connection defined\" );\n// then verify connectivity\ndb.connect(); db.disconnect();","typeGuard":null,"tryCatchPattern":"try {\n  meta.getRequiredFields( transMeta );\n} catch ( KettleException e ) {\n  Throwable cause = e.getCause();\n  logError( \"Required fields lookup failed: \" + cause.getMessage(), e );\n}","preventionTips":["Always inspect getCause() — this is a wrapper exception","Test the DB connection in the step dialog first","Ensure the DB user has privileges to read table metadata"],"tags":["kettle","mysql","database","wrapped-exception"],"backgroundTag":"database-query-failed","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"}