Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tessera migration error #668

Closed
a651694192 opened this issue Mar 26, 2019 · 5 comments
Closed

Tessera migration error #668

a651694192 opened this issue Mar 26, 2019 · 5 comments

Comments

@a651694192
Copy link

a651694192 commented Mar 26, 2019

Tessera version: 0.9

using quorum-example/7nodes example, trying to migrate constellation to tessera, run ./stop.sh to stop the cluster, and use following script to do db migration:

**#!/bin/bash
set -u
set -e

for i in {1..7}
do
DDIR="qdata/c$i"
rm -f /home/zhou/go/src/github.com/quorum-examples/examples/7nodes/qdata/c$i/db$i*
rm -f "$DDIR/tm.ipc"
java -jar /home/zhou/go/src/github.com/tessera/data-migration/target/data-migration-0.9-SNAPSHOT-cli.jar -storetype dir -inputpath /home/zhou/go/src/github.com/quorum-examples/examples/7nodes/qdata/c$i/storage/payloads -dbuser sa -dbpass -exporttype h2 -outputfile /home/zhou/go/src/github.com/quorum-examples/examples/7nodes/qdata/c$i/db$i
done**

then restart the cluster with tessera: ./istanbul-start.sh tessera
Got this error: Internal Exception: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory

I don't know why there are too much connections, so I reboot the machine to clear them. Then restart the cluster again, both geth and tessera started, and seems tessera has connected to each other:
➜ 7nodes git:(master) ✗ netstat -an|grep 9001
tcp6 0 0 127.0.0.1:9001 :::
LISTEN
tcp6 0 0 127.0.0.1:9001 127.0.0.1:44998 ESTABLISHED
tcp6 0 0 127.0.0.1:44996 127.0.0.1:9001 ESTABLISHED
tcp6 0 0 127.0.0.1:9001 127.0.0.1:44922 ESTABLISHED
tcp6 0 0 127.0.0.1:9001 127.0.0.1:44996 ESTABLISHED
tcp6 0 0 127.0.0.1:9001 127.0.0.1:44948 ESTABLISHED
tcp6 0 0 127.0.0.1:9001 127.0.0.1:37252 ESTABLISHED
tcp6 0 0 127.0.0.1:44948 127.0.0.1:9001 ESTABLISHED
tcp6 0 0 127.0.0.1:9001 127.0.0.1:45026 ESTABLISHED
tcp6 0 0 127.0.0.1:44998 127.0.0.1:9001 ESTABLISHED
tcp6 0 0 127.0.0.1:44922 127.0.0.1:9001 ESTABLISHED
tcp6 0 0 127.0.0.1:45026 127.0.0.1:9001 ESTABLISHED
tcp6 0 0 127.0.0.1:37252 127.0.0.1:9001 ESTABLISHED
tcp6 0 0 127.0.0.1:9001 127.0.0.1:44962 ESTABLISHED
tcp6 0 0 127.0.0.1:44962 127.0.0.1:9001 ESTABLISHED
*

but blocknumber was parked at 2, and tessera log shows below:
Call: SELECT ENCODED_PAYLOAD, TIMESTAMP, HASH FROM ENCRYPTED_TRANSACTION WHERE (HASH = ?)
bind => [1 parameter bound]
Query: ReadAllQuery(referenceClass=EncryptedTransaction sql="SELECT ENCODED_PAYLOAD, TIMESTAMP, HASH FROM ENCRYPTED_TRANSACTION WHERE (HASH = ?)")
07:31:10.218 [jersey-server-managed-async-executor-1] ERROR c.q.t.a.e.DefaultExceptionMapper - Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.7.3.v20180807-4be1041): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.h2.jdbc.JdbcSQLException: Column "TIMESTAMP" not found; SQL statement:
SELECT ENCODED_PAYLOAD, TIMESTAMP, HASH FROM ENCRYPTED_TRANSACTION WHERE (HASH = ?) [42122-197]
Error Code: 42122

I don't know if anyone else has succeed in migrating from constellation to tessera, and there better have a official sample.

@melowe melowe self-assigned this Mar 27, 2019
@prd-fox
Copy link
Contributor

prd-fox commented Mar 28, 2019

Hey.

There was an issue with the migration with version 0.8 (current release), where a new column that had been added wasn't included in the migration.

We have a solution we are testing right now (#671), but if you need this before it is merged, then you can treat the migration as a 2-step process.

  1. Run the initial migration as you have done already.
  2. Run the 0.7 -> 0.8 migration script included in the DDL folder. For H2, you want this script.

@melowe
Copy link
Contributor

melowe commented Mar 28, 2019

If you're building 0.9 from master the data-migration tool now included the timestamp column. This is an unreleased feature but if you do prefer having early access then you're more then welcome to try it out. Any feedback you have will is welcome.

@melowe
Copy link
Contributor

melowe commented Mar 28, 2019

I you don't want to build there is also a snapshot jar published as part of a ci build

https://oss.sonatype.org/content/repositories/snapshots/com/jpmorgan/quorum/data-migration/0.9-SNAPSHOT/data-migration-0.9-20190328.175742-32-cli.jar

@stale
Copy link

stale bot commented Apr 4, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale
Copy link

stale bot commented Apr 18, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot closed this as completed Apr 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants