DB has been previously marked as corrupted, attempting repair

Corruption of the chain database data can occur. It is usually the result of a RAM related error but before or after you rip open your computer to address the hardware …

DB has been previously marked as corrupted, attempting repair
Error: Service(Client(Backend("Corruption: force_consistency_checks:

If you see the aforementioned error in the chain.log of the node computer you can attempt to resolve the issue if it happens to be a one off event. You do not need to make any changes to the gateway computer.

On the node computer ONLY.
ALL of the following commands are run on the node computer.

Stop the cmix and chain services …
$ sudo systemctl stop xxnetwork-cmix xxnetwork-chain

Delete the DB …
$ sudo rm -rf /opt/xxnetwork/db/*

Start the chain service …
$ sudo systemctl start xxnetwork-chain

Go to xx explorer
In the 3 dot menu to the right of the stash select, Change session keys

Use the output of the following commands to do so …
$ curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys", "params":[]}' http://localhost:9933 -o /opt/xxnetwork/cred/session-keys.json

then …
$ cat /opt/xxnetwork/cred/session-keys.json

Depending on how long it has been stopped, you may also need to press the Validate button if it is present.

Run …
$ tail -F /opt/xxnetwork/log/chain.log

You must wait until you see Imported messages before you start the cmix service. This will take a while!

Once you see Imported messages in the chain.log, you can start the cmix service…
$ sudo systemctl start xxnetwork-cmix


If you see the aforementioned error in the chain.log of the gateway computer you can attempt to resolve the issue if it happens to be a one off event. You do not need to make any changes to the node computer.

On the gateway computer ONLY.
ALL of the following commands are run on the gateway computer.

Stop the chain and gateway services …
$ sudo systemctl stop xxnetwork-chain xxnetwork-gateway

Delete the contents of the /opt/xxnetwork/db directory
$ rm -rf /opt/xxnetwork/db/*

Start the chain service and wait for it to sync …
$ sudo systemctl start xxnetwork-chain

tail the chain.log until you see messages that include Included.
Ex. 2022-01-12 14:23:48 :sparkles: Imported #798899 (0x62ae…8a42)

It will take some time for them to show so be patient.
$ tail -F /opt/xxnetwork/log/chain.log

Terminate tail with Crtl+c when you’re done viewing the log.

Once you see the Imported messages, start the gateway service
$ sudo systemctl start xxnetwork-gateway