{"record":{"id":"1915d5bff22d671a","repo":"pentaho/pentaho-kettle","slug":"ldapinput-exception-errorpaging","errorCode":"LDAPInput.Exception.ErrorPaging","errorMessage":"LDAPInput.Exception.ErrorPaging","messagePattern":"LDAPInput\\.Exception\\.ErrorPaging","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/ldap/impl/src/main/java/org/pentaho/di/trans/steps/ldapinput/LDAPConnection.java","lineNumber":578,"sourceCode":"          // pass the cookie back for the next page\n          if ( isSortingAttributes() ) {\n            getInitialContext().setRequestControls(\n              new Control[] {\n                new SortControl( getSortingAttributesKeys(), Control.NONCRITICAL ),\n                new PagedResultsControl( GetPagingSize(), cookie, Control.CRITICAL ) } );\n          } else {\n            getInitialContext().setRequestControls(\n              new Control[] { new PagedResultsControl( GetPagingSize(), cookie, Control.CRITICAL ) } );\n          }\n          if ( ( cookie != null ) && ( cookie.length != 0 ) ) {\n            // get search result for the page\n            this.results = getInitialContext().search( getSearchBase(), getFilter(), getSearchControls() );\n          } else {\n            return null;\n          }\n\n        } catch ( Exception e ) {\n          throw new KettleException( BaseMessages.getString( PKG, \"LDAPInput.Exception.ErrorPaging\" ), e );\n        }\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 ) {","sourceCodeStart":560,"sourceCodeEnd":596,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/ldap/impl/src/main/java/org/pentaho/di/trans/steps/ldapinput/LDAPConnection.java#L560-L596","documentation":"LDAPConnection.getAttributes() wraps the LDAP search execution (InitialLdapContext.search with search base, filter and SearchControls) in a KettleException when paging-based search setup fails. It means the directory search itself could not be performed, e.g. bad search base DN, invalid filter syntax, or directory connection/protocol errors. The underlying LDAP exception is preserved as the cause.","triggerScenarios":"Calling getAttributes() (typically via getFields()) when the connection uses paging and getInitialContext().search(searchBase, filter, searchControls) throws; also returned as null when no search result elements exist.","commonSituations":"Typo in the search base DN (e.g. missing 'dc=' component), malformed LDAP filter like '(objectClass' (unbalanced parenthesis), anonymous bind on a directory that forbids it, or the base DN not existing in the directory.","solutions":["Verify the search base DN exists in the directory (test with ldapsearch -b <base>).","Validate the LDAP filter syntax; a filter must be fully parenthesized, e.g. (objectClass=person).","Confirm the bind user/password and protocol settings (SSL port vs plain) in the LDAP Input step.","Inspect the chained cause exception (e) for the precise javax.naming error code."],"exampleFix":"// before\nsetFilter(\"(objectClass\");\n// after\nsetFilter(\"(objectClass=inetOrgPerson)\");","handlingStrategy":"try-catch","validationCode":"// before running the step\nif (searchBase == null || !searchBase.contains(\"=\")) throw new IllegalArgumentException(\"Invalid search base DN: \" + searchBase);\nif (filter != null && !filter.startsWith(\"(\") ) throw new IllegalArgumentException(\"LDAP filter must be parenthesized: \" + filter);","typeGuard":null,"tryCatchPattern":"try { results = conn.getAttributes(); } catch (KettleException e) { logError(\"LDAP search failed: \" + e.getCause().getMessage(), e); throw e; }","preventionTips":["Test search base and filter with ldapsearch before configuring the step","Always fully parenthesize LDAP filters","Validate bind credentials with a simple anonymous or authenticated bind test"],"tags":["ldap","search","network"],"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"}