Skip to content

Migration error: Unsupported OP_QUERY command #7

@ralf-berger

Description

@ralf-berger

What version were you using?

Branch issue/4-create-admin-user-on-startup

What steps can we follow to reproduce the behaviour?

The Branch belonging to #4 introduces migrations for MongoDB to be run before using accessing the database. Running those during startup (Compose service migrations) causes the following error.

What is the actual behaviour?

$ node cli/dist/server migrateMongo --up

(node:28) UnhandledPromiseRejectionWarning: MongoError: Unsupported OP_QUERY command: insert. ⏎
  The client driver may require an upgrade. For more details see [https://dochub.mongodb.org/core/legacy-opcode-removal⁠](https://dochub.mongodb.org/core/legacy-opcode-removal)
    at Function.MongoError.create (/opt/learninglocker/node_modules/mongodb-core/lib/error.js:31:11)
    at /opt/learninglocker/node_modules/mongodb-core/lib/connection/pool.js:497:72
    at authenticateStragglers (/opt/learninglocker/node_modules/mongodb-core/lib/connection/pool.js:443:16)
    at Connection.messageHandler (/opt/learninglocker/node_modules/mongodb-core/lib/connection/pool.js:477:5)
    at Socket.<anonymous> (/opt/learninglocker/node_modules/mongodb-core/lib/connection/connection.js:333:22)
    at Socket.emit (events.js:198:13)
    at Socket.EventEmitter.emit (domain.js:448:20)
    at addChunk (_stream_readable.js:288:12)
    at readableAddChunk (_stream_readable.js:269:11)
    at Socket.Readable.push (_stream_readable.js:224:10)
    at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)

What is the expected behavior?

It's supposed to apply required schema/data updates to MongoDB.

Is there any additional information that will help us replicate/understand the problem?

The application uses Node 10, MongoDB 6.0, Yarn (mongoose 5.5, mongodb 3.3)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions