nuriel77 / iri-playbook

IOTA IRI Fullnode Installation Playbook
MIT License
105 stars 24 forks source link

migration doesn't work #83

Closed SimonVillage closed 6 years ago

SimonVillage commented 6 years ago

Hi there,

I have downloaded the database from before the snapshot and run bash <(curl -s https://x-vps.com/get_iri_rc.sh)

The output is

******************************************
Welcome to IOTA IRI Upgrade to 1.4.2.4_RC!
******************************************

What is this script going to do?

  1. Check the distribution (Ubuntu or CentOS)
  2. Check if you want to compile the jar yourself or download a precompiled one.
  3. Stop IRI
  4. Download or pre-compile the jar (which will install maven as it is a requirement)
  5. Copy the resulting jar to the target directory and create a symbolic link
  6. Configure the IRI configuration files (version and set RESCAN_DB = true).
  7. Restart IRI
  8. Remove the RESCAN_DB = true (it is needed once)

By pressing 'y' you agree to upgrade to 1.4.2.4_RC and keep the existing database.
In addition, note that this script will only work with installations done by
the iri-playbook.
Do you wish to proceed? [y/N] y

Do you want to download the pre-compiled source from Nuriel's server? Otherwise the jar will compile on your server.
Click 'y' to download the pre-compiled source from Nuriel. Any other key to compile it on your server (CTRL-C to exit now).y
Stopping current IRI. This might take a moment...
Download pre-compiled iri-1.4.2.4_RC.jar ...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 60.3M  100 60.3M    0     0   102M      0 --:--:-- --:--:-- --:--:--  102M
Creating symbolic link from /var/lib/iri/target/iri-1.4.2.4_RC.jar to /var/lib/iri/target/iri-1.4.2.4.jar
Setting new version in config files
Downloading iri-1.4.2.2-to-1.4.2.4_RC-db-migration-tool.jar ...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 60.3M  100 60.3M    0     0  2519k      0  0:00:24  0:00:24 --:--:--  9.9M
Applying database migration ...
05/03 12:14:32.654 [main] INFO  com.iota.iri.IRI - Welcome to IRI 1.4.2.2-to-1.4.2.4_RC-db-migration-tool
05/03 12:14:54.467 [main] INFO  c.i.i.s.r.RocksDBPersistenceProvider - Initializing Database Backend... 
05/03 12:14:54.488 [main] ERROR com.iota.iri.IRI - Exception during IOTA node initialisation: 
java.lang.NullPointerException: null
    at com.iota.iri.storage.rocksDB.RocksDBPersistenceProvider.initDB(RocksDBPersistenceProvider.java:458) ~[iri_migrate_tool.jar:na]
    at com.iota.iri.storage.rocksDB.RocksDBPersistenceProvider.init(RocksDBPersistenceProvider.java:76) ~[iri_migrate_tool.jar:na]
    at com.iota.iri.storage.Tangle.init(Tangle.java:26) ~[iri_migrate_tool.jar:na]
    at com.iota.iri.Iota.init(Iota.java:107) ~[iri_migrate_tool.jar:na]
    at com.iota.iri.IRI.main(IRI.java:71) ~[iri_migrate_tool.jar:na]
05/03 12:14:54.490 [Shutdown Hook] INFO  com.iota.iri.IRI - Shutting down IOTA node, please hold tight...

I then run java -jar /var/lib/iri/target/iri_migrate_tool.jar -p 14265 which is starting the rescan now.

nuriel77 commented 6 years ago

So it didn't work with the script but worked when you ran it manually? Which user did you run either with?

SimonVillage commented 6 years ago

root user. The node was setup as root as well.

SimonVillage commented 6 years ago

And after migration / rescan run successful I have this in the logs

May 04 05:44:02 ubuntu-s-2vcpu-4gb-fra1-01 systemd[1]: Started IOTA FullNode.
May 04 05:44:03 ubuntu-s-2vcpu-4gb-fra1-01 iri[1388]: 05/04 05:44:03.269 [main] INFO  com.iota.iri.IRI - Welcome to IRI 1.4.2.4_RC
May 04 05:44:21 ubuntu-s-2vcpu-4gb-fra1-01 iri[1388]: 05/04 05:44:21.287 [main] INFO  c.i.i.s.r.RocksDBPersistenceProvider - Initializing Database Backend...
May 04 05:44:21 ubuntu-s-2vcpu-4gb-fra1-01 iri[1388]: 05/04 05:44:21.298 [main] ERROR com.iota.iri.IRI - Exception during IOTA node initialisation:
May 04 05:44:21 ubuntu-s-2vcpu-4gb-fra1-01 iri[1388]: java.lang.NullPointerException: null
May 04 05:44:21 ubuntu-s-2vcpu-4gb-fra1-01 iri[1388]:         at com.iota.iri.storage.rocksDB.RocksDBPersistenceProvider.initDB(RocksDBPersistenceProvider.java:458) ~[iri-1.4.2.4_RC.jar:na]
May 04 05:44:21 ubuntu-s-2vcpu-4gb-fra1-01 iri[1388]:         at com.iota.iri.storage.rocksDB.RocksDBPersistenceProvider.init(RocksDBPersistenceProvider.java:76) ~[iri-1.4.2.4_RC.jar:na]
May 04 05:44:21 ubuntu-s-2vcpu-4gb-fra1-01 iri[1388]:         at com.iota.iri.storage.Tangle.init(Tangle.java:26) ~[iri-1.4.2.4_RC.jar:na]
May 04 05:44:21 ubuntu-s-2vcpu-4gb-fra1-01 iri[1388]:         at com.iota.iri.Iota.init(Iota.java:105) ~[iri-1.4.2.4_RC.jar:na]
May 04 05:44:21 ubuntu-s-2vcpu-4gb-fra1-01 iri[1388]:         at com.iota.iri.IRI.main(IRI.java:71) ~[iri-1.4.2.4_RC.jar:na]
May 04 05:44:21 ubuntu-s-2vcpu-4gb-fra1-01 iri[1388]: 05/04 05:44:21.299 [Shutdown Hook] INFO  com.iota.iri.IRI - Shutting down IOTA node, please hold tight...
May 04 05:44:27 ubuntu-s-2vcpu-4gb-fra1-01 iri[1388]: 05/04 05:44:27.302 [Shutdown Hook] ERROR com.iota.iri.IRI - Exception occurred shutting down IOTA node:
May 04 05:44:27 ubuntu-s-2vcpu-4gb-fra1-01 iri[1388]: java.lang.NullPointerException: null
May 04 05:44:27 ubuntu-s-2vcpu-4gb-fra1-01 iri[1388]:         at com.iota.iri.network.replicator.ReplicatorSourcePool.shutdown(ReplicatorSourcePool.java:73) ~[iri-1.4.2.4_RC.jar:na]
May 04 05:44:27 ubuntu-s-2vcpu-4gb-fra1-01 iri[1388]:         at com.iota.iri.network.replicator.Replicator.shutdown(Replicator.java:30) ~[iri-1.4.2.4_RC.jar:na]
May 04 05:44:27 ubuntu-s-2vcpu-4gb-fra1-01 iri[1388]:         at com.iota.iri.Iota.shutdown(Iota.java:156) ~[iri-1.4.2.4_RC.jar:na]
May 04 05:44:27 ubuntu-s-2vcpu-4gb-fra1-01 iri[1388]:         at com.iota.iri.IRI.lambda$shutdownHook$0(IRI.java:323) ~[iri-1.4.2.4_RC.jar:na]
May 04 05:44:27 ubuntu-s-2vcpu-4gb-fra1-01 iri[1388]:         at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_172]
May 04 05:44:27 ubuntu-s-2vcpu-4gb-fra1-01 systemd[1]: iri.service: Main process exited, code=exited, status=255/n/a
May 04 05:44:27 ubuntu-s-2vcpu-4gb-fra1-01 systemd[1]: iri.service: Failed with result 'exit-code'.
nuriel77 commented 6 years ago

Is it correct to say that running the tool manually doesn't break?

To be honest I am not sure if this tool was supposed to be used days after the snapshot. If you would like, you can download the database from the point it was shutdown prior to the snapshot: https://x-vps.com/iota.db.tgz.old

Then unpack it to the target location, change ownership (iri) and re-run the tool. Maybe you can contact me on IOTA Discord and I can try to assist.

SimonVillage commented 6 years ago

can be closed, worked well with our database!