Those first messages are just showing that it was syncing new blocks... you can ignore the "unknown version" messages... while it can be alarming to see, they're 'normal'.
It's a bit tricky to diagnose when you're giving snippets of debug.log... so you got that "Error: Out of memory" AFTER you executed
bitcoin-cli stop and the node was shutting down? Did you get the normal shutting down debug like this:
2020-06-05T06:31:18Z tor: Thread interrupt
2020-06-05T06:31:18Z opencon thread exit
2020-06-05T06:31:18Z addcon thread exit
2020-06-05T06:31:18Z Shutdown: In progress...
2020-06-05T06:31:18Z torcontrol thread exit
2020-06-05T06:31:18Z net thread exit
2020-06-05T06:31:18Z msghand thread exit
2020-06-05T06:31:44Z scheduler thread exit
2020-06-05T06:31:44Z Dumped mempool: 0.000997s to copy, 0.152187s to dump
2020-06-05T06:31:44Z FlushStateToDisk: write coins cache to disk (677775 coins, 94304kB) started
And then it died at this point with the OOM?
Sorry to miss critical information. My debug.log file is set to be split every 300Mb, so it would be silly of me to paste here the entire file.
That's why I was just pasting here the error messages plus a few lines before.
The error was happening when I issued 'bitcoin-cli stop'.
I was not getting the same output as you because the error happened. Otherwise I would get similar output as yours.
So, I think it was due to the fact that I tried to use a bigger 'dbcache' value of 12000 MB. And when it tried to dump the cache to the disk, it was running out of memory. I 'only' have 16Gb of RAM. Not sure this was being an issue.
Anyway, the process has finished, and I think I already have my full node data back.
And now that I have my full data back (I hope), I tried to import an address where I have a small amount of BTC. I imported the address using the PK. Then I tried to rescan the blockchain to update the wallet with this address transactions. I used 'bitcoin-cli rescanblockchain 597000 633472' but I got this error:
$ bitcoin-cli rescanblockchain 590000 633465
error: Could not connect to the server 127.0.0.1:8332 (error code 0 - "timeout reached")
Make sure the bitcoind server is running and that you are connecting to the correct RPC port.
So I tried smaller ranges. With smaller ranges it is working and I get no errors. I tried between 597000 and 600000 and no errors. I tried other ranges and no errors either. But I still can't make that 'listunspent' command shows the utxos in this address I just imported.
What else can I do to make listunspent show my utxos?