db-seed issues

45 views
Skip to first unread message

Matthew Halder

unread,
Aug 24, 2016, 5:56:50 PM8/24/16
to keywhiz-users
Anybody ever seen any issue with starting H2 database during startup?  I'm seeing an odd issue where db-seed cannot succeed due to a TIMESTAMP constraint but I cannot find a table in the db that has TIMESTAMP as part of its table.  I'm not sure where the db-seed is or if I need to add a column to a table some where.  I've tried using a different H2 table, deleting the tables, and reboot the whole box to remove all the db tables from memory and /tmp.
Here's the error message I'm seeing:

Exception in thread "main" org.jooq.exception.DataAccessException: SQL [insert into groups (id, name, createdat, updatedat) values (cast(? as bigint), cast(? as varchar), cast(? as bigint), cast(? as bigint)), (cast(? as bigint), cast(? as varchar), cast(? as bigint), cast(? as bigint)), (cast(? as bigint), cast(? as varchar), cast(? as bigint), cast(? as bigint)), (cast(? as bigint), cast(? as varchar), cast(? as bigint), cast(? as bigint)), (cast(? as bigint), cast(? as varchar), cast(? as bigint), cast(? as bigint))]; Cannot parse "TIMESTAMP" constant "1340289489"; SQL statement:
insert into groups (id, name, createdat, updatedat) values (cast(? as bigint), cast(? as varchar), cast(? as bigint), cast(? as bigint)), (cast(? as bigint), cast(? as varchar), cast(? as bigint), cast(? as bigint)), (cast(? as bigint), cast(? as varchar), cast(? as bigint), cast(? as bigint)), (cast(? as bigint), cast(? as varchar), cast(? as bigint), cast(? as bigint)), (cast(? as bigint), cast(? as varchar), cast(? as bigint), cast(? as bigint)) -- (CAST(?1 AS BIGINT), CAST(?2 AS VARCHAR), CAST(?3 AS BIGINT), CAST(?4 AS BIGINT)) [22007-187]
    at org.jooq.impl.Utils.translate(Utils.java:1645)
    at org.jooq.impl.DefaultExecuteContext.sqlException(DefaultExecuteContext.java:661)
    at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:356)
    at org.jooq.impl.AbstractDelegatingQuery.execute(AbstractDelegatingQuery.java:133)
    at keywhiz.commands.DbSeedCommand.doImport(DbSeedCommand.java:88)
    at keywhiz.commands.DbSeedCommand.run(DbSeedCommand.java:70)
    at keywhiz.commands.DbSeedCommand.run(DbSeedCommand.java:50)
    at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:76)
    at io.dropwizard.cli.Cli.run(Cli.java:70)
    at io.dropwizard.Application.run(Application.java:73)
    at keywhiz.KeywhizService.main(KeywhizService.java:71)
Caused by: org.h2.jdbc.JdbcSQLException: Cannot parse "TIMESTAMP" constant "1340289489"; SQL statement:
insert into groups (id, name, createdat, updatedat) values (cast(? as bigint), cast(? as varchar), cast(? as bigint), cast(? as bigint)), (cast(? as bigint), cast(? as varchar), cast(? as bigint), cast(? as bigint)), (cast(? as bigint), cast(? as varchar), cast(? as bigint), cast(? as bigint)), (cast(? as bigint), cast(? as varchar), cast(? as bigint), cast(? as bigint)), (cast(? as bigint), cast(? as varchar), cast(? as bigint), cast(? as bigint)) -- (CAST(?1 AS BIGINT), CAST(?2 AS VARCHAR), CAST(?3 AS BIGINT), CAST(?4 AS BIGINT)) [22007-187]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
    at org.h2.message.DbException.get(DbException.java:168)
    at org.h2.value.ValueTimestamp.parse(ValueTimestamp.java:122)
    at org.h2.value.Value.convertTo(Value.java:862)
    at org.h2.table.Column.convert(Column.java:148)
    at org.h2.command.dml.Insert.insertRows(Insert.java:143)
    at org.h2.command.dml.Insert.update(Insert.java:114)
    at org.h2.command.CommandContainer.update(CommandContainer.java:78)
    at org.h2.command.Command.executeUpdate(Command.java:254)
    at org.h2.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement.java:198)
    at org.jooq.tools.jdbc.DefaultPreparedStatement.execute(DefaultPreparedStatement.java:194)
    at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:410)
    at org.jooq.impl.AbstractDMLQuery.execute(AbstractDMLQuery.java:276)
    at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:342)
    ... 8 more
Caused by: java.lang.IllegalArgumentException: 1340289489
    at org.h2.util.DateTimeUtils.parseDateValue(DateTimeUtils.java:275)
    at org.h2.value.ValueTimestamp.parseTry(ValueTimestamp.java:140)
    at org.h2.value.ValueTimestamp.parse(ValueTimestamp.java:120)
    ... 19 more

Matthew Halder

unread,
Sep 6, 2016, 5:38:36 PM9/6/16
to keywhiz-users
In an attempt to simply side step this issue, I rebuild the server from the ground up that keywhiz server lives on.  The only thing that was imported over were the CA keys/certs.  While setting up keywhiz server I hit the same timestamp snag as before.  Below is the entire error message that is output when trying to use the "db-seed" function of the keywhiz server.  Any suggestions on where to look for the db-seed file would be great, I haven't been able to find it referenced in the yaml files.

$ sudo java -jar server/target/keywhiz-server-0.7.11-SNAPSHOT-shaded.jar db-seed server/src/main/resources/keywhiz-development.yaml.h2
INFO  [2016-09-06 21:05:50,045] org.jooq.Constants:
                                     
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@  @@        @@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@        @@@@@@@@@@
@@@@@@@@@@@@@@@@  @@  @@    @@@@@@@@@@
@@@@@@@@@@  @@@@  @@  @@    @@@@@@@@@@
@@@@@@@@@@        @@        @@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@        @@        @@@@@@@@@@
@@@@@@@@@@    @@  @@  @@@@  @@@@@@@@@@
@@@@@@@@@@    @@  @@  @@@@  @@@@@@@@@@
@@@@@@@@@@        @@  @  @  @@@@@@@@@@
@@@@@@@@@@        @@        @@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@  @@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  Thank you for using jOOQ 3.6.2

Matthew McPherrin

unread,
Sep 6, 2016, 5:48:36 PM9/6/16
to Matthew Halder, keywhiz-users
If db-seed isn't working, I would recommend you just avoid using it.

It mostly exists for unit tests, so if those are passing, we don't get much else from it.

--
You received this message because you are subscribed to the Google Groups "keywhiz-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keywhiz-users+unsubscribe@googlegroups.com.
To post to this group, send email to keywhi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/keywhiz-users/d3580c41-c09a-41c6-a625-edeacd6a2f60%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
Message has been deleted
0 new messages