If your node stops accepting new blocks, set your system time

  • Before the forum went offline and lost a few weeks worth of posts, there was a thread where I and others mentioned having a problem with our nodes refusing to accept new blocks. The API would respond just fine to requests, but the node wasn't accepting new blocks.

    In my case, it turns out that my system time was off just enough to cause about one block a day to be flagged as out of order. This jammed up the node and all further blocks were turned away as well.

    nxt.BlockchainProcessor$BlockOutOfOrderException: Invalid timestamp: 95097438 current time is 95097422, previous block timestamp is 95097015
    	at nxt.BlockchainProcessorImpl.pushBlock(BlockchainProcessorImpl.java:850)
    	at nxt.BlockchainProcessorImpl.access$400(BlockchainProcessorImpl.java:46)
    	at nxt.BlockchainProcessorImpl$3.run(BlockchainProcessorImpl.java:195)
    	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:473)
    	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
    	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    	at java.lang.Thread.run(Thread.java:745)

    In my case (a Rackspace virtual server running Debian), the following (as root) worked:

    apt-get install ntpdate

    Then run the following command and add it to /etc/rc.local:

    ntpdate -s time.nist.gov

    My node hasn't jammed up again since.

  • @FlippyCakes Hi, you can use the program "chrony" from the ubuntu repository. Just search for chrony and download / install. Then it runs on startup and is adjusting the system time. It's running all the time and you have never to think of timesetting because its always on the right time. In etc/chrony you can set the timeserver you want to use. And chrony is more safe than using ntp.

  • @BurnMe Good to know, thanks! Since I've got it stable now, I'm probably not going to touch it unless it gets stuck again.