{"record":{"id":"48563796cfd3a4fb","repo":"pentaho/pentaho-kettle","slug":"error-getting-fields-from-module","errorCode":null,"errorMessage":"Error getting fields from module [","messagePattern":"Error getting fields from module \\[","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/salesforce/core/src/main/java/org/pentaho/di/ui/trans/steps/salesforceinsert/SalesforceInsertDialog.java","lineNumber":862,"sourceCode":"        Utils.resolvePassword( transMeta, wPassword.getText() ) );\n    int realTimeOut = Const.toInt( transMeta.environmentSubstitute( wTimeOut.getText() ), 0 );\n    connection.setTimeOut( realTimeOut );\n    // connect to Salesforce\n    connection.connect();\n\n    return connection;\n  }\n\n  private String[] getFieldNames() throws KettleException {\n    SalesforceConnection connection = null;\n    String selectedModule = transMeta.environmentSubstitute( wModule.getText() );\n    try {\n      // Define a new Salesforce connection\n      connection = getConnection();\n      // return fieldsname for the module\n      return connection.getFields( selectedModule );\n    } catch ( Exception e ) {\n      throw new KettleException( \"Error getting fields from module [\" + selectedModule + \"]!\", e );\n    } finally {\n      if ( connection != null ) {\n        try {\n          connection.close();\n        } catch ( Exception e ) {\n          // Ignore close errors\n        }\n      }\n    }\n  }\n\n  /**\n   * Reads in the fields from the previous steps and from the ONE next step and opens an EnterMappingDialog with this\n   * information. After the user did the mapping, those information is put into the Select/Rename table.\n   */\n  private void generateMappings() {\n\n    if ( !checkInput() ) {","sourceCodeStart":844,"sourceCodeEnd":880,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/salesforce/core/src/main/java/org/pentaho/di/ui/trans/steps/salesforceinsert/SalesforceInsertDialog.java#L844-L880","documentation":"Thrown by SalesforceInsertDialog when fetching field metadata for the selected Salesforce module fails. It creates a Salesforce connection, calls connection.getFields(selectedModule), and wraps any exception (connection failure, invalid module name, API error) into a KettleException including the module name.","triggerScenarios":"Calling getFields() in the Insert step dialog when: credentials/URL are wrong so getConnection() or connect() fails, the selectedModule no longer exists or was renamed in Salesforce, or the Salesforce API returns an error (INVALID_FIELD, timeouts, session expired).","commonSituations":"User renamed/deleted a Salesforce object after saving the transformation; sandbox vs production URL mismatch; expired password or locked account; network/firewall blocking the Salesforce endpoint.","solutions":["Verify Salesforce URL, username and password in the step dialog and test the connection.","Re-select the module in the dialog so the object list refreshes against the current org.","Confirm the user has API access and read permission on the object (field-level security).","Check network/proxy connectivity to the Salesforce instance; increase the connection timeout.","Enable Salesforce debug logs to see the exact API fault behind the wrapped exception."],"exampleFix":"// before\nreturn connection.getFields( selectedModule );\n// after\nif ( connection.getObjects() != null && Arrays.asList(connection.getObjects()).contains(selectedModule) ) {\n  return connection.getFields( selectedModule );\n}\nthrow new KettleException( \"Module [\" + selectedModule + \"] does not exist in Salesforce org\" );","handlingStrategy":"try-catch","validationCode":"// before calling getFields\nList<String> modules = Arrays.asList( connection.getObjects() );\nif ( !modules.contains( selectedModule ) ) { throw new KettleException(\"Module \" + selectedModule + \" not found\"); }\nif ( url == null || !url.startsWith(\"https\") ) { throw new KettleException(\"Invalid Salesforce URL\"); }","typeGuard":null,"tryCatchPattern":"try { fields = getFields(selectedModule); } catch ( KettleException e ) { logError(\"Salesforce metadata fetch failed: \" + e.getCause().getMessage()); // prompt user to re-login / re-select module }","preventionTips":["Re-select Salesforce modules after org deployments that add/rename objects.","Test the Salesforce connection from the dialog before editing mappings.","Keep the Salesforce user's API access and password active (check 'API only' login policies).","Use production/sandbox URLs matching the credentials."],"tags":["kettle","salesforce","api","metadata"],"backgroundTag":"api-error-response","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"}