Minimongo Error when enabling oplog tailing

This is the first time that I’m enabling oplog tailing and I’m getting the following error in the server:

Got exception while reading last entry: MinimongoError: Key $natural must not start with '$'

This happens from Meteor 1.6-rc.1 to 1.6-rc.10 (did not test any other versions). I’m running MongoDB 3.4.9

This does NOT happen when I disabled oplog tailing. Here is my oplog url

MONGO_OPLOG_URL=mongodb://oplogUser:oplogPassword@privateIp1:27017,privateIp2:27017/local?replicaSet=meteor&authSource=dbName

Any idea on where the problem can be? Did anyone tested Meteor 1.6 with oplog tailing?

1 Like

I remember reading something a few days ago, that in some circumstances, not ALL $functions are supported in SOME situations.

Try researching OpLog supported cursors? Something like that.

I haven’t seen or used $natural, but perhaps, OpLog simply doesn’t support that feature.

TOTAL speculation man, but hey, starting point.

2 Likes

Thanks @SkyRooms.

I actually do not know where to start checking as I don’t use any “$natural” variable or value in my code. It might be one of the packages but when I searched my entire project, I cannot find it.

I turned off oplog tailing as of now while I search for solutions or maybe the source of the problem

1 Like

I’m not convinced this is a 1.6 issue. That message comes from here:

and that file is not part of the current set of amended files for 1.6

1 Like

Thanks again, @robfallows

I’ve been scratching my head for days now and I didn’t even have a clue on where to start debugging.

Learning new things with Meteor everyday.

P.S. I also realized that I need to improve my error logging as it failed to capture the stack trace that should have given me the information about what you have just posted.

1 Like

I’ve had wild success with building a brand new project space, and importing my files there. Especially coming from development, where i’m constantly installing / removing packages like mad.

You might try deleting your .meteor/cache/… bundler? That thing always gives me trouble. Then rebuild your package and try again.

I wonder if it’s how you’re connecting to OpLog?

Are you using an environment variable? Where are you hosting your DB?

(I ask because I’m qued to upgrade to 1.6 very soon, and I use opLog HEAVILY).

How are you using this. Can you send the query? $natural looks like it is supported.

@SkyRooms, there is a big probability that this ain’t an issue with 1.6. I didn’t run oplog tailing with 1.5 so I wasn’t able to test it (no opportunity to test 1.5). I have a hunch that an old package was causing the error but I’m traveling so no chance yet to test. I’ll post an update once I pinned the issue

@brucejo, I wasn’t using it so it should be one of the packages I’m using. I’m going to add/remove packages one by one to figure out what’s causing it.

My hunch: the job-collection package. I’m now thinking to use node-cron instead and just create a simpler admin panel page to handle background jobs (didn’t know that job collection was no longer actively maintained)

did you ever confirm your hunch about your jobs package?

we are getting

Error in oplog callback MinimongoError: Invalid modifier specified $v

and also using a popular meteor jobs packages

I ended up removing the jobs package because it was 1/3 of the size of my app. It doesn’t support dynamic import and the package was no longer maintained.

I ended up using bee-queue. Small size with same major features

1 Like