meteor icon indicating copy to clipboard operation
meteor copied to clipboard

Error in oplog_v2_converter: Cannot read property 'i' of null

Open arggh opened this issue 3 years ago • 3 comments

Our logs show some errors from the Oplog converter. We also had some other, adjacent errors that could be explained by a client having received bad/old/stale data from a subscription, so it's possible these errors had actually an impact on the reliability of our Meteor app.

Error in oplog callback TypeError: Cannot read property 'i' of null
    at nestedOplogEntryParsers (packages/mongo/oplog_v2_converter.js:61:11)
    at packages/mongo/oplog_v2_converter.js:98:9
    at Array.forEach (<anonymous>)
    at nestedOplogEntryParsers (packages/mongo/oplog_v2_converter.js:64:27)
    at packages/mongo/oplog_v2_converter.js:98:9
    at Array.forEach (<anonymous>)
    at nestedOplogEntryParsers (packages/mongo/oplog_v2_converter.js:64:27)
    at packages/mongo/oplog_v2_converter.js:98:9
    at Array.forEach (<anonymous>)
    at nestedOplogEntryParsers (packages/mongo/oplog_v2_converter.js:64:27)
    at oplogV2V1Converter (packages/mongo/oplog_v2_converter.js:141:22)
    at packages/mongo/oplog_observe_driver.js:607:16
    at Object.Meteor._noYieldsAllowed (packages/meteor.js:783:12)
    at OplogObserveDriver._handleOplogEntrySteadyOrFetching (packages/mongo/oplog_observe_driver.js:579:12)
    at packages/mongo/oplog_observe_driver.js:133:20
    at packages/mongo/oplog_observe_driver.js:17:9
    at Object.Meteor._noYieldsAllowed (packages/meteor.js:783:12)
    at packages/mongo/oplog_observe_driver.js:121:16
    at packages/mongo/oplog_tailing.js:108:7
    at runWithEnvironment (packages/meteor.js:1320:24)
    at Object.callback (packages/meteor.js:1333:14)
    at packages/ddp-server/crossbar.js:114:36

The relevant code seems to be:

const nestedOplogEntryParsers = (oplogEntry, prefixKey = '') => {
  const { i = {}, u = {}, d = {}, ...sFields } = oplogEntry; // oplogEntry was null
  • The version of Meteor showing the problem: 2.6.1
  • The version of MongoDB 5.0.8
  • The operating system you're running Meteor on: Ubuntu 20.04
  • The expected behavior: No errors from oplog converter
  • The actual behavior: Errors from oplog converter

arggh avatar May 15 '22 16:05 arggh

Hi @arggh, is it possible to provide some sort of reproduction, or at least run your app with the EV OPLOG_CONVERTER_DEBUG, so we can see what are the values before it breaks?

denihs avatar May 17 '22 19:05 denihs

A reproduction is probably too much to ask, but I'll run our production apps with OPLOG_CONVERTER_DEBUG set and see if I can catch anything 👍

arggh avatar May 17 '22 20:05 arggh

As it didn't appear for a few months now, I think we can close this one. Also, in 2.8, the oplog converter should be more reliable (OPLOG_CONVERTER_DEBUG is still available).

radekmie avatar Aug 28 '22 11:08 radekmie

Fixed this in #12339

arggh avatar Dec 09 '22 08:12 arggh