pentaho/pentaho-kettle · error · KettleException

LDAPConnection.Exception.GettingAttributes

LDAPConnection.Exception.GettingAttributes

Error message

LDAPConnection.Exception.GettingAttributes

What it means

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.

Solutions

  1. Read the chained cause to identify the exact javax.naming exception (e.g. NameNotFoundException, CommunicationException).
  2. Re-run the transformation; transient directory state (entry deleted mid-read) resolves on retry.
  3. Check referral handling settings ('follow' vs 'ignore') in the LDAP connection options.
  4. Verify the search base and returned entries use valid, fully-qualified DNs.
Defensive patterns

Strategy: try-catch

Try / catch

try { attrs = conn.getAttributes(); } catch (KettleException e) { Throwable cause = e.getCause(); logError("Entry read failed due to " + cause.getMessage(), cause); }

Prevention

When it happens

Trigger: 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).

Common situations: Directory entry removed concurrently mid-iteration, referral chasing to an unreachable server, or invalid DN characters that break getNameInNamespace().

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/3e2ecec67b49cc74. Report an issue: GitHub.

Appendix: source

Thrown at plugins/ldap/impl/src/main/java/org/pentaho/di/trans/steps/ldapinput/LDAPConnection.java:597

        }

        while ( !getSearchResult().hasMoreElements() ) {
          return null;
        }
      } else {
        // User do not want to use paging
        // we have already returned all the result
        return null;
      }
    }

    try {
      SearchResult searchResult = getSearchResult().next();
      Attributes results = searchResult.getAttributes();
      results.put( "dn", searchResult.getNameInNamespace() );
      return results;
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString( PKG, "LDAPConnection.Exception.GettingAttributes" ), e );
    }
  }

  private InitialLdapContext getInitialContext() {
    return protocol.getCtx();
  }

  private SearchControls getSearchControls() {
    return this.controls;
  }

  private NamingEnumeration<SearchResult> getSearchResult() {
    return this.results;
  }

  /**
   * Remove CR and LF from filter string
   *

View on GitHub (pinned to f3058517a1)