Omkar Shisode
Omkar Shisode

Reputation: 9

Duplicate expiration column in the couchbase schema

I got one issue on the Firebase crash-analytics where it showing the duplicate column name "expiration" this is document expiration time that is set at the time of the document save, as per the exception it throw exception at the time of the collection create.

In my code i check if the collection is already exist then use that collection, but i am not going to create the same collection again still getting the below exception

Caused by com.couchbase.lite.LiteCoreException: duplicate column name: expiration -- ALTER TABLE "kv_.\Events\Logs\Scope.\Event\Logs\Collection" ADD COLUMN expiration INTEGER; CREATE INDEX "kv_.\Events\Logs\Scope.\Event\Logs\Collection_expiration" ON "kv_.\Events\Logs\Scope.\Event\Logs\Collection" (expiration) WHERE expiration not null at com.couchbase.lite.internal.core.impl.NativeC4Collection.createCollection(NativeC4Collection.java) at com.couchbase.lite.internal.core.impl.NativeC4Collection.nCreateCollection(NativeC4Collection.java) at com.couchbase.lite.internal.core.C4Collection.create(C4Collection.java:6) at com.couchbase.lite.internal.core.C4Collection.create(C4Collection.java:2) at com.couchbase.lite.internal.core.C4Database.addCollection(C4Database.java) at com.couchbase.lite.AbstractDatabase.addC4Collection(AbstractDatabase.java:9) at com.couchbase.lite.Collection.createCollection(Collection.java:2) at com.couchbase.lite.AbstractDatabase.createCollection(AbstractDatabase.java:16) at ma.dista.repository.storage.CouchbaseStorage.create(CouchbaseStorage.java:33) at ma.dista.repository.MetaLayer.create(MetaLayer.java:42) at ma.dista.repository.repositories.EventLoggerRepository.(EventLoggerRepository.java:45) at ma.dista.repository.repositories.EventLoggerRepository$Companion.getInstance(EventLoggerRepository.java:2) at ma.dista.repository.RepositoryProvider.getEventLoggerRepository(RepositoryProvider.java:2) at ma.dista.activities.newClientDiscovery.ClientDiscoveryActivity$invokeClientDiscoveryLoadEvent$1.invokeSuspend(ClientDiscoveryActivity.java:12) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(BaseContinuationImpl.java:11) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.java:88) at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.java:12) at kotlinx.coroutines.scheduling.TaskImpl.run(TaskImpl.java:2) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.java) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.java:14) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.java:28) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.java)

I want to find the actual cause of this issue without checking the that expiration column exist or not because i did't create the same collection again

Upvotes: 0

Views: 75

Answers (1)

G. Blake Meike
G. Blake Meike

Reputation: 6715

This is probably a data race in the way we handle the creation of the expiration column.

I have created https://issues.couchbase.com/browse/CBL-6131 to track the issue.

EDITED: The ticket is now here: https://jira.issues.couchbase.com/browse/CBL-6131

Upvotes: 1

Related Questions