MongoDB server fails to start with Wiredtiger error stored size exceeds source size

Hi,

I am using MongoDB version 4.2 and it was working fine. But recently when I try to start the server it is failing with below error. Please can you let me know what the issue is?

022-08-29T16:07:27.164+0200 I  STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=3356M,cache_overflow=(file_max=0M),session_max=33000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000,close_scan_interval=10,close_handle_minimum=250),statistics_log=(wait=0),verbose=[recovery_progress,checkpoint_progress],
2022-08-29T16:07:27.784+0200 I  STORAGE  [initandlisten] WiredTiger message [1661782047:784353][1732977:0x7f886f9cdc00], txn-recover: Recovering log 1 through 3
2022-08-29T16:07:27.784+0200 E  STORAGE  [initandlisten] WiredTiger error (0) [1661782047:784401][1732977:0x7f886f9cdc00], txn-recover: WT_COMPRESSOR.decompress: **stored size exceeds source size** Raw: [1661782047:784401][1732977:0x7f886f9cdc00], txn-recover: WT_COMPRESSOR.decompress: stored size exceeds source size
2022-08-29T16:07:27.784+0200 E  STORAGE  [initandlisten] WiredTiger error (-31802) [1661782047:784431][1732977:0x7f886f9cdc00], txn-recover: __wt_txn_recover, 710: Recovery failed: WT_ERROR: non-specific WiredTiger error Raw: [1661782047:784431][1732977:0x7f886f9cdc00], txn-recover: __wt_txn_recover, 710: Recovery failed: WT_ERROR: non-specific WiredTiger error
2022-08-29T16:07:27.784+0200 E  STORAGE  [initandlisten] WiredTiger error (0) [1661782047:784490][1732977:0x7f886f9cdc00], connection: __wt_cache_destroy, 346: cache server: exiting with 1 pages in memory and 0 pages evicted Raw: [1661782047:784490][1732977:0x7f886f9cdc00], connection: __wt_cache_destroy, 346: cache server: exiting with 1 pages in memory and 0 pages evicted

Thanks,
Akshaya Srinivasan

Hi @Akshaya_Srinivasan

The error WT_COMPRESSOR.decompress: stored size exceeds source size basically means that when WiredTiger tries to decompress data, it found that the uncompressed size is smaller than the compressed size. This is not supposed to happen, and it is pretty unexpected.

Although there is no guarantee that this can be fixed other than restoring from a backup, could you provide more details:

  • What is the full MongoDB version, including the minor version? MongoDB 4.2 ranges from 4.2.0 to 4.2.22 currently.
  • Was the files copied from another deployment, notably one from a big-endian system copied to a little endian system, or vice versa?
  • Was there anything that was manually altered in the dbPath?

Best regards
Kevin

1 Like

Thanks Kevinadi.
This issue was seen when I tried to restore data from my backup.
My MongoDB server version is 4.2.14.
I took backup from same machine and restored to the same machine.
I took backup of dbPath with fsyncLock acquired and then unlocked it. Other than that there was no change made manually in the dbPath.
Any steps to proceed further? Thanks in advance.

Akshaya Srinivasan