2

Yes, there are other questions extremely similar. However, the reason for this error seems to be different.

I start MongoDB once and it runs fine in the data folder I specify. When I run it again (sometimes), it suddenly does not work anymore and gives me the following output log:

2018-01-31T00:31:39.636-0800 I CONTROL  [initandlisten] MongoDB starting : pid=12248 port=27017 dbpath=C:\Users\20173591\Documents\GitHub\prijzen-volger\data 64-bit host=20173591
2018-01-31T00:31:39.636-0800 I CONTROL  [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2018-01-31T00:31:39.638-0800 I CONTROL  [initandlisten] db version v3.6.2
2018-01-31T00:31:39.641-0800 I CONTROL  [initandlisten] git version: 489d177dbd0f0420a8ca04d39fd78d0a2c539420
2018-01-31T00:31:39.641-0800 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1u-fips  22 Sep 2016
2018-01-31T00:31:39.642-0800 I CONTROL  [initandlisten] allocator: tcmalloc
2018-01-31T00:31:39.642-0800 I CONTROL  [initandlisten] modules: none
2018-01-31T00:31:39.643-0800 I CONTROL  [initandlisten] build environment:
2018-01-31T00:31:39.643-0800 I CONTROL  [initandlisten]     distmod: 2008plus-ssl
2018-01-31T00:31:39.644-0800 I CONTROL  [initandlisten]     distarch: x86_64
2018-01-31T00:31:39.645-0800 I CONTROL  [initandlisten]     target_arch: x86_64
2018-01-31T00:31:39.646-0800 I CONTROL  [initandlisten] options: { net: { port: 27017 }, storage: { dbPath: "C:\Users\20173591\Documents\GitHub\prijzen-volger\data" } }
2018-01-31T00:31:39.650-0800 I -        [initandlisten] Detected data files in C:\Users\20173591\Documents\GitHub\prijzen-volger\data created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2018-01-31T00:31:39.651-0800 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=3523M,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-01-31T00:31:39.832-0800 I STORAGE  [initandlisten] WiredTiger message [1517387499:832376][12248:140720232489296], txn-recover: Main recovery loop: starting at 12/768
2018-01-31T00:31:39.953-0800 I STORAGE  [initandlisten] WiredTiger message [1517387499:952865][12248:140720232489296], txn-recover: Recovering log 12 through 13
2018-01-31T00:31:40.034-0800 I STORAGE  [initandlisten] WiredTiger message [1517387500:33883][12248:140720232489296], txn-recover: Recovering log 13 through 13
2018-01-31T00:31:40.162-0800 I CONTROL  [initandlisten]
2018-01-31T00:31:40.162-0800 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2018-01-31T00:31:40.163-0800 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2018-01-31T00:31:40.164-0800 I CONTROL  [initandlisten]
2018-01-31T00:31:40.166-0800 I CONTROL  [initandlisten] ** WARNING: This server is bound to localhost.
2018-01-31T00:31:40.167-0800 I CONTROL  [initandlisten] **          Remote systems will be unable to connect to this server.
2018-01-31T00:31:40.168-0800 I CONTROL  [initandlisten] **          Start the server with --bind_ip <address> to specify which IP
2018-01-31T00:31:40.168-0800 I CONTROL  [initandlisten] **          addresses it should serve responses from, or with --bind_ip_all to
2018-01-31T00:31:40.168-0800 I CONTROL  [initandlisten] **          bind to all interfaces. If this behavior is desired, start the
2018-01-31T00:31:40.169-0800 I CONTROL  [initandlisten] **          server with --bind_ip 127.0.0.1 to disable this warning.
2018-01-31T00:31:40.169-0800 I CONTROL  [initandlisten]
2018-01-31T00:31:40.169-0800 I CONTROL  [initandlisten]
2018-01-31T00:31:40.170-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-01-31T00:31:40.170-0800 I CONTROL  [initandlisten] See http://dochub.mongodb.org/core/wt-windows-system-file-cache
2018-01-31T00:31:40.171-0800 I CONTROL  [initandlisten]
2018-01-31T09:31:40.181+0100 F CONTROL  [initandlisten] ** IMPORTANT: UPGRADE PROBLEM: The data files need to be fully upgraded to version 3.4 before attempting an upgrade to 3.6; see http://dochub.mongodb.org/core/3.6-upgrade-fcv for more details.
2018-01-31T09:31:40.181+0100 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
2018-01-31T09:31:40.182+0100 I REPL     [initandlisten] shutdown: removing all drop-pending collections...
2018-01-31T09:31:40.182+0100 I REPL     [initandlisten] shutdown: removing checkpointTimestamp collection...
2018-01-31T09:31:40.183+0100 I STORAGE  [initandlisten] WiredTigerKVEngine shutting down
2018-01-31T09:31:40.569+0100 I STORAGE  [initandlisten] WiredTiger message [1517387500:568961][12248:140720232489296], txn-recover: Main recovery loop: starting at 13/3072
2018-01-31T09:31:40.690+0100 I STORAGE  [initandlisten] WiredTiger message [1517387500:690284][12248:140720232489296], txn-recover: Recovering log 13 through 14
2018-01-31T09:31:40.771+0100 I STORAGE  [initandlisten] WiredTiger message [1517387500:770531][12248:140720232489296], txn-recover: Recovering log 14 through 14
2018-01-31T09:31:41.010+0100 I STORAGE  [initandlisten] shutdown: removing fs lock...
2018-01-31T09:31:41.011+0100 I CONTROL  [initandlisten] now exiting
2018-01-31T09:31:41.012+0100 I CONTROL  [initandlisten] shutting down with code:62

I notice the following message:

2018-01-31T09:31:40.181+0100 F CONTROL  [initandlisten] ** IMPORTANT: UPGRADE PROBLEM: The data files need to be fully upgraded to version 3.4 before attempting an upgrade to 3.6; see http://dochub.mongodb.org/core/3.6-upgrade-fcv for more details.

But this is the first ever time that i'm using MongoDB so there is no way that the data files are not version 3.6. I'm using MongoDB version 3.6.2 and making entries with Node.js.

What is causing this problem, and how can I retrieve my data files back? I have lost over 2 million entries twice already which are a pain in the ass to load in the database.

Thomas Wagenaar
  • 6,489
  • 5
  • 30
  • 73
  • Why a downvote? Explain please. – Thomas Wagenaar Jan 31 '18 at 08:45
  • Found [this](https://stackoverflow.com/questions/48381581/upgrading-older-mongo-database-after-unintentional-mongo-version-upgrade) and [this](https://stackoverflow.com/questions/48127879/mongod-error-installed-with-homebrew) and they didn't help? No vote from me... – marekful Jan 31 '18 at 08:47
  • @marekful thanks, the second one offers a remedy rather than a cure. When I delete the data folder, it works fine, but once I restart the mongoDB I get an upgrade error. – Thomas Wagenaar Jan 31 '18 at 08:48
  • What about the first? – marekful Jan 31 '18 at 08:50
  • @marekful I installed mongodb `v3.6.2` yesterday, I don't believe it would downgrade the version between two starts. – Thomas Wagenaar Jan 31 '18 at 08:51
  • What the first linked answer implies is that there is some difference in the data file format in these versions. I would try... Read the linked doc. Need to set compat. flag. – marekful Jan 31 '18 at 08:56
  • You may be dealing with the result of a half-successful upgrade because you failed to meet prerequisites? – marekful Jan 31 '18 at 08:58
  • What pre-requisites are needed? – Thomas Wagenaar Jan 31 '18 at 08:59
  • "Read the linked doc. Need to set compat. flag." – marekful Jan 31 '18 at 09:00
  • Have you actually read that tiny short document titled "Upgrade a Standalone to 3.6"? Seriously... – marekful Jan 31 '18 at 09:01
  • @marekful no I haven't, because I have no clue what `Standalone` is in this case. The only thing I did is download mongoDB from [here](https://www.mongodb.com/download-center#community), and run it. Nowhere does this involve an upgrade what so ever – Thomas Wagenaar Jan 31 '18 at 09:04
  • Well, please **always** read the manual. There you go: https://docs.mongodb.com/manual/release-notes/3.6-upgrade-standalone/#prerequisites – marekful Jan 31 '18 at 09:06
  • I get the same problem it work for me https://stackoverflow.com/questions/47850004/mongodb-shutting-down-with-code62 @ThomasW – wyx Jun 07 '18 at 07:42

2 Answers2

1

I still do not understand what causes this problem. However, I managed to solve it. One must downgrade from 3.6 to 3.4:

  • Download the 3.4 binaries (link)
  • Run your server with the new 3.4 mongod.exe file
Thomas Wagenaar
  • 6,489
  • 5
  • 30
  • 73
0

I had the same problem after fresh install:

$ brew update
$ brew install mongodb
$ mkdir -p /data/db
$ sudo chown -R `id -un` /data/db
$ mongod

see console output when trying to run $ mongod

According to documentation exit code 62 is returned by mongod if the datafiles in --dbpath are incompatible with the version of mongod currently running. A reinstall solved the issue:

$ brew uninstall mongodb
$ brew install mongod
Ultradoxx
  • 668
  • 7
  • 14