{"record":{"id":"860fe272bae83186","repo":"pentaho/pentaho-kettle","slug":"salesforceinput-error-gettingmodules","errorCode":null,"errorMessage":"SalesforceInput.Error.GettingModules","messagePattern":"SalesforceInput\\.Error\\.GettingModules","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/salesforce/core/src/main/java/org/pentaho/di/trans/steps/salesforce/SalesforceConnection.java","lineNumber":705,"sourceCode":"    DescribeGlobalSObjectResult[] sobjectResults = null;\n    try {\n      // Get object\n      dgr = getBinding().describeGlobal();\n      // let's get all objects\n      sobjectResults = dgr.getSobjects();\n      int nrObjects = dgr.getSobjects().length;\n\n      objects = new ArrayList<String>();\n\n      for ( int i = 0; i < nrObjects; i++ ) {\n        DescribeGlobalSObjectResult o = dgr.getSobjects()[i];\n        if ( ( OnlyQueryableObjects && o.isQueryable() ) || !OnlyQueryableObjects ) {\n          objects.add( o.getName() );\n        }\n      }\n      return objects.toArray( new String[objects.size()] );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"SalesforceInput.Error.GettingModules\" ), e );\n    } finally {\n      if ( dgr != null ) {\n        dgr = null;\n      }\n      if ( objects != null ) {\n        objects.clear();\n        objects = null;\n      }\n      if ( sobjectResults != null ) {\n        sobjectResults = null;\n      }\n    }\n  }\n\n  public Field[] getObjectFields( String objectName ) throws KettleException {\n    DescribeSObjectResult describeSObjectResult = null;\n    try {\n      // Get object","sourceCodeStart":687,"sourceCodeEnd":723,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/salesforce/core/src/main/java/org/pentaho/di/trans/steps/salesforce/SalesforceConnection.java#L687-L723","documentation":"KettleException thrown by SalesforceConnection.getAllAvailableObjects() when the describeGlobal() metadata call or post-processing of its results fails. It is used to list all Salesforce object types (optionally only queryable ones) and rethrows with 'SalesforceInput.Error.GettingModules'. It means the global object metadata listing failed.","triggerScenarios":"describeGlobal() failing due to invalid session, network error, Salesforce API version mismatch, or the returned DescribeGlobalResult having no sObjects the code can iterate (NPE on null array).","commonSituations":"Integration user lacking API access (API disabled in profile), expired session before listing modules, custom Salesforce API version removed server-side, empty org metadata shape.","solutions":["Verify the Salesforce user has 'API Enabled' permission and can access the org","Re-connect to refresh an expired session before calling getAllAvailableObjects()","Check the configured Salesforce API version matches one supported by the org","Print the cause — a NullPointerException suggests an unexpected empty describeGlobal response; retry","Confirm org edition supports the partner API (some stripped-down editions restrict it)"],"exampleFix":"// before\nString[] modules = connection.getAllAvailableObjects(true);\n// after\nif (!connection.testConnection()) connection.connect(); // refresh session first\nString[] modules = connection.getAllAvailableObjects(true);","handlingStrategy":"try-catch","validationCode":"if (!connection.testConnection()) throw new IllegalStateException(\"Salesforce session not available before listing modules\");","typeGuard":"String[] safeGetModules(Connection c) { try { return c.getAllAvailableObjects(true); } catch (Exception e) { return new String[0]; } }","tryCatchPattern":"try { modules = connection.getAllAvailableObjects(true); } catch (KettleException e) { log.logError(\"describeGlobal failed: \" + e.getCause(), e); throw e; }","preventionTips":["Ensure the Salesforce profile has 'API Enabled' and Metadata access","Call testConnection() / reconnect before metadata calls","Pin a supported Salesforce API version supported by the org","Check org edition limitations on the partner API"],"tags":["salesforce","metadata","describe","api"],"backgroundTag":"api-request-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"}