Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-M9 (2.0.0.v20150606-M9), 2.0.0-M12
    • Fix Version/s: 2.0.0-M13
    • Component/s: None
    • Labels:
      None
    • Environment:

      Description

      I've been using Apache Directory Studio with referrals for a long time, but it seems that they've broken from v1.5.4 -> v2. I've validated this behavior against v2.0.0-M9 and v2.0.0-M12.

      I get this when trying to do any create / modify / delete action after I've been connected. I have many LDAP slaves which all refer to a single master, and I have a profile the read-only slaves and for the single write master.

      On version 1.5.4, using the exact same servers and connection settings, I get a popup dialog box when trying to make a chance which lets me select the referral server. I select my write server, and it works.

      When I try to create a new entry or make a modification, I get this stack trace:
      Error while creating entry

      • [LDAP: error code 10 - Referral]
        java.lang.Exception: [LDAP: error code 10 - Referral]
        at org.apache.directory.studio.connection.core.io.api.DirectoryApiConnectionWrapper.checkResponse(DirectoryApiConnectionWrapper.java:1268)
        at org.apache.directory.studio.connection.core.io.api.DirectoryApiConnectionWrapper.access$9(DirectoryApiConnectionWrapper.java:1236)
        at org.apache.directory.studio.connection.core.io.api.DirectoryApiConnectionWrapper$6.run(DirectoryApiConnectionWrapper.java:918)
        at org.apache.directory.studio.connection.core.io.api.DirectoryApiConnectionWrapper.runAndMonitor(DirectoryApiConnectionWrapper.java:1163)
        at org.apache.directory.studio.connection.core.io.api.DirectoryApiConnectionWrapper.checkConnectionAndRunAndMonitor(DirectoryApiConnectionWrapper.java:1099)
        at org.apache.directory.studio.connection.core.io.api.DirectoryApiConnectionWrapper.createEntry(DirectoryApiConnectionWrapper.java:940)
        at org.apache.directory.studio.ldapbrowser.core.jobs.CreateEntryRunnable.createEntry(CreateEntryRunnable.java:225)
        at org.apache.directory.studio.ldapbrowser.core.jobs.CreateEntryRunnable.run(CreateEntryRunnable.java:124)
        at org.apache.directory.studio.connection.ui.RunnableContextRunner$1.run(RunnableContextRunner.java:116)
        at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)

      [LDAP: error code 10 - Referral]

      I've tried this with all three settings in Connection Settings -> Browser Options -> Referral Handling and it doesn't seem to have any effect. Is there anything else I can try to get this working, or any further debug information I can supply? I control the LDAP servers as well so it's easy for me to share information from that side as well.

        Activity

        Hide
        seelmann Stefan Seelmann added a comment - - edited

        I just checked, referral handling for write operations is not implemented in "Apache Directory LDAP API provider", only search continuations work. Can you please try to switch to JNDI connection provider (Connection properties -> Network tab -> Provider)?

        Show
        seelmann Stefan Seelmann added a comment - - edited I just checked, referral handling for write operations is not implemented in "Apache Directory LDAP API provider", only search continuations work. Can you please try to switch to JNDI connection provider (Connection properties -> Network tab -> Provider)?
        Hide
        elecharny Emmanuel Lecharny added a comment -

        Indeed. This is the last feature I want to add into LDAP API 1.0 before the GA. I may work on that this month, as it's really needed for Studio.

        Show
        elecharny Emmanuel Lecharny added a comment - Indeed. This is the last feature I want to add into LDAP API 1.0 before the GA. I may work on that this month, as it's really needed for Studio.
        Hide
        seelmann Stefan Seelmann added a comment -

        I don't think referral handling by the LDAP API is required for Studio. I think all we need in Studio is already there, that's the referal URLs that can be retrieved from LdapResult.getReferral(). In Studio we then ask the user to select the target connection by showing him a dialog. For search continuations that already works. But referral handling for write operations is currently just not implemented yet in the DirectoryApiConnectionWrapper class.

        Show
        seelmann Stefan Seelmann added a comment - I don't think referral handling by the LDAP API is required for Studio. I think all we need in Studio is already there, that's the referal URLs that can be retrieved from LdapResult.getReferral(). In Studio we then ask the user to select the target connection by showing him a dialog. For search continuations that already works. But referral handling for write operations is currently just not implemented yet in the DirectoryApiConnectionWrapper class.
        Hide
        elecharny Emmanuel Lecharny added a comment -

        You are right, but having it implemented in the API will make Studio works with referrals out of the box. This is already working with JNDI anyway...

        Show
        elecharny Emmanuel Lecharny added a comment - You are right, but having it implemented in the API will make Studio works with referrals out of the box. This is already working with JNDI anyway...
        Hide
        seelmann Stefan Seelmann added a comment -

        I agree it makes sense to implement it in the API. But for Studio I really don't want to use the automatic referral following. Even with JNDI the LdapContext is configured to always throw ReferralException and then we handle it manually, extract the URLs, ask the user for the target conection, preselect the connection that matches the referral URL, then remember the user's choise. That's also what we promise our users, that they "have full control regarding encryption and authentication options when following referrals", see https://directory.apache.org/studio/users-guide/ldap_browser/tools_connection_properties.html#tools_connection_properties_browser_options

        Show
        seelmann Stefan Seelmann added a comment - I agree it makes sense to implement it in the API. But for Studio I really don't want to use the automatic referral following. Even with JNDI the LdapContext is configured to always throw ReferralException and then we handle it manually, extract the URLs, ask the user for the target conection, preselect the connection that matches the referral URL, then remember the user's choise. That's also what we promise our users, that they "have full control regarding encryption and authentication options when following referrals", see https://directory.apache.org/studio/users-guide/ldap_browser/tools_connection_properties.html#tools_connection_properties_browser_options
        Hide
        elecharny Emmanuel Lecharny added a comment -

        Got it now. And, yes, you can live with the existing LDAP API, but you will have to add support for this programatically in Studio.

        Thanks Stefan !

        Show
        elecharny Emmanuel Lecharny added a comment - Got it now. And, yes, you can live with the existing LDAP API, but you will have to add support for this programatically in Studio. Thanks Stefan !
        Hide
        seelmann Stefan Seelmann added a comment -

        Identified two tests that fail with DirectoryApiConnectionWrapper: http://svn.apache.org/viewvc?rev=1769455&view=rev

        Show
        seelmann Stefan Seelmann added a comment - Identified two tests that fail with DirectoryApiConnectionWrapper: http://svn.apache.org/viewvc?rev=1769455&view=rev
        Show
        seelmann Stefan Seelmann added a comment - Fixed in http://svn.apache.org/viewvc?rev=1782686&view=rev and http://svn.apache.org/viewvc?rev=1783686&view=rev

          People

          • Assignee:
            seelmann Stefan Seelmann
            Reporter:
            trickv Patrick van Staveren
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development