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_.EventsLogsScope.EventLogsCollection” ADD COLUMN expiration INTEGER; CREATE INDEX “kv_.EventsLogsScope.EventLogsCollection_expiration” ON “kv_.EventsLogsScope.EventLogsCollection” (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
Omkar Shisode is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.