peerlibrary / meteor-peerdb

Reactive database layer with references, generators, triggers, migrations, etc.
http://atmospherejs.com/peerlibrary/peerdb
BSD 3-Clause "New" or "Revised" License
130 stars 15 forks source link

_updateSourceField error #52

Closed MatejJan closed 6 years ago

MatejJan commented 7 years ago

I've encountered this issue after manually deleting a document from the database using MongoHub (in case that makes any difference).

E20170929-15:46:44.240(-4) (lib.coffee:1258) PeerDB exception: TypeError: Cannot read property '0' of undefined: []
E20170929-15:46:44.241(-4) (lib.coffee:1259) TypeError: Cannot read property '0' of undefined
    at _Class.globals.Document.Document._GeneratedField._Class._updateSourceField (packages/peerlibrary_peerdb/lib.coffee:565:8)
    at _Class._updateSourceField (lib.coffee.js:3:57)
    at _Class.globals.Document.Document._GeneratedField._Class.updateSource (packages/peerlibrary_peerdb/lib.coffee:638:10)
    at _Class.updateSource (lib.coffee.js:3:57)
    at _Class.globals.Document.Document._GeneratedField._Class.removeSource (packages/peerlibrary_peerdb/lib.coffee:641:8)
    at _Class.removeSource (lib.coffee.js:3:57)
    at packages/peerlibrary_peerdb/lib.coffee:311:12
    at packages/peerlibrary_peerdb/lib.coffee:1254:11
    at runWithEnvironment (packages/meteor.js:1188:24)
    at packages/meteor.js:1201:14
    at packages/mongo/observe_multiplex.js:182:30
    at Array.forEach (native)
    at Function._.each._.forEach (packages/underscore.js:139:11)
    at Object.task (packages/mongo/observe_multiplex.js:176:9)
    at [object Object].SQp._run (packages/meteor.js:819:16)
    at packages/meteor.js:796:12

My server also started running rapidly out of memory around the same time, so I hope this is not connected. I'm trying to identify the source of any corruption in the DB or anything like that to get a hint on what's going on. This is the first exception I can find that's appearing around my issues.

mitar commented 6 years ago

Any update on this? If you delete a document out of order it might have an update which it cannot anymore apply, so it complains.

MatejJan commented 6 years ago

I haven't ran into this issue again, and the server overloading happened for some other reason (a complex templating system that probably created a huge number of subscriptions).

mitar commented 6 years ago

OK, then I am closing this.