Unsupported WiredTiger file version

  1. i try to start mongod as usual by: mongod --bind_ip 165.232.39.31 --auth

i already have stored data on my server, but i can’t start mongod, how can i fix it?

  • and today i got error:

  • 2022-02-05T16:45:14.432+0800 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.1.1 11 Sep 2018

  1. 2022-02-05T16:45:14.432+0800 I CONTROL [initandlisten] allocator: tcmalloc

  2. 2022-02-05T16:45:14.432+0800 I CONTROL [initandlisten] modules: none

  3. 2022-02-05T16:45:14.432+0800 I CONTROL [initandlisten] build environment:

  4. 2022-02-05T16:45:14.433+0800 I CONTROL [initandlisten] distarch: x86_64

  5. 2022-02-05T16:45:14.433+0800 I CONTROL [initandlisten] target_arch: x86_64

  6. 2022-02-05T16:45:14.433+0800 I CONTROL [initandlisten] options: { net: { bindIp: “165.232.39.31” }, security: { authorization: “enabled” } }

  7. 2022-02-05T16:45:14.433+0800 W - [initandlisten] Detected unclean shutdown - /data/db/mongod.lock is not empty.

  8. 2022-02-05T16:45:14.434+0800 I - [initandlisten] Detected data files in /data/db created by the ‘wiredTiger’ storage engine, so setting the active storage engine to ‘wiredTiger’.

  9. 2022-02-05T16:45:14.434+0800 W STORAGE [initandlisten] Recovering data from the last clean checkpoint.

  10. 2022-02-05T16:45:14.435+0800 I STORAGE [initandlisten]

  11. 2022-02-05T16:45:14.435+0800 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine

  12. 2022-02-05T16:45:14.435+0800 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem

  13. 2022-02-05T16:45:14.435+0800 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=484M,session_max=20000,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),statistics_log=(wait=0),verbose=(recovery_progress),

  14. 2022-02-05T16:45:15.250+0800 E STORAGE [initandlisten] WiredTiger error (-31802) [1644050715:250212][17900:0x7fa2e214e0c0], txn-recover: unsupported WiredTiger file version: this build only supports versions up to 2, and the file is version 3: WT_ERROR: non-specific WiredTiger error

  15. 2022-02-05T16:45:15.250+0800 E STORAGE [initandlisten] WiredTiger error (0) [1644050715:250920][17900:0x7fa2e214e0c0], txn-recover: WiredTiger is unable to read the recovery log.

  16. 2022-02-05T16:45:15.251+0800 E STORAGE [initandlisten] WiredTiger error (0) [1644050715:251356][17900:0x7fa2e214e0c0], txn-recover: This may be due to the log files being encrypted, being from an older version or due to corruption on disk

  17. 2022-02-05T16:45:15.251+0800 E STORAGE [initandlisten] WiredTiger error (0) [1644050715:251620][17900:0x7fa2e214e0c0], txn-recover: You should confirm that you have opened the database with the correct options including all encryption and compression options

  18. 2022-02-05T16:45:15.251+0800 E STORAGE [initandlisten] WiredTiger error (-31802) [1644050715:251980][17900:0x7fa2e214e0c0], txn-recover: Recovery failed: WT_ERROR: non-specific WiredTiger error

  19. 2022-02-05T16:45:15.256+0800 E - [initandlisten] Assertion: 28595:-31802: WT_ERROR: non-specific WiredTiger error src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 413

  20. 2022-02-05T16:45:15.257+0800 I STORAGE [initandlisten] exception in initAndListen: Location28595: -31802: WT_ERROR: non-specific WiredTiger error, terminating

  21. 2022-02-05T16:45:15.257+0800 I NETWORK [initandlisten] shutdown: going to close listening sockets…

  22. 2022-02-05T16:45:15.258+0800 I NETWORK [initandlisten] removing socket file: /tmp/mongodb-27017.sock

  23. 2022-02-05T16:45:15.258+0800 I CONTROL [initandlisten] now exiting

  24. 2022-02-05T16:45:15.258+0800 I CONTROL [initandlisten] shutting down with code:100

1 Like

Hi @danil.shapoval21 welcome to the community!

This error means that you have a MongoDB version mismatch between what you used before, and what you’re using now.

Specifically, previously you used a newer MongoDB version, and you’re starting up a version considerably older than before. For example, if previously you used MongoDB version 5.0.x and you tried to start the server using the binaries from MongoDB 3.6.x, it will come up with this error.

unsupported WiredTiger file version: this build only supports versions up to 2, and the file is version 3

Means that the data files are from a newer version, and the binary you are using cannot recognize it.

To solve this, you would need to track down the binary you used before, and use it to start up the server.

Best regards
Kevin

1 Like

Thank you for answer. I use mongo 3.6.3 and not update it. So which version i should install?

I try to install previous version but have error

sudo apt-get install -y --allow-downgrades mongodb-org=3.2.22 mongodb-org-server=3.2.22 mongodb-org-shell=3.2.22 mongodb-org-mongos=3.2.22 mongodb-org-tools=3.2.22

Reading package lists… Done

Building dependency tree

Reading state information… Done

E: Version ‘3.2.22’ for ‘mongodb-org’ was not found

E: Version ‘3.2.22’ for ‘mongodb-org-server’ was not found

E: Version ‘3.2.22’ for ‘mongodb-org-shell’ was not found

E: Version ‘3.2.22’ for ‘mongodb-org-mongos’ was not found

E: Version ‘3.2.22’ for ‘mongodb-org-tools’ was not found

Hi @danil.shapoval21

I can’t really tell what happened to your environment, but what you’re seeing is similar to the situation in SERVER-40575.

In the ticket, a MongoDB 3.6.11 deployment was ran with the 4.0.8 binaries as part of an upgrade. However the upgrade stalled, and the mongod process was killed, leaving the “file version” message.

I think a similar event happened in yours as well. Someone started a MongoDB 4.0.x binaries against your data files, killed it (hence the “unlcean shutdown” message you also have), and the data files end up in this state.

You might want to try the troubleshooting method described in the ticket: Starting and cleanly shutting down a 4.0 (latest is 4.0.28) mongod followed by starting the desired 3.6 mongod (if you need to stay on the 3.6 series for now).

However, as MongoDB 3.6 series reached its end of life on April 2021 and the 4.0 series will reach its end of life on April 2022 (see Support Policy), I would encourage you to try to upgrade to newer MongoDB versions as well.

For upgrade considerations & instructions, see:

Best regards
Kevin

2 Likes

Thank you. My problem is solved!

Hi @danil.shapoval21

Great to hear that! Do you mind elaborating on what you did exactly?

Best regards
Kevin

1 Like

Fully delete mongo, install new mongo 4.0, start mongod --repair