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

Emmanuel Lecharny commented on DIRSERVER-2144:
----------------------------------------------

Outdated.

The latest trunk as an added command : {{java -jar UberMain.jar <path to your 
configuration> REPAIR}} that should work.

There is a unit test class that check the repair process :

{noformat}
    /**
     * Tests the repair of an existing ApacheDS Service instance.
     *
     * @throws Exception
     */
    @Test
    public void repairTest() throws Exception
    {   
        // First start the server to initialize the example partition 
        Thread connectionVerificationThread = createServer();
        
        // Starting the connection verification thread
        // and waiting for the termination of it
        connectionVerificationThread.start();
        connectionVerificationThread.join();

        // Checking if verification is successful
        if ( !verified )
        {
            fail();
        }
        
        // Add a few entries to create a more complex hierarchy
        // We will have :
        // dc=example,dc=com
        //    ou=people
        //      ou=committers
        //        cn=emmanuel
        //        cn=kiran
        //        cn=stefan
        //        cn=radovan
        //      ou=pmcs
        //        cn=emmanuel
        //        cn=kiran
        //        cn=stefan
        //   ou=groups
        //     cn=users
        LdapConnection connection = createConnection();
        
        // First level
        Entry people = new DefaultEntry( 
            "ou=People,dc=example,dc=com",
            "objectClass: organizationalUnit",
            "objectClass: top",
            "ou: People"
            );
        
        connection.add( people );
        
        Entry groups = new DefaultEntry( 
            "ou=Groups,dc=example,dc=com",
            "objectClass: organizationalUnit",
            "objectClass: top",
            "ou: Groups"
            );
        
        connection.add( groups );
        
        // Second level
        Entry committers  = new DefaultEntry( 
            "ou=Committers,ou=people,dc=example,dc=com",
            "objectClass: organizationalUnit",
            "objectClass: top",
            "ou: Committers"
            );

        connection.add( committers );

        Entry pmcs  = new DefaultEntry( 
            "ou=Pmcs,ou=people,dc=example,dc=com",
            "objectClass: organizationalUnit",
            "objectClass: top",
            "ou: Pmcs"
            );

        connection.add( pmcs );

        Entry users  = new DefaultEntry( 
            "ou=Users,ou=people,dc=example,dc=com",
            "objectClass: organizationalUnit",
            "objectClass: top",
            "ou: Users"
            );

        connection.add( users );

        // Third level, committers
        Entry emmanuelCommitter  = new DefaultEntry( 
            "cn=emmanuel,ou=Committers,ou=people,dc=example,dc=com",
            "objectClass: person",
            "objectClass: top",
            "cn: emmanuel",
            "sn: Emmanuel Lecharny"
            );

        connection.add( emmanuelCommitter );

        Entry kiranCommitter  = new DefaultEntry( 
            "cn=kiran,ou=Committers,ou=people,dc=example,dc=com",
            "objectClass: person",
            "objectClass: top",
            "cn: kiran",
            "sn: Kiran Ayyagari"
            );

        connection.add( kiranCommitter );

        Entry stefanCommitter  = new DefaultEntry( 
            "cn=stefan,ou=Committers,ou=people,dc=example,dc=com",
            "objectClass: person",
            "objectClass: top",
            "cn: stefan",
            "sn: Stefan Seelmann"
            );

        connection.add( stefanCommitter );
        
        Entry radovanCommitter  = new DefaultEntry( 
            "cn=radovan,ou=Committers,ou=people,dc=example,dc=com",
            "objectClass: person",
            "objectClass: top",
            "cn: radovan",
            "sn: Radovan Semancik"
            );

        connection.add( radovanCommitter );

        // Third level, PMCs
        Entry emmanuelPmc = new DefaultEntry( 
            "cn=emmanuel,ou=Pmcs,ou=people,dc=example,dc=com",
            "objectClass: person",
            "objectClass: top",
            "cn: emmanuel",
            "sn: Emmanuel Lecharny"
            );

        connection.add( emmanuelPmc );

        Entry kiranPmc = new DefaultEntry( 
            "cn=kiran,ou=Pmcs,ou=people,dc=example,dc=com",
            "objectClass: person",
            "objectClass: top",
            "cn: kiran",
            "sn: Kiran Ayyagari"
            );

        connection.add( kiranPmc );

        Entry stefanPmc = new DefaultEntry( 
            "cn=stefan,ou=Pmcs,ou=people,dc=example,dc=com",
            "objectClass: person",
            "objectClass: top",
            "cn: stefan",
            "sn: Stefan Seelmann"
            );

        connection.add( stefanPmc );
        
        // Now, check that we have 13 entries
        int entryCount = 0;
        
        EntryCursor cursor = connection.search( "dc=example, 
dc=com","(ObjectClass=*)", SearchScope.SUBTREE, "*" );
        
        while ( cursor.next() )
        {
            cursor.get();
            entryCount++;
        }
        
        assertEquals( 13, entryCount );

        // Stop the server
        uberjarMain.stop();

        // Try to repair it
        uberjarMain.repair( instanceDirectory.toString() );

        // Stop the server again
        uberjarMain.stop();
        
        // And restart it
        connectionVerificationThread = createServer();
        
        // Starting the connection verification thread
        // and waiting for the termination of it
        connectionVerificationThread.start();
        connectionVerificationThread.join();

        // Checking if verification is successful
        if ( !verified )
        {
            fail();
        }

        // Check the content
        connection = createConnection();

        entryCount = 0;
        
        cursor = connection.search( "dc=example, dc=com","(ObjectClass=*)", 
SearchScope.SUBTREE, "*" );
        
        while ( cursor.next() )
        {
            cursor.get();
            entryCount++;
        }
        
        assertEquals( 13, entryCount );
    }
{noformat}

> Role Disappreared
> -----------------
>
>                 Key: DIRSERVER-2144
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-2144
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 2.0.0-M16
>            Reporter: Siddharth Thakar
>
> I have very strange problem on my production environment.
> There was below entry present and lots of users were assigned to group 
> GEBRUIKER, suddenly group GEBRUIKER disappeared and all users belongs to that 
> group no longer able to login to the system.
> cn=GEBRUIKER,ou=roles,ou=groups,dc=lgronline,dc=nl
> When I try to create the group again it gives me error 
> #!ERROR ENTRY_ALREADY_EXISTS: failed for MessageType : ADD_REQUEST Message ID 
> : 25     Add Request : Entry     dn[n]: 
> cn=GEBRUIKER,ou=roles,ou=groups,dc=lgronline,dc=nl     objectclass: 
> organizationalRole     objectclass: top     cn: GEBRUIKER     description: 
> ERR_250_ENTRY_ALREADY_EXISTS 
> cn=GEBRUIKER,ou=roles,ou=groups,dc=lgronline,dc=nl already exists!
> dn: cn=GEBRUIKER,ou=roles,ou=groups,dc=lgronline,dc=nl
> changetype: add
> Please someone help to resolve this issue.
> I even restored that /var/lib/apacheds-2.0.0-M16 directory from last month 
> hoping that user might have done some wrong and one month old restore will 
> fix the issue, however issue is still there, not getting any help online as 
> well.
> SOS



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

Reply via email to