If I try deleting a page where a post has been added via the API, I get an error
By Christian Scheuer @chrscheuer
Error 500 Internal Server Error
Something went wrong: [DwE500REX]
java.lang.RuntimeException: pageMeta.numPostsTotal is 3 but should be = postNr + 1 = 4 [EdE3PFK2W0]
at com.debiki.core.Prelude$.die(Prelude.scala:254)
at com.debiki.core.Prelude$.dieIf(Prelude.scala:274)
at debiki.dao.PagesDao.addMetaMessage(PagesDao.scala:793)
at debiki.dao.PagesDao.addMetaMessage$(PagesDao.scala:769)
at debiki.dao.SiteDao.addMetaMessage(SiteDao.scala:113)
at debiki.dao.PagesDao.$anonfun$deletePagesImpl$3(PagesDao.scala:763)
at debiki.dao.PagesDao.$anonfun$deletePagesImpl$3$adapted(PagesDao.scala:661)
at scala.Option$WithFilter.foreach(Option.scala:407)
at debiki.dao.PagesDao.$anonfun$deletePagesImpl$1(PagesDao.scala:661)
at debiki.dao.PagesDao.$anonfun$deletePagesImpl$1$adapted(PagesDao.scala:660)
at scala.collection.Iterator.foreach(Iterator.scala:943)
at scala.collection.Iterator.foreach$(Iterator.scala:943)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
at scala.collection.IterableLike.foreach(IterableLike.scala:74)
at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
at debiki.dao.PagesDao.deletePagesImpl(PagesDao.scala:660)
at debiki.dao.PagesDao.deletePagesImpl$(PagesDao.scala:648)
at debiki.dao.SiteDao.deletePagesImpl(SiteDao.scala:113)
at debiki.dao.PagesDao.$anonfun$deletePagesIfAuth$1(PagesDao.scala:642)
at debiki.dao.PagesDao.$anonfun$deletePagesIfAuth$1$adapted(PagesDao.scala:637)
at debiki.dao.SiteDao.$anonfun$writeTx$2(SiteDao.scala:262)
at debiki.dao.SiteDao.$anonfun$readWriteTransaction$2(SiteDao.scala:302)
at com.debiki.core.DbDao2.readWriteSiteTransaction(DbDao2.scala:67)
at debiki.dao.SiteDao.$anonfun$readWriteTransaction$1(SiteDao.scala:302)
at debiki.dao.SiteDao$.siteWriteLockIdImpl(SiteDao.scala:814)
at debiki.dao.SiteDao$.$anonfun$withSiteWriteLock$1(SiteDao.scala:803)
at debiki.dao.SystemDao$.withWholeDbReadLock(SystemDao.scala:876)
at debiki.dao.SiteDao$.withSiteWriteLock(SiteDao.scala:803)
at debiki.dao.SiteDao.readWriteTransaction(SiteDao.scala:301)
at debiki.dao.SiteDao.writeTx(SiteDao.scala:278)
at debiki.dao.SiteDao.writeTx(SiteDao.scala:249)
at debiki.dao.PagesDao.deletePagesIfAuth(PagesDao.scala:637)
at debiki.dao.PagesDao.deletePagesIfAuth$(PagesDao.scala:635)
at debiki.dao.SiteDao.deletePagesIfAuth(SiteDao.scala:113)
at controllers.PageController.$anonfun$deletePages$1(PageController.scala:263)
at scala.Function1.$anonfun$andThen$1(Function1.scala:57)
at talkyard.server.http.PlainApiActions$$anon$1.runBlockIfAuthOk(PlainApiActions.scala:699)
at talkyard.server.http.PlainApiActions$$anon$1.invokeBlockAuthViaCookie(PlainApiActions.scala:447)
at talkyard.server.http.PlainApiActions$$anon$1.invokeBlockImpl(PlainApiActions.scala:250)
at talkyard.server.http.PlainApiActions$$anon$1.invokeBlock(PlainApiActions.scala:136)
at talkyard.server.http.PlainApiActions$$anon$1.invokeBlock(PlainApiActions.scala:109)
at play.api.mvc.ActionBuilder$$anon$9.apply(Action.scala:379)
at talkyard.server.http.PlainApiActions$$anon$1.$anonfun$composeAction$1(PlainApiActions.scala:123)
at talkyard.server.http.SafeActions$ExceptionAction$.invokeBlock(SafeActions.scala:126)
at talkyard.server.http.SafeActions$ExceptionAction$.invokeBlock(SafeActions.scala:83)
at play.api.mvc.ActionBuilder$$anon$9.apply(Action.scala:379)
at play.api.mvc.Action.$anonfun$apply$4(Action.scala:82)
at play.api.libs.streams.StrictAccumulator.$anonfun$mapFuture$4(Accumulator.scala:168)
at scala.util.Try$.apply(Try.scala:213)
at play.api.libs.streams.StrictAccumulator.$anonfun$mapFuture$3(Accumulator.scala:168)
at scala.Function1.$anonfun$andThen$1(Function1.scala:57)
at scala.Function1.$anonfun$andThen$1(Function1.scala:57)
at play.api.libs.streams.StrictAccumulator.run(Accumulator.scala:200)
at play.core.server.AkkaHttpServer.$anonfun$runAction$4(AkkaHttpServer.scala:418)
at akka.http.scaladsl.util.FastFuture$.strictTransform$1(FastFuture.scala:41)
at akka.http.scaladsl.util.FastFuture$.$anonfun$transformWith$3(FastFuture.scala:51)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:63)
at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:100)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:85)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:100)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:49)
at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:48)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
- CChristian Scheuer @chrscheuer
cc @KajMagnus
This happens when our bot user replied to a page that was created - see here for an example:
https://forum.soundflow.org/-7361/test-questionIf I try to delete that page, I'll get the error seen above.
I can work around the issue by manually adding another post (which fixes the database) and then delete the page. Just thought this was worth pointing out