{"record":{"id":"3e2ecec67b49cc74","repo":"pentaho/pentaho-kettle","slug":"ldapconnection-exception-gettingattributes","errorCode":"LDAPConnection.Exception.GettingAttributes","errorMessage":"LDAPConnection.Exception.GettingAttributes","messagePattern":"LDAPConnection\\.Exception\\.GettingAttributes","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/ldap/impl/src/main/java/org/pentaho/di/trans/steps/ldapinput/LDAPConnection.java","lineNumber":597,"sourceCode":"        }\n\n        while ( !getSearchResult().hasMoreElements() ) {\n          return null;\n        }\n      } else {\n        // User do not want to use paging\n        // we have already returned all the result\n        return null;\n      }\n    }\n\n    try {\n      SearchResult searchResult = getSearchResult().next();\n      Attributes results = searchResult.getAttributes();\n      results.put( \"dn\", searchResult.getNameInNamespace() );\n      return results;\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"LDAPConnection.Exception.GettingAttributes\" ), e );\n    }\n  }\n\n  private InitialLdapContext getInitialContext() {\n    return protocol.getCtx();\n  }\n\n  private SearchControls getSearchControls() {\n    return this.controls;\n  }\n\n  private NamingEnumeration<SearchResult> getSearchResult() {\n    return this.results;\n  }\n\n  /**\n   * Remove CR and LF from filter string\n   *","sourceCodeStart":579,"sourceCodeEnd":615,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/ldap/impl/src/main/java/org/pentaho/di/trans/steps/ldapinput/LDAPConnection.java#L579-L615","documentation":"Thrown by LDAPConnection.getAttributes() while iterating a SearchResult: fetching the entry's Attributes, or putting the 'dn' value via getNameInNamespace(), failed. It wraps any javax.naming exception raised while materializing a single search result entry. The original naming exception is attached as cause.","triggerScenarios":"getSearchResult().next() or searchResult.getAttributes() / getNameInNamespace() throws NamingException during per-row attribute extraction, typically after a successful search (e.g. entry was deleted between paging reads, or referral/name resolution failed).","commonSituations":"Directory entry removed concurrently mid-iteration, referral chasing to an unreachable server, or invalid DN characters that break getNameInNamespace().","solutions":["Read the chained cause to identify the exact javax.naming exception (e.g. NameNotFoundException, CommunicationException).","Re-run the transformation; transient directory state (entry deleted mid-read) resolves on retry.","Check referral handling settings ('follow' vs 'ignore') in the LDAP connection options.","Verify the search base and returned entries use valid, fully-qualified DNs."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { attrs = conn.getAttributes(); } catch (KettleException e) { Throwable cause = e.getCause(); logError(\"Entry read failed due to \" + cause.getMessage(), cause); }","preventionTips":["Configure referral handling explicitly ('follow' only when referrals are reachable)","Avoid deleting/renaming entries while a read is iterating","Use stable, fully-qualified DNs in the directory"],"tags":["ldap","attributes","naming"],"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"}