Adding more detail to my question:

The following is what I see when I perform sync-ldap consecutively.
*The very 1st call:*
>>ambari-server sync-ldap --all

*Result:*
Using python  /usr/bin/python2
Syncing with LDAP...
Enter Ambari Admin login: admin
Enter Ambari Admin password:
Syncing all...

Completed LDAP Sync.
Summary:
  memberships:
    removed = 0
    created = 0
  users:
    updated = 0
    removed = 0
    created = 0
  groups:
    updated = 0
    removed = 0
    created = 2

Ambari Server 'sync-ldap' completed successfully.




*The 2nd time I call:*
>>ambari-server sync-ldap --all

*Result:*
Using python  /usr/bin/python2
Syncing with LDAP...
Enter Ambari Admin login: admin
Enter Ambari Admin password:
Syncing all...ERROR: Exiting with exit code 1.
REASON: Caught exception running LDAP sync. Exception [EclipseLink-4002]
(Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd):
org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.BatchUpdateException: Batch entry 0 INSERT
INTO groups (group_id, group_name, ldap_group, principal_id) VALUES (524,
'sheetsg9', 1, 5527) was aborted.  Call getNextException to see the cause.
Error Code: 0
Call: INSERT INTO groups (group_id, group_name, ldap_group, principal_id)
VALUES (?, ?, ?, ?)
    bind => [4 parameters bound]



The only difference I found with the LDAP group "sheetsg9" when compared to
the other LDAP groups was that *it had no users associated with it.*
The workaround involves deleting that group from the "groups" table in the
DB and syncing again. The sync goes through fine after that.

Is this the expected behavior of "sync-ldap --all" or is the case of
handling groups with no users not handled properly?

On Thu, Feb 18, 2016 at 3:27 PM, Keta Patel <
[email protected]> wrote:

> Hello all,
> What is the expected behavior of "ambari-server sync-ldap --all" on the
> 2nd or later calls?
>
> Thank you!
> Keta
>

Reply via email to