Block #338819 deemed invalid by v0.15.1 I am attempting to sync from scratch a full node (v0.15.1) on a linux machine (Linux Mint running Ubuntu precise 12.04.1 LTS).
The sync grinds to a halt on block #338818.
From examining debug.log I can see the issue is the next block #338819 being deemed invalid. Here is an excerpt from debug.log demonstrating that:

2018-02-02 16:36:52 ERROR: AcceptBlockHeader: block 0000000000000000159e7d66c954312bccb5f12de808f2991b3859205665c442 is marked invalid
2018-02-02 16:36:52 ERROR: invalid header received
2018-02-02 16:36:52 ProcessMessages(headers, 162003 bytes) FAILED peer=217


bitcoin-qt continues to ask peers for the block header and keeps rejecting it as invalid, even though this block seems to be valid as part of the main chain, at least according to all known nodes that I checked (e.g. blockchain.info, blocktrail and several others).

I googled for this block # and found nothing, so I assume nobody else has this problem. What is going on? What should I do to continue with the sync?
That error means that the block got corrupted somewhere so it became invalid. The only way to fix this is to re-download the block.

To do so, first stop Bitcoin Core. Then go to the Bitcoin Core data directory and then the blocks folder within that. Delete the highest numbered blk*.dat and rev*.dat files. Then start Bitcoin Core again. When it asks whether you want to reindex the databases, choose yes. Bitcoin Core will now rebuild the block indexes and then continue with syncing once it is done. Note that while it is reindexing, it will look like it is syncing the blockchain again, but it is not. It is using the data on disk to build the block index and chain state until it needs to download blocks again to continue syncing.