Upgrading Ubuntu from 16.04 to 18.04 breaks MongoDB
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mongodb (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Upgrading from 16.04 to 18.04 breaks existing mongoDB databases.
Pre update versions:
> lsb_release -rd
Description: Ubuntu 16.04.6 LTS
Release: 16.04
> apt-cache policy mongodb
mongodb:
Installed: 1:2.6.10-0ubuntu1
Candidate: 1:2.6.10-0ubuntu1
Version table:
*** 1:2.6.10-0ubuntu1 500
500 http://
100 /var/lib/
Post upgrade versions:
mongodb:
Installed: 1:3.6.3-0ubuntu1.1
Candidate: 1:3.6.3-0ubuntu1.1
Version table:
*** 1:3.6.3-0ubuntu1.1 500
500 http://
100 /var/lib/
1:
500 http://
After upgrading the release, the existing database files fail to load with the error:
** IMPORTANT: UPGRADE PROBLEM: The data files need to be fully upgraded to version 3.4 before attempting an upgrade to 3.6; see http://
To reproduce this I can use a fresh install of 16.04 fullyupdated, with a MongoDB running on it, and upgrade it to 18.04.
I did a few more attempts, following these steps:
- Install 16.04
- apt update
- apt upgrade
- apt install mongodb
- Create simple database (using compass), insert a collection with a few entries
- do-release-upgrade
- MongoDB fails to start
Errors in the logs: document- oriented database.
May 28 11:55:31 mongo systemd[1]: Started An object/
May 28 11:55:35 mongo systemd[1]: mongodb.service: Main process exited, code=dumped, status=11/SEGV
May 28 11:55:35 mongo systemd[1]: mongodb.service: Failed with result 'core-dump'.
I attempted to start mongo manually: /var/lib/ mongodb /var/lib/ mongodb 64-bit host=mongo f9ca4b43c26892c d55257e1a5 mongodb/ mongod. lock is not empty. lib/mongodb/ journal mongodb/ journal/ j._0 mongodb/ journal/ j._0 mongodb/ journal/ prealloc. 0
> mongod --dbpath=
Which resulted in this output:
CONTROL [initandlisten] MongoDB starting : pid=1889 port=27017 dbpath=
CONTROL [initandlisten] db version v3.6.3
CONTROL [initandlisten] git version: 9586e557d54ef70
CONTROL [initandlisten] OpenSSL version: OpenSSL 1.1.1 11 Sep 2018
CONTROL [initandlisten] allocator: tcmalloc
CONTROL [initandlisten] modules: none
CONTROL [initandlisten] build environment:
CONTROL [initandlisten] distarch: x86_64
CONTROL [initandlisten] target_arch: x86_64
CONTROL [initandlisten] options: { storage: { dbPath: "/var/lib/mongodb" } }
- [initandlisten] Detected unclean shutdown - /var/lib/
- [initandlisten] Detected data files in /var/lib/mongodb created by the 'mmapv1' storage engine, so setting the active storage engine to 'mmapv1'.
JOURNAL [initandlisten] journal dir=/var/
JOURNAL [initandlisten] recover begin
JOURNAL [initandlisten] info no lsn file in journal/ directory
JOURNAL [initandlisten] recover lsn: 0
JOURNAL [initandlisten] recover /var/lib/
JOURNAL [initandlisten] recover cleaning up
JOURNAL [initandlisten] removeJournalFiles
JOURNAL [initandlisten] old journal file will be removed: /var/lib/
JOURNAL [initandlisten] recover done
JOURNAL [initandlisten] preallocating a journal file /var/lib/
JOURNAL [durability] Durability thread started
JOURNAL [journal writer] Journal writer thread started
CONTROL [initandlisten]
CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
CONTROL [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
CONTROL [initandlisten]
CONTROL [initandlisten] ** WARNING: This server is bound to localhost.
CONTROL [initandlisten] ** Remote systems will be unable to connect to this server.
CONTROL [initandlisten] ** Start the server with --bind_ip <address> to specify which IP
CONTROL [initandlisten] ** addresses it should serve responses from, or with --bind_ip_all to
CONTROL [initandlisten] ** bind to all interfaces. If this behavior is desired, start the
CONTROL [initandlisten] ** server with --bind_ip 127.0.0.1 to disable this warning.
CONTROL [initandlisten]
INDEX [initandlisten] error: hashtable namespace index max chain reached:1335
- [initandlisten] In...