No internet connection
  1. Home
  2. Issues

Error trying to change site name

By Adrián López @adrianlzt
    2019-10-02 16:00:21.741Z

    In Admin area -> Settings -> Site, when I try to set a new address this error is show:

    Error 500 Internal Server Error
    Something went wrong: [DwE500REX]
    
    java.lang.RuntimeException: This statement modified 0 rows but should have touched exactly one row: 
          update hosts3 set canonical = 'D'
          where site_id = ? and canonical = 'C'
           [DwE8FUM1]
    	at com.debiki.core.Prelude$.die(Prelude.scala:138)
    	at com.debiki.core.Prelude$.dieIf(Prelude.scala:152)
    	at com.debiki.dao.rdb.RdbSiteTransaction.runUpdateExactlyOneRow(RdbSiteTransaction.scala:296)
    	at com.debiki.dao.rdb.RdbSiteTransaction.changeCanonicalHostRoleToExtra(RdbSiteTransaction.scala:776)
    	at debiki.dao.SiteDao.$anonfun$changeSiteHostname$1(SiteDao.scala:332)
    	at debiki.dao.SiteDao.$anonfun$changeSiteHostname$1$adapted(SiteDao.scala:324)
    	at debiki.dao.SiteDao.$anonfun$readWriteTransaction$2(SiteDao.scala:175)
    	at com.debiki.core.DbDao2.readWriteSiteTransaction(DbDao2.scala:67)
    	at debiki.dao.SiteDao.$anonfun$readWriteTransaction$1(SiteDao.scala:175)
    	at debiki.dao.SiteDao$.synchronizeOnSiteId(SiteDao.scala:471)
    	at debiki.dao.SiteDao.readWriteTransaction(SiteDao.scala:174)
    	at debiki.dao.SiteDao.changeSiteHostname(SiteDao.scala:324)
    	at controllers.SettingsController.$anonfun$changeHostname$1(SettingsController.scala:76)
    	at scala.Function1.$anonfun$andThen$1(Function1.scala:57)
    	at ed.server.http.PlainApiActions$$anon$1.runBlockIfAuthOk(PlainApiActions.scala:422)
    	at ed.server.http.PlainApiActions$$anon$1.invokeBlockAuthViaCookie(PlainApiActions.scala:244)
    	at ed.server.http.PlainApiActions$$anon$1.invokeBlock(PlainApiActions.scala:133)
    	at ed.server.http.PlainApiActions$$anon$1.invokeBlock(PlainApiActions.scala:91)
    	at play.api.mvc.ActionBuilder$$anon$10.apply(Action.scala:425)
    	at ed.server.http.PlainApiActions$$anon$1.$anonfun$composeAction$1(PlainApiActions.scala:105)
    	at ed.server.http.SafeActions$ExceptionAction$.invokeBlock(SafeActions.scala:115)
    	at ed.server.http.SafeActions$ExceptionAction$.invokeBlock(SafeActions.scala:82)
    	at play.api.mvc.ActionBuilder$$anon$10.apply(Action.scala:425)
    	at play.api.mvc.Action.$anonfun$apply$2(Action.scala:97)
    	at play.api.libs.streams.StrictAccumulator.$anonfun$mapFuture$4(Accumulator.scala:183)
    	at scala.util.Try$.apply(Try.scala:213)
    	at play.api.libs.streams.StrictAccumulator.$anonfun$mapFuture$3(Accumulator.scala:183)
    	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:222)
    	at play.core.server.AkkaHttpServer.$anonfun$runAction$4(AkkaHttpServer.scala:427)
    	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:55)
    	at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:91)
    	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:91)
    	at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40)
    	at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:44)
    	at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    	at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
    	at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    	at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
    

    I have checked the database and it is empty:

    talkyard=# select * from hosts3;
     site_id | host | canonical | ctime | mtime
    ---------+------+-----------+-------+-------
    (0 rows)
    

    My deploy is using docker-compose with automatic upgrades. I think the first version was v0.6.43-b2528e2, but I'm not sure because previous VM broke and we recovered a backup.

    • 1 replies
    1. You can do this:

      Since you've installed on your own server, you change the hostname by editing /opt/talkyard/conf/play-framework.conf,
      and setting: talkyard.hostname="forum.yourcompany.com"

      and then restart:

      cd /opt/talkyard/
      docker-compose kill app
      docker-compose start app
      

      The exception is because of a bug: I've added a too strict runtime assertion. I'll remove it, and thereafter, changing the hostname via the admin pages, like you tried to do, will work too.

      1. Progress
        with handling this problem
      2. A@adrianlzt marked this topic as Done 2019-10-03 07:52:46.106Z.