Re: ApacheDS db corrupt

2019-07-23 Thread Emmanuel Lécharny

Hi Sergey,

On 23/07/2019 09:25, Sergey Mikhno wrote:

Hi Emmanuel,

Our problem is that the database became corrupt and we don't know how 
to repair it. We have tried to use apacheds.sh default repair and the 
utility says that repair went successfully but it didn't help with our 
problem.

Our ApacheDS version is 2.0.0.AM24
There are a few bugs reported with a similar problem. Could you please 
advice on how to fix out problem



Sadly, there is no way to fix the problem with the released version. The 
'repair' option will fix it most of the time, but it may happen that the 
database get corrupted beyond repair.


The coming release is suppose to fix this problem. Basically, in all the 
released versions we weren't guaranteeing operations atomicity: when you 
do a add/delete/modify, many BTree get updated. In some cases, we may 
end in a situation where some of those BTrees get updated, but other 
not, leaving the database in a bad state. We have added a transaction 
support around operations that is expecting to either commit the whole 
modifications in one shot, or rollback it.



I do expect to have it released in the coming weeks.


In the mean time, the only solution is to export the data and reimport them.


I'm sorry for that.



During last week we have experienced a following problem:
1. When searching for uid we get an answer that uid doesn't exist, but 
when we try to create a uid with the same number the answer is the uid 
already exists.
2. We have an alarming error message in log WARN  [pool-5-thread-4] 
org.apache.directory.server.ldap.LdapProtocolHandler.exceptionCaught():236 
    - Unexpected exception forcing session to close: sending 
disconnect notice to client.


java.lang.Error: ERR_554 double get for block 134,207
at jdbm.recman.RecordFile.get(RecordFile.java:185)
at 
jdbm.recman.PhysicalRowIdManager.allocNew(PhysicalRowIdManager.java:202)

at jdbm.recman.PhysicalRowIdManager.alloc(PhysicalRowIdManager.java:177)
at jdbm.recman.PhysicalRowIdManager.update(PhysicalRowIdManager.java:101)
at jdbm.recman.BaseRecordManager.update(BaseRecordManager.java:281)
at 
jdbm.recman.CacheRecordManager.updateCacheEntries(CacheRecordManager.java:417)

at jdbm.recman.CacheRecordManager.commit(CacheRecordManager.java:349)
at 
org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex.sync(JdbmIndex.java:590)
at 
org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition.sync(JdbmPartition.java:567)
at 
org.apache.directory.server.core.partition.impl.btree.AbstractBTreePartition.modify(AbstractBTreePartition.java:1580)
at 
org.apache.directory.server.core.partition.impl.btree.AbstractBTreePartition.modify(AbstractBTreePartition.java:1523)
at 
org.apache.directory.server.core.shared.partition.DefaultPartitionNexus.modify(DefaultPartitionNexus.java:491)
at 
org.apache.directory.server.core.api.interceptor.BaseInterceptor$1.modify(BaseInterceptor.java:170)
at 
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:506)
at 
org.apache.directory.server.core.journal.JournalInterceptor.modify(JournalInterceptor.java:229)
at 
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:506)
at 
org.apache.directory.server.core.trigger.TriggerInterceptor.modify(TriggerInterceptor.java:370)
at 
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:506)
at 
org.apache.directory.server.core.event.EventInterceptor.modify(EventInterceptor.java:298)
at 
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:506)
at 
org.apache.directory.server.core.subtree.SubentryInterceptor.modify(SubentryInterceptor.java:1220)
at 
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:506)
at 
org.apache.directory.server.core.collective.CollectiveAttributeInterceptor.modify(CollectiveAttributeInterceptor.java:165)
at 
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:506)
at 
org.apache.directory.server.core.operational.OperationalAttributeInterceptor.modify(OperationalAttributeInterceptor.java:449)
at 
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:506)
at 
org.apache.directory.server.core.schema.SchemaInterceptor.modify(SchemaInterceptor.java:1206)
at 
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:506)
at 
org.apache.directory.server.core.hash.ConfigurableHashingInterceptor.modify(ConfigurableHashingInterceptor.java:185)
at 
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:506)
at 
org.apache.directory.server.core.exception.ExceptionInterceptor.modify(ExceptionInterceptor.java:252)
at 
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:506)
at 
org.apache.directory.server.core.admin.AdministrativePointInterceptor.modify(Admi

ApacheDS db corrupt

2019-07-23 Thread Sergey Mikhno
Hi Emmanuel,

Our problem is that the database became corrupt and we don't know how to
repair it. We have tried to use apacheds.sh default repair and the utility
says that repair went successfully but it didn't help with our problem.
Our ApacheDS version is 2.0.0.AM24
There are a few bugs reported with a similar problem. Could you please
advice on how to fix out problem

During last week we have experienced a following problem:
1. When searching for uid we get an answer that uid doesn't exist, but when
we try to create a uid with the same number the answer is the uid already
exists.
2. We have an alarming error message in log WARN  [pool-5-thread-4]
org.apache.directory.server.ldap.LdapProtocolHandler.exceptionCaught():236
- Unexpected exception forcing session to close: sending disconnect
notice to client.

java.lang.Error: ERR_554 double get for block 134,207
at jdbm.recman.RecordFile.get(RecordFile.java:185)
at jdbm.recman.PhysicalRowIdManager.allocNew(PhysicalRowIdManager.java:202)
at jdbm.recman.PhysicalRowIdManager.alloc(PhysicalRowIdManager.java:177)
at jdbm.recman.PhysicalRowIdManager.update(PhysicalRowIdManager.java:101)
at jdbm.recman.BaseRecordManager.update(BaseRecordManager.java:281)
at
jdbm.recman.CacheRecordManager.updateCacheEntries(CacheRecordManager.java:417)
at jdbm.recman.CacheRecordManager.commit(CacheRecordManager.java:349)
at
org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex.sync(JdbmIndex.java:590)
at
org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition.sync(JdbmPartition.java:567)
at
org.apache.directory.server.core.partition.impl.btree.AbstractBTreePartition.modify(AbstractBTreePartition.java:1580)
at
org.apache.directory.server.core.partition.impl.btree.AbstractBTreePartition.modify(AbstractBTreePartition.java:1523)
at
org.apache.directory.server.core.shared.partition.DefaultPartitionNexus.modify(DefaultPartitionNexus.java:491)
at
org.apache.directory.server.core.api.interceptor.BaseInterceptor$1.modify(BaseInterceptor.java:170)
at
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:506)
at
org.apache.directory.server.core.journal.JournalInterceptor.modify(JournalInterceptor.java:229)
at
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:506)
at
org.apache.directory.server.core.trigger.TriggerInterceptor.modify(TriggerInterceptor.java:370)
at
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:506)
at
org.apache.directory.server.core.event.EventInterceptor.modify(EventInterceptor.java:298)
at
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:506)
at
org.apache.directory.server.core.subtree.SubentryInterceptor.modify(SubentryInterceptor.java:1220)
at
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:506)
at
org.apache.directory.server.core.collective.CollectiveAttributeInterceptor.modify(CollectiveAttributeInterceptor.java:165)
at
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:506)
at
org.apache.directory.server.core.operational.OperationalAttributeInterceptor.modify(OperationalAttributeInterceptor.java:449)
at
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:506)
at
org.apache.directory.server.core.schema.SchemaInterceptor.modify(SchemaInterceptor.java:1206)
at
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:506)
at
org.apache.directory.server.core.hash.ConfigurableHashingInterceptor.modify(ConfigurableHashingInterceptor.java:185)
at
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:506)
at
org.apache.directory.server.core.exception.ExceptionInterceptor.modify(ExceptionInterceptor.java:252)
at
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:506)
at
org.apache.directory.server.core.admin.AdministrativePointInterceptor.modify(AdministrativePointInterceptor.java:1453)
at
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:506)
at
org.apache.directory.server.core.authz.DefaultAuthorizationInterceptor.modify(DefaultAuthorizationInterceptor.java:273)
at
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:506)
at
org.apache.directory.server.core.authz.AciAuthorizationInterceptor.modify(AciAuthorizationInterceptor.java:947)
at
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:506)
at
org.apache.directory.server.core.referral.ReferralInterceptor.modify(ReferralInterceptor.java:317)
at
org.apache.directory.server.core.api.interceptor.BaseInterceptor.next(BaseInterceptor.java:506)
at
org.apache.directory.server.core.authn.AuthenticationInterceptor.processPasswordPolicydModify(AuthenticationInterceptor.java:931)
at
org.apache.d