You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by "Selvamohan Neethiraj (JIRA)" <ji...@apache.org> on 2015/03/23 05:50:11 UTC

[jira] [Commented] (RANGER-216) Ranger UserSync properties using quotes as literals causing Java exceptions

    [ https://issues.apache.org/jira/browse/RANGER-216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14375390#comment-14375390 ] 

Selvamohan Neethiraj commented on RANGER-216:
---------------------------------------------

[~harisekhon]  Thanks for identifying the issue related to the install.properties.  If you would like to contribute by providing a patch for this issue, please send the dev group via an email to dev@ranger.incubator.apache.org 


> Ranger UserSync properties using quotes as literals causing Java exceptions
> ---------------------------------------------------------------------------
>
>                 Key: RANGER-216
>                 URL: https://issues.apache.org/jira/browse/RANGER-216
>             Project: Ranger
>          Issue Type: Bug
>    Affects Versions: 0.4.0
>         Environment: HDP 2.2
>            Reporter: Hari Sekhon
>            Priority: Minor
>
> In install.properties quoting the ldap url
> {code}SYNC_LDAP_URL = "ldap://host.domain.com:389"{code}
> results in the following Java exception in /var/log/ranger/usersync/usersync.log:
> {code}java.lang.NumberFormatException: For input string: "389""
>         at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
>         at java.lang.Integer.parseInt(Integer.java:492)
>         at java.lang.Integer.parseInt(Integer.java:527)
>         at com.sun.jndi.toolkit.url.Uri.parse(Uri.java:232)
>         at com.sun.jndi.toolkit.url.Uri.init(Uri.java:138)
>         at com.sun.jndi.ldap.LdapURL.<init>(LdapURL.java:85)
>         at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:164)
>         at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:211)
>         at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:154)
>         at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:84)
>         at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
>         at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
>         at javax.naming.InitialContext.init(InitialContext.java:242)
>         at javax.naming.ldap.InitialLdapContext.<init>(InitialLdapContext.java:153)
>         at com.xasecure.ldapusersync.process.LdapUserGroupBuilder.createLdapContext(LdapUserGroupBuilder.java:121)
>         at com.xasecure.ldapusersync.process.LdapUserGroupBuilder.updateSink(LdapUserGroupBuilder.java:185)
>         at com.xasecure.usergroupsync.UserGroupSync.run(UserGroupSync.java:59)
>         at java.lang.Thread.run(Thread.java:745)
> {code}
> Since xa_ldap_url in ranger-admin's install.properties is quoted in the example in that file and seems to work it's natural that the next step of configuring usersync should also handle quoted values and do basic stripping as standard.
> Removing quotes around LDAP URL the next exception occurs as expected too:
> {code}javax.naming.AuthenticationException: [LDAP: error code 32 - No Such Object]
>         at com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:293)
>         at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2740)
>         at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:316)
>         at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:193)
>         at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:211)
>         at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:154){code}
> At which point I removed all quotes from all settings to resolve these exceptions.
> Regards,
> Hari Sekhon
> http://www.linkedin.com/in/harisekhon



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)