You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.
I have an old installation of sharelatex from 2014 with MongoDB 3.2 that I was updating. After updating sharelatex and migrating the database into the newer scheme, I used mongodump to dump the database into a folder and restored it into 3.4 using mongorestore. In restore phase I got the following error:
Failed: sharelatex.subscriptions: error creating indexes for sharelatex.subscriptions: createIndex error: The field 'safe' is not valid for an index specification. Specification: { safe: null, ns: "sharelatex.subscriptions", unique: true, name: "admin_id_1", background: true, key: { admin_id: 1 } }
For some reason sharelatex still uses mongoose 4.1.0 that does not include the fix. I can see that the mongoose upgrade has been already been reverted once but at least there should be a note that mongo 3.4 is not yet supported.
The text was updated successfully, but these errors were encountered:
jpallen
changed the title
Index creation not working in MongoDB 3.4
MongoDB 3.4 not yet supported
Jul 25, 2017
I have an old installation of sharelatex from 2014 with MongoDB 3.2 that I was updating. After updating sharelatex and migrating the database into the newer scheme, I used
mongodump
to dump the database into a folder and restored it into 3.4 usingmongorestore
. In restore phase I got the following error:By using
--noIndexRestore
inmongorestore
, the database restores just fine but no index specifications are being imported or later on created. Also when creating a clean instance with mongodb 3.4, no indexes are being created. I traced the error into this MongoDB change https://docs.mongodb.com/manual/release-notes/3.4-compatibility/#stricter-validation-of-collection-and-index-specificationsBy looking into the sharelatex code in
https://github.com/sharelatex/web-sharelatex/blob/master/app/coffee/models/Subscription.coffee we should still be creating indexes in newest sharelatex. Turns out that the invalid index specification (according to mongo 3.4) is due mongoose Automattic/mongoose#3439 and it has been fixed in 2015 in Automattic/mongoose@781f2b5
For some reason sharelatex still uses mongoose 4.1.0 that does not include the fix. I can see that the mongoose upgrade has been already been reverted once but at least there should be a note that mongo 3.4 is not yet supported.
The text was updated successfully, but these errors were encountered: