{"record":{"id":"a17661f353dcec84","repo":"pentaho/pentaho-kettle","slug":"ldapconnection-error-retrievingfields","errorCode":"LDAPConnection.Error.RetrievingFields","errorMessage":"LDAPConnection.Error.RetrievingFields","messagePattern":"LDAPConnection\\.Error\\.RetrievingFields","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/ldap/impl/src/main/java/org/pentaho/di/trans/steps/ldapinput/LDAPConnection.java","lineNumber":730,"sourceCode":"            //\n            if ( IsDate( attributeValue ) ) {\n              valueType = ValueMetaInterface.TYPE_DATE;\n            } else if ( IsInteger( attributeValue ) ) {\n              valueType = ValueMetaInterface.TYPE_INTEGER;\n            } else if ( IsNumber( attributeValue ) ) {\n              valueType = ValueMetaInterface.TYPE_NUMBER;\n            } else {\n              valueType = ValueMetaInterface.TYPE_STRING;\n            }\n\n            ValueMetaInterface value = ValueMetaFactory.createValueMeta( fieldName, valueType );\n            fields.addValueMeta( value );\n          }\n        }\n      }\n      return fields;\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"LDAPConnection.Error.RetrievingFields\" ) );\n    } finally {\n      fieldsl = null;\n    }\n  }\n\n  private boolean IsNumber( String str ) {\n    try {\n      Float.parseFloat( str );\n    } catch ( Exception e ) {\n      return false;\n    }\n    return true;\n  }\n\n  private boolean IsDate( String str ) {\n    // TODO: What about other dates? Maybe something for a CRQ\n    try {\n      SimpleDateFormat fdate = new SimpleDateFormat( \"yy-mm-dd\" );","sourceCodeStart":712,"sourceCodeEnd":748,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/ldap/impl/src/main/java/org/pentaho/di/trans/steps/ldapinput/LDAPConnection.java#L712-L748","documentation":"Thrown by the LDAPConnection constructor path in getFields(): any exception while deriving the output row fields from the first LDAP search results is wrapped in this KettleException. Note the cause is discarded (message-only), so the original error is not chained. It indicates field discovery from the directory failed.","triggerScenarios":"Calling getFields() (used when building step metadata, e.g. 'Get Fields' in Spoon) when the underlying getAttributes() search fails, attributes cannot be converted to ValueMeta, or the connection was never opened.","commonSituations":"Previewing/validating the LDAP Input step with a wrong host or credentials, directory unreachable at design time, or search base/filter configured but the directory returns nothing to derive fields from.","solutions":["Test connectivity to the LDAP host/port from the PDI server (telnet/openssl s_client).","Correct the search base, filter, and bind credentials in the step dialog, then re-run 'Get Fields'.","Because the cause is swallowed, temporarily enable JNDI debug or test the same query with ldapsearch to see the real error.","Ensure the connection was opened before getFields() is invoked."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// before invoking Get Fields\nboolean reachable = testLdapConnectivity(host, port, user, password);\nif (!reachable) throw new IllegalStateException(\"LDAP host unreachable; fix connection before field discovery\");","typeGuard":null,"tryCatchPattern":"try { fields = conn.getFields(); } catch (KettleException e) { logError(\"Field retrieval failed (cause is not chained): \" + e.getMessage()); }","preventionTips":["Verify host/port/credentials before clicking 'Get Fields' in Spoon","Diagnose with ldapsearch since this wrapper discards the cause","Keep search base/filter minimal during field discovery"],"tags":["ldap","metadata","field-discovery"],"backgroundTag":"ldap-search-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"}