Closed toreanderson closed 6 years ago
Hi,
Cleaning out the workdir (./tmp by default) should fix any migration issues for the embedded database; migration works when I do a clean install. Are you sure the process has write access and there is space on the filesystem?
Thanks Tim
I have the following:
locations.workdir=/var/lib/rpki-validator/tmp
locations.datadir=/var/lib/rpki-validator
locations.rsyncdir=/var/lib/rpki-validator/rsync
When I start it up on a clean install, locations.datadir
exists and is writable by the user the validator runs as (but empty). The tmp
subdir is automatically created after I start it, but I still get the DbMigrate error.
By the way, I've found out that if I start up v2.22 from a clean slate and let it do the DbMigrate stuff successfully, I can then upgrade to v2.24 as long as I leave the contents of the data dirs intact.
I did a little bit more testing, and found that it fails even if I run it in my home directory with everything at defaults. Just untar and then ./rpki-validator.sh run
. However I saw now that there's an error being spat out to stdout as well (previously I just checked validator.log):
tore@rpki-validator:~/rpki-validator-app-2.24$ ./rpki-validator.sh run
[ warn ] JAVA_HOME is not set, will try to find java on path.
[ info ] Starting rpki-validator...
[ info ] writing logs under log directory
[ info ] Web user interface is available on port 8080
[ info ] Routers can connect on port 8282
[ERROR] [02/28/2018 08:59:18.574] [default-akka.actor.default-dispatcher-5] [TaskInvocation] Error executing statement at line 5: CALL DROP_TABLE_IF_EXISTS('RETRIEVED_OBJECTS')
com.googlecode.flyway.core.command.FlywaySqlScriptException: Error executing statement at line 5: CALL DROP_TABLE_IF_EXISTS('RETRIEVED_OBJECTS')
at com.googlecode.flyway.core.dbsupport.SqlScript.execute(SqlScript.java:92)
at com.googlecode.flyway.core.resolver.sql.SqlMigrationExecutor.execute(SqlMigrationExecutor.java:72)
at com.googlecode.flyway.core.command.DbMigrate$2.doInTransaction(DbMigrate.java:243)
at com.googlecode.flyway.core.command.DbMigrate$2.doInTransaction(DbMigrate.java:241)
at com.googlecode.flyway.core.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72)
at com.googlecode.flyway.core.command.DbMigrate.applyMigration(DbMigrate.java:241)
at com.googlecode.flyway.core.command.DbMigrate.access$700(DbMigrate.java:44)
at com.googlecode.flyway.core.command.DbMigrate$1.doInTransaction(DbMigrate.java:186)
at com.googlecode.flyway.core.command.DbMigrate$1.doInTransaction(DbMigrate.java:135)
at com.googlecode.flyway.core.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72)
at com.googlecode.flyway.core.command.DbMigrate.migrate(DbMigrate.java:135)
at com.googlecode.flyway.core.Flyway$1.execute(Flyway.java:872)
at com.googlecode.flyway.core.Flyway$1.execute(Flyway.java:819)
at com.googlecode.flyway.core.Flyway.execute(Flyway.java:1200)
at com.googlecode.flyway.core.Flyway.migrate(Flyway.java:819)
at net.ripe.rpki.validator.store.DataSources$.net$ripe$rpki$validator$store$DataSources$$migrate(DataSources.scala:87)
at net.ripe.rpki.validator.store.DataSources$DSSingletons$$anonfun$$init$$1.apply(DataSources.scala:47)
at net.ripe.rpki.validator.store.DataSources$DSSingletons$$anonfun$$init$$1.apply(DataSources.scala:43)
at net.ripe.rpki.validator.store.SimpleSingletons.apply(Storage.scala:80)
at net.ripe.rpki.validator.store.DataSources$.DurableDataSource(DataSources.scala:54)
at net.ripe.rpki.validator.store.DurableCaches$$anonfun$$init$$1.apply(CacheStore.scala:229)
at net.ripe.rpki.validator.store.DurableCaches$$anonfun$$init$$1.apply(CacheStore.scala:228)
at net.ripe.rpki.validator.store.SimpleSingletons.apply(Storage.scala:80)
at net.ripe.rpki.validator.store.DurableCaches$.apply(CacheStore.scala:231)
at net.ripe.rpki.validator.config.Main.net$ripe$rpki$validator$config$Main$$runValidator(Main.scala:171)
at net.ripe.rpki.validator.config.Main.net$ripe$rpki$validator$config$Main$$runValidator(Main.scala:162)
at net.ripe.rpki.validator.config.Main$$anonfun$1.apply$mcV$sp(Main.scala:135)
at akka.actor.DefaultScheduler$$anon$4.run(Scheduler.scala:161)
at akka.actor.DefaultScheduler$$anon$2$$anon$5.run(Scheduler.scala:172)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:137)
at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:506)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: java.sql.SQLSyntaxErrorException: The class 'net.ripe.rpki.validator.StoredProcedures' does not exist or is inaccessible. This can happen if the class is not public.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
at com.googlecode.flyway.core.dbsupport.JdbcTemplate.executeStatement(JdbcTemplate.java:230)
at com.googlecode.flyway.core.dbsupport.SqlScript.execute(SqlScript.java:90)
... 34 more
Caused by: ERROR 42X51: The class 'net.ripe.rpki.validator.StoredProcedures' does not exist or is inaccessible. This can happen if the class is not public.
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown Source)
... 45 more
Caused by: java.lang.ClassNotFoundException: net.ripe.rpki.validator.StoredProcedures : net/ripe/rpki/validator/StoredProcedures : Unsupported major.minor version 52.0
at org.apache.derby.impl.services.reflect.DatabaseClasses.loadApplicationClass(Unknown Source)
at org.apache.derby.iapi.services.loader.ClassInspector.getClass(Unknown Source)
at org.apache.derby.iapi.services.loader.ClassInspector.accessible(Unknown Source)
at org.apache.derby.impl.sql.compile.QueryTreeNode.verifyClassExist(Unknown Source)
at org.apache.derby.impl.sql.compile.StaticMethodCallNode.bindExpressionMinion(Unknown Source)
at org.apache.derby.impl.sql.compile.StaticMethodCallNode.bindExpression(Unknown Source)
at org.apache.derby.impl.sql.compile.JavaToSQLValueNode.bindExpression(Unknown Source)
at org.apache.derby.impl.sql.compile.CallStatementNode.bindStatement(Unknown Source)
at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown Source)
... 38 more
Same thing happens with v2.23, but not with v2.22.
For the record, I'm running Ubuntu 14.04.5 LTS with openjdk-7-jre-headless:amd64 version 7u151-2.6.11-2ubuntu0.14.04.1.
Hi Tore,
I looks this version requires java8 to run, despite readme file saying it "should" work with java7.
Could you give it a try with java8?
Otherwise I could try to compile a version that does not require java8.
Cheers, Oleg
Seems I'll need to upgrade to Ubuntu Xenial to get java8 (and java9), and I don't have time to do that right now. That said, v2.24 is running fine on Trusty with java7 for me right now, it's just provisioning it from scratch on that platform that doesn't work any more. So it's not high priority for me in any way. If you want to deal with this by simply amending the readme/release notes to point out java8 is now required, that's fine by me.
If you're not against using non-official PPAs, you could install java8 as described here: http://tecadmin.net/install-oracle-java-8-ubuntu-via-ppa
Alternatively you could grab JDK as a tarball from here: http://www.oracle.com/technetwork/java/javase/downloads/index.html, unpack it and point JAVA_HOME at it before starting the validator.
I just tested with Docker. Seems to work fine on Ubuntu Xenial with Java 8:
[root@sloth ~]# docker run -it -p 8080:8080 ubuntu:xenial
root@5885c5f5ccd5:/# (apt-get update && apt-get -y install openjdk-8-jre-headless curl rsync) &> /dev/null
root@5885c5f5ccd5:/# curl -s https://lirportal.ripe.net/certification/content/static/validator/rpki-validator-app-2.24-dist.tar.gz | tar zx
root@5885c5f5ccd5:/# cd rpki-validator-app-2.24; ./rpki-validator.sh run
[ warn ] JAVA_HOME is not set, will try to find java on path.
[ info ] Starting rpki-validator...
[ info ] writing logs under log directory
[ info ] Web user interface is available on port 8080
[ info ] Routers can connect on port 8282
...and looking at http://localhost:8080 all seems to be working just fine.
This in contrast to the behaviour on Ubuntu Trusty with Java 7:
[root@sloth ~]# docker run -it -p 8080:8080 ubuntu:trusty
root@c4461f0c4373:/# (apt-get update && apt-get -y install openjdk-7-jre-headless curl rsync) &> /dev/null
root@c4461f0c4373:/# curl -s https://lirportal.ripe.net/certification/content/static/validator/rpki-validator-app-2.24-dist.tar.gz | tar zx
root@c4461f0c4373:/# cd rpki-validator-app-2.24; ./rpki-validator.sh run
[ warn ] JAVA_HOME is not set, will try to find java on path.
[ info ] Starting rpki-validator...
[ info ] writing logs under log directory
[ info ] Web user interface is available on port 8080
[ info ] Routers can connect on port 8282
[ERROR] [02/28/2018 16:46:42.671] [default-akka.actor.default-dispatcher-3] [TaskInvocation] Error executing statement at line 5: CALL DROP_TABLE_IF_EXISTS('RETRIEVED_OBJECTS')
com.googlecode.flyway.core.command.FlywaySqlScriptException: Error executing statement at line 5: CALL DROP_TABLE_IF_EXISTS('RETRIEVED_OBJECTS')
at com.googlecode.flyway.core.dbsupport.SqlScript.execute(SqlScript.java:92)
at com.googlecode.flyway.core.resolver.sql.SqlMigrationExecutor.execute(SqlMigrationExecutor.java:72)
at com.googlecode.flyway.core.command.DbMigrate$2.doInTransaction(DbMigrate.java:243)
at com.googlecode.flyway.core.command.DbMigrate$2.doInTransaction(DbMigrate.java:241)
at com.googlecode.flyway.core.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72)
at com.googlecode.flyway.core.command.DbMigrate.applyMigration(DbMigrate.java:241)
at com.googlecode.flyway.core.command.DbMigrate.access$700(DbMigrate.java:44)
at com.googlecode.flyway.core.command.DbMigrate$1.doInTransaction(DbMigrate.java:186)
at com.googlecode.flyway.core.command.DbMigrate$1.doInTransaction(DbMigrate.java:135)
at com.googlecode.flyway.core.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72)
at com.googlecode.flyway.core.command.DbMigrate.migrate(DbMigrate.java:135)
at com.googlecode.flyway.core.Flyway$1.execute(Flyway.java:872)
at com.googlecode.flyway.core.Flyway$1.execute(Flyway.java:819)
at com.googlecode.flyway.core.Flyway.execute(Flyway.java:1200)
at com.googlecode.flyway.core.Flyway.migrate(Flyway.java:819)
at net.ripe.rpki.validator.store.DataSources$.net$ripe$rpki$validator$store$DataSources$$migrate(DataSources.scala:87)
at net.ripe.rpki.validator.store.DataSources$DSSingletons$$anonfun$$init$$1.apply(DataSources.scala:47)
at net.ripe.rpki.validator.store.DataSources$DSSingletons$$anonfun$$init$$1.apply(DataSources.scala:43)
at net.ripe.rpki.validator.store.SimpleSingletons.apply(Storage.scala:80)
at net.ripe.rpki.validator.store.DataSources$.DurableDataSource(DataSources.scala:54)
at net.ripe.rpki.validator.store.DurableCaches$$anonfun$$init$$1.apply(CacheStore.scala:229)
at net.ripe.rpki.validator.store.DurableCaches$$anonfun$$init$$1.apply(CacheStore.scala:228)
at net.ripe.rpki.validator.store.SimpleSingletons.apply(Storage.scala:80)
at net.ripe.rpki.validator.store.DurableCaches$.apply(CacheStore.scala:231)
at net.ripe.rpki.validator.config.Main.net$ripe$rpki$validator$config$Main$$runValidator(Main.scala:171)
at net.ripe.rpki.validator.config.Main.net$ripe$rpki$validator$config$Main$$runValidator(Main.scala:162)
at net.ripe.rpki.validator.config.Main$$anonfun$1.apply$mcV$sp(Main.scala:135)
at akka.actor.DefaultScheduler$$anon$4.run(Scheduler.scala:161)
at akka.actor.DefaultScheduler$$anon$2$$anon$5.run(Scheduler.scala:172)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:137)
at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:506)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: java.sql.SQLSyntaxErrorException: The class 'net.ripe.rpki.validator.StoredProcedures' does not exist or is inaccessible. This can happen if the class is not public.
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
at com.googlecode.flyway.core.dbsupport.JdbcTemplate.executeStatement(JdbcTemplate.java:230)
at com.googlecode.flyway.core.dbsupport.SqlScript.execute(SqlScript.java:90)
... 34 more
Caused by: ERROR 42X51: The class 'net.ripe.rpki.validator.StoredProcedures' does not exist or is inaccessible. This can happen if the class is not public.
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown Source)
... 45 more
Caused by: java.lang.ClassNotFoundException: net.ripe.rpki.validator.StoredProcedures : net/ripe/rpki/validator/StoredProcedures : Unsupported major.minor version 52.0
at org.apache.derby.impl.services.reflect.DatabaseClasses.loadApplicationClass(Unknown Source)
at org.apache.derby.iapi.services.loader.ClassInspector.getClass(Unknown Source)
at org.apache.derby.iapi.services.loader.ClassInspector.accessible(Unknown Source)
at org.apache.derby.impl.sql.compile.QueryTreeNode.verifyClassExist(Unknown Source)
at org.apache.derby.impl.sql.compile.StaticMethodCallNode.bindExpressionMinion(Unknown Source)
at org.apache.derby.impl.sql.compile.StaticMethodCallNode.bindExpression(Unknown Source)
at org.apache.derby.impl.sql.compile.JavaToSQLValueNode.bindExpression(Unknown Source)
at org.apache.derby.impl.sql.compile.CallStatementNode.bindStatement(Unknown Source)
at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown Source)
... 38 more
Hi Tore,
Apologies, I did not see immediately that this is a java version issue. That said, I would like to close this issue for now since things do work with Java 8.
Tried to upgrade to the latest version the other day. It simply didn't work. On the Trust Anchors page Processed items are all 0, Expires in and Last updated are all empty, and Next update is for all anchors «any moment» - this didn't change even though I left if overnight. I cleared out the workdir/datadir, so it's starting from a clean slate. As you can see from the log messages below, it does encounter some DbMigrate error which is the only thing that seems wrong to me.
Both v2.23 and v2.24 suffers from the issue; the last working version was v2.22.