MongoDB and WiredTiger compatibility issue - mongodb

Today, my MongoDB container running on Google Kubernetes Engine suddently stopped working, and this is the generated log:
2020-09-30T07:01:42.782+0000 I CONTROL [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=mongo-db-0
2020-09-30T07:01:42.782+0000 I CONTROL [initandlisten] db version v3.6.20
2020-09-30T07:01:42.782+0000 I CONTROL [initandlisten] git version: 39c200878284912f19553901a6fea4b31531a899
2020-09-30T07:01:42.782+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2g 1 Mar 2016
2020-09-30T07:01:42.782+0000 I CONTROL [initandlisten] allocator: tcmalloc
2020-09-30T07:01:42.782+0000 I CONTROL [initandlisten] modules: none
2020-09-30T07:01:42.782+0000 I CONTROL [initandlisten] build environment:
2020-09-30T07:01:42.782+0000 I CONTROL [initandlisten] distmod: ubuntu1604
2020-09-30T07:01:42.782+0000 I CONTROL [initandlisten] distarch: x86_64
2020-09-30T07:01:42.782+0000 I CONTROL [initandlisten] target_arch: x86_64
2020-09-30T07:01:42.782+0000 I CONTROL [initandlisten] options: { net: { bindIpAll: true } }
2020-09-30T07:01:42.782+0000 I - [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2020-09-30T07:01:42.783+0000 I STORAGE [initandlisten]
2020-09-30T07:01:42.783+0000 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2020-09-30T07:01:42.783+0000 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
2020-09-30T07:01:42.783+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=334M,cache_overflow=(file_max=0M),session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),compatibility=(release="3.0",require_max="3.0"),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
2020-09-30T07:01:43.433+0000 E STORAGE [initandlisten] WiredTiger error (95) [1601449303:433554][1:0x7f9f6c49da40], wiredtiger_open: __wt_conn_compat_config, 226: Version incompatibility detected: required max of 3.0cannot be larger than saved release 3.3: Operation not supported Raw: [1601449303:433554][1:0x7f9f6c49da40], wiredtiger_open: __wt_conn_compat_config, 226: Version incompatibility detected: required max of 3.0cannot be larger than saved release 3.3: Operation not supported
2020-09-30T07:01:43.434+0000 E - [initandlisten] Assertion: 28595:95: Operation not supported src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 488
2020-09-30T07:01:43.434+0000 I STORAGE [initandlisten] exception in initAndListen: Location28595: 95: Operation not supported, terminating
2020-09-30T07:01:43.434+0000 F - [initandlisten] Invariant failure globalStorageEngine src/mongo/db/service_context_d.cpp 272
2020-09-30T07:01:43.435+0000 F - [initandlisten]
I tested older Mongo container versions but it didn't work. I had this problem in the past, and I was able to fix it by completly wiping the persistent storage, but unfortunatelly this time I cannot do this.
How do I solve this compatibility issue without wiping the storage data?

A stored WiredTiger version of 3.3 means the data files were written by a MongoDB version from 4.2.6 to 4.2.8.
One of those versions should be able to open those files.

Related

MongoDB cannot start WiredTiger

Afer an automatic update on GKE, recreation of a pod with MongoDB image fails.
Stack trace follows:
2019-09-23T09:13:30.430+0000 I CONTROL [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=mongod-0
2019-09-23T09:13:30.431+0000 I CONTROL [initandlisten] db version v3.6.14
2019-09-23T09:13:30.431+0000 I CONTROL [initandlisten] git version: cbef87692475857c7ee6e764c8f5104b39c342a1
2019-09-23T09:13:30.431+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2g 1 Mar 2016
2019-09-23T09:13:30.431+0000 I CONTROL [initandlisten] allocator: tcmalloc
2019-09-23T09:13:30.431+0000 I CONTROL [initandlisten] modules: none
2019-09-23T09:13:30.431+0000 I CONTROL [initandlisten] build environment:
2019-09-23T09:13:30.431+0000 I CONTROL [initandlisten] distmod: ubuntu1604
2019-09-23T09:13:30.431+0000 I CONTROL [initandlisten] distarch: x86_64
2019-09-23T09:13:30.431+0000 I CONTROL [initandlisten] target_arch: x86_64
2019-09-23T09:13:30.431+0000 I CONTROL [initandlisten] options: { net: { bindIp: "0.0.0.0" }, replication: { replSet: "MainRepSet" }, security: { authorization: "enabled", clusterAuthMode: "keyFile", keyFile: "/etc/secrets-volume/mongodb-auth-keyfile" }, setParameter: { authenticationMechanisms: "SCRAM-SHA-1" } }
2019-09-23T09:13:30.431+0000 I - [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2019-09-23T09:13:30.431+0000 I STORAGE [initandlisten]
2019-09-23T09:13:30.431+0000 I STORAGE [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2019-09-23T09:13:30.431+0000 I STORAGE [initandlisten] ** See http://dochub.mongodb.org/core/prodnotes-filesystem
2019-09-23T09:13:30.431+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=2723M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),compatibility=(release="3.0",require_max="3.0"),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
2019-09-23T09:13:31.115+0000 E STORAGE [initandlisten] WiredTiger error (95) [1569230011:115812][1:0x7f9d4b73aa40], wiredtiger_open: __wt_conn_compat_config, 226: Version incompatibility detected: required max of 3.0cannot be larger than saved release 3.1: Operation not supported
2019-09-23T09:13:31.116+0000 E - [initandlisten] Assertion: 28595:95: Operation not supported src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp 486
2019-09-23T09:13:31.116+0000 I STORAGE [initandlisten] exception in initAndListen: Location28595: 95: Operation not supported, terminating
2019-09-23T09:13:31.116+0000 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2019-09-23T09:13:31.116+0000 I NETWORK [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2019-09-23T09:13:31.116+0000 I CONTROL [initandlisten] now exiting
2019-09-23T09:13:31.116+0000 I CONTROL [initandlisten] shutting down with code:100

mongo: “exception: connect failed”

I am trying to connect to the mongo server, using the "mongo" command in the command prompt and this error is showing: "exception: connect failed"
Here is how I am trying to do it:
enter image description here
This is the mongodb.log
2018-03-27T14:00:19.299+0800 I CONTROL [main] ***** SERVER RESTARTED *****
2018-03-27T14:00:19.647+0800 I CONTROL [main] Trying to start Windows service 'MongoDB'
2018-03-27T14:00:19.648+0800 I CONTROL [initandlisten] MongoDB starting : pid=10480 port=27017 dbpath=d:\mongodbData\db 64-bit host=DESKTOP-KEA31I3
2018-03-27T14:00:19.648+0800 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2018-03-27T14:00:19.648+0800 I CONTROL [initandlisten] db version v3.6.3
2018-03-27T14:00:19.648+0800 I CONTROL [initandlisten] git version: 9586e557d54ef70f9ca4b43c26892cd55257e1a5
2018-03-27T14:00:19.648+0800 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1u-fips 22 Sep 2016
2018-03-27T14:00:19.648+0800 I CONTROL [initandlisten] allocator: tcmalloc
2018-03-27T14:00:19.648+0800 I CONTROL [initandlisten] modules: none
2018-03-27T14:00:19.648+0800 I CONTROL [initandlisten] build environment:
2018-03-27T14:00:19.649+0800 I CONTROL [initandlisten] distmod: 2008plus-ssl
2018-03-27T14:00:19.649+0800 I CONTROL [initandlisten] distarch: x86_64
2018-03-27T14:00:19.649+0800 I CONTROL [initandlisten] target_arch: x86_64
2018-03-27T14:00:19.649+0800 I CONTROL [initandlisten] options: { service: true, storage: { dbPath: "d:\mongodbData\db" }, systemLog: { destination: "file", logAppend: true, path: "d:\mongodbData\log\mongodb.log" } }
2018-03-27T14:00:19.651+0800 I - [initandlisten] Detected data files in d:\mongodbData\db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2018-03-27T14:00:19.651+0800 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=7632M,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),
2018-03-27T14:00:19.834+0800 I STORAGE [initandlisten] WiredTiger message [1522130419:833660][10480:140722874245456], txn-recover: Main recovery loop: starting at 4/6272
2018-03-27T14:00:19.970+0800 I STORAGE [initandlisten] WiredTiger message [1522130419:970024][10480:140722874245456], txn-recover: Recovering log 4 through 5
2018-03-27T14:00:20.046+0800 I STORAGE [initandlisten] WiredTiger message [1522130420:46191][10480:140722874245456], txn-recover: Recovering log 5 through 5
2018-03-27T14:00:20.172+0800 I CONTROL [initandlisten]
2018-03-27T14:00:20.172+0800 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2018-03-27T14:00:20.172+0800 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2018-03-27T14:00:20.172+0800 I CONTROL [initandlisten]
2018-03-27T14:00:20.173+0800 I CONTROL [initandlisten] ** WARNING: This server is bound to localhost.
2018-03-27T14:00:20.173+0800 I CONTROL [initandlisten] ** Remote systems will be unable to connect to this server.
2018-03-27T14:00:20.173+0800 I CONTROL [initandlisten] ** Start the server with --bind_ip <address> to specify which IP
2018-03-27T14:00:20.173+0800 I CONTROL [initandlisten] ** addresses it should serve responses from, or with --bind_ip_all to
2018-03-27T14:00:20.173+0800 I CONTROL [initandlisten] ** bind to all interfaces. If this behavior is desired, start the
2018-03-27T14:00:20.173+0800 I CONTROL [initandlisten] ** server with --bind_ip 127.0.0.1 to disable this warning.
2018-03-27T14:00:20.173+0800 I CONTROL [initandlisten]
2018-03-27T14:00:20.173+0800 I CONTROL [initandlisten]
2018-03-27T14:00:20.173+0800 I CONTROL [initandlisten] ** WARNING: The file system cache of this machine is configured to be greater than 40% of the total memory. This can lead to increased memory pressure and poor performance.
2018-03-27T14:00:20.174+0800 I CONTROL [initandlisten] See http://dochub.mongodb.org/core/wt-windows-system-file-cache
2018-03-27T14:00:20.174+0800 I CONTROL [initandlisten]
2018-03-27T14:00:20.402+0800 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory 'd:/mongodbData/db/diagnostic.data'
2018-03-27T14:00:20.404+0800 I NETWORK [initandlisten] waiting for connections on port 27017
2018-03-27T14:00:20.404+0800 I STORAGE [initandlisten] Service running
Please help me. How to fix it
Run this following command :
sudo service mongodb stop
sudo rm /var/lib/mongodb/mongod.lock
sudo service mongod restart
mongo

MongoDB starting error [duplicate]

This question already has answers here:
MongoDB cannot start server: The default storage engine 'wiredTiger' is not available with this build of mongod
(8 answers)
Closed 5 years ago.
Well recently i want to start the mongodb server but when i tried to use the command line: mongod on my windows x32 with the mongodb version : 3.2.18 ,i got the follwing error:
2017-12-29T10:45:56.427+0100 I CONTROL [main]
2017-12-29T10:45:56.427+0100 W CONTROL [main] 32-bit servers don't have journal
ing enabled by default. Please use --journal if you want durability.
2017-12-29T10:45:56.427+0100 I CONTROL [main]
2017-12-29T10:45:56.437+0100 I CONTROL [main] Hotfix KB2731284 or later update
is installed, no need to zero-out data files
2017-12-29T10:45:56.437+0100 I CONTROL [initandlisten] MongoDB starting : pid=7
556 port=27017 dbpath=C:\data\db\ 32-bit host=ROOT-PC
2017-12-29T10:45:56.437+0100 I CONTROL [initandlisten] targetMinOS: Windows Vis
ta/Windows Server 2008
2017-12-29T10:45:56.437+0100 I CONTROL [initandlisten] db version v3.2.18
2017-12-29T10:45:56.437+0100 I CONTROL [initandlisten] git version: 4c1bae566c0
c00f996a2feb16febf84936ecaf6f
2017-12-29T10:45:56.447+0100 I CONTROL [initandlisten] allocator: tcmalloc
2017-12-29T10:45:56.447+0100 I CONTROL [initandlisten] modules: none
2017-12-29T10:45:56.447+0100 I CONTROL [initandlisten] build environment:
2017-12-29T10:45:56.447+0100 I CONTROL [initandlisten] distarch: i386
2017-12-29T10:45:56.447+0100 I CONTROL [initandlisten] target_arch: i386
2017-12-29T10:45:56.447+0100 I CONTROL [initandlisten] options: {}
2017-12-29T10:45:56.447+0100 I STORAGE [initandlisten] exception in initAndList
en: 28663 Cannot start server. The default storage engine 'wiredTiger' is not av
ailable with this build of mongod. Please specify a different storage engine exp
licitly, e.g. --storageEngine=mmapv1., terminating
2017-12-29T10:45:56.447+0100 I CONTROL [initandlisten] dbexit: rc: 100
The WiredTiger storage engine is only available in the 64-bit version of MongoDB (source).
As the error message says, you have to provide another storage engine explicitly via the --storageEngine command line option.

mongodb no such file or directory wiredtiger_kv_engine

what I did :
went to the database directory and
mongod --dbpath .
then I got this:
2017-02-16T23:51:51.965+0800 I CONTROL [initandlisten] MongoDB starting : pid=31656 port=27017 dbpath=. 64-bit host=WIN-01604161705
2017-02-16T23:51:51.966+0800 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2017-02-16T23:51:51.968+0800 I CONTROL [initandlisten] db version v3.4.1
2017-02-16T23:51:51.969+0800 I CONTROL [initandlisten] git version: 5e103c4f5583e2566a45d740225dc250baacfbd7
2017-02-16T23:51:51.970+0800 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1t-fips 3 May 2016
2017-02-16T23:51:51.971+0800 I CONTROL [initandlisten] allocator: tcmalloc
2017-02-16T23:51:51.972+0800 I CONTROL [initandlisten] modules: none
2017-02-16T23:51:51.973+0800 I CONTROL [initandlisten] build environment:
2017-02-16T23:51:51.974+0800 I CONTROL [initandlisten] distmod: 2008plus-ssl
2017-02-16T23:51:51.975+0800 I CONTROL [initandlisten] distarch: x86_64
2017-02-16T23:51:51.975+0800 I CONTROL [initandlisten] target_arch: x86_64
2017-02-16T23:51:51.978+0800 I CONTROL [initandlisten] options: { storage: { dbPath: "." } }
2017-02-16T23:51:51.982+0800 I - [initandlisten] Detected data files in . created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2017-02-16T23:51:51.982+0800 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=3519M,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2017-02-16T23:51:51.992+0800 I - [initandlisten] Assertion: 28595:2: No such file or directory src\mongo\db\storage\wiredtiger\wiredtiger_kv_engine.cpp 267
2017-02-16T23:51:51.992+0800 I STORAGE [initandlisten] exception in initAndListen: 28595 2: No such file or directory, terminating
2017-02-16T23:51:51.993+0800 I NETWORK [initandlisten] shutdown: going to close listening sockets...
2017-02-16T23:51:51.994+0800 I NETWORK [initandlisten] shutdown: going to flush diaglog...
2017-02-16T23:51:51.996+0800 I CONTROL [initandlisten] now exiting
2017-02-16T23:51:51.998+0800 I CONTROL [initandlisten] shutting down with code:100
I don't know what's going on at all.
all that I have done is just common things like revising my files in other directories, merge the branch 'master' into 'b2' using github client.
I doubt that something went wrong when I did the 'merge' operation.
I have tried using git revert to make it roll back, still getting the same error.
Should I reinstall mongodb? I'm doing so.

MongoDB not working in Vagrant Centos Box

I cant seem to fork off an instance of the MongoDB daemon when I am logged in to a Centos 7.1 Box. I have created the data/db folder and everytime I try to run
./bin/mongod --dbpath data/db
I get a mess of errors
2016-01-26T00:44:23.820+0000 I CONTROL [initandlisten] MongoDB starting : pid=2735 port=27017 dbpath=data/db 64-bit host=localhost.localdomain
2016-01-26T00:44:23.820+0000 I CONTROL [initandlisten] db version v3.2.1
2016-01-26T00:44:23.820+0000 I CONTROL [initandlisten] git version: a14d55980c2cdc565d4704a7e3ad37e4e535c1b2
2016-01-26T00:44:23.821+0000 I CONTROL [initandlisten] allocator: tcmalloc
2016-01-26T00:44:23.821+0000 I CONTROL [initandlisten] modules: none
2016-01-26T00:44:23.821+0000 I CONTROL [initandlisten] build environment:
2016-01-26T00:44:23.821+0000 I CONTROL [initandlisten] distarch: x86_64
2016-01-26T00:44:23.821+0000 I CONTROL [initandlisten] target_arch: x86_64
2016-01-26T00:44:23.821+0000 I CONTROL [initandlisten] options: { storage: { dbPath: "data/db" } }
2016-01-26T00:44:23.842+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=1G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2016-01-26T00:44:23.853+0000 E STORAGE [initandlisten] WiredTiger (22) [1453769063:853352][2735:0x7f09f2eddcc0], connection: data/db/WiredTiger.wt: fsync: Invalid argument
2016-01-26T00:44:23.856+0000 I - [initandlisten] Fatal Assertion 28561
2016-01-26T00:44:23.856+0000 I - [initandlisten]
***aborting after fassert() failure
The strange thing is I did it earlier and it worked. What could be the problem?
It turns out that putting the downloaded mongodb database in the synced folder between the host machine and the virtual machine caused some type of permissions issue or configuration issue.
When you take it out of the synced folder - which most likely has the Vagrantfile - and put it in a folder thats not synced/shared it seems to work just fine. Thought id save someone the 5 hours I wasted :-)