[SOLVED] Kadira endevent forced complete

Been getting this error over and over again the last few days - doesn’t seem to be impacting the app in any any noticeable way but something seems off.

Kadira endevent forced complete [
  {
    "type": "start",
    "at": 1548310453922,
    "data": {
      // params sent to a method call here
    }
  },
  {
    "type": "wait",
    "at": 1548310453922,
    "data": {}
  },
  {
    "type": "waitend",
    "at": 1548310453922,
    "data": {
      "waitOn": []
    }
  },
  {
    "type": "db",
    "at": 1548310453925,
    "data": {
      "coll": "users",
      "func": "find",
      "selector": // userId
    }
  },
  {
    "type": "dbend",
    "at": 1548310453925,
    "data": {}
  },
  {
    "type": "db",
    "at": 1548310453925,
    "data": {
      "coll": "users",
      "selector": "{\"_id\":\" \"}",
      "func": "fetch",
      "cursor": true,
      "limit": 1
    }
  },
  {
    "type": "dbend",
    "at": 1548310453927,
    "data": {
      "docsFetched": 1,
      "docSize": 2916
    }
  },
  {
    "type": "db",
    "at": 1548310453934,
    "data": {
      "coll": "users",
      "func": "find",
      "selector": "{\"emails.address\":\"email@address.com\"}"
    }
  },
  {
    "type": "dbend",
    "at": 1548310453934,
    "data": {}
  },
  {
    "type": "db",
    "at": 1548310453934,
    "data": {
      "coll": "users",
      "selector": "{\"emails.address\":\"email@address.com\"}",
      "func": "fetch",
      "cursor": true,
      "limit": 1
    }
  },
  {
    "type": "dbend",
    "at": 1548310453936,
    "data": {
      "docsFetched": 0,
      "docSize": 0
    }
  },
  {
    "type": "db",
    "at": 1548310453936,
    "data": {
      "coll": "users",
      "selector": "{\"$and\":[{\"$or\":[{\"emails.address\":{}},{\"emails.address\":{}},{\"emails.address\":{}},{\"emails.address\":{}},{\"emails.address\":{}},{\"emails.address\":{}},{\"emails.address\":{}},{\"emails.address\":{}},{\"emails.address\":{}},{\"emails.address\":{}},{\"emails.address\":{}},{\"emails.address\":{}},{\"emails.address\":{}},{\"emails.address\":{}},{\"emails.address\":{}},{\"emails.address\":{}}]},{\"emails.address\":{}}]}",
      "func": "fetch",
      "cursor": true
    }
  },
  {
    "type": "dbend",
    "at": 1548310453938,
    "data": {
      "docsFetched": 0,
      "docSize": 0
    }
  },
  {
    "type": "async",
    "at": 1548310453938
  },
  {
    "type": "asyncend",
    "at": 1548310453938
  },
  {
    "type": "db",
    "at": 1548310453952,
    "data": {
      "coll": "collectionName",
      "func": "insert"
    }
  },
  {
    "type": "dbend",
    "at": 1548310454033,
    "data": {}
  },
  {
    "type": "db",
    "at": 1548310454035,
    "data": {
      "coll": "collectionName",
      "func": "find",
      "selector": "{\"sender._id\":\"userId\"}"
    }
  },
  {
    "type": "dbend",
    "at": 1548310454035,
    "data": {}
  },
  {
    "type": "db",
    "at": 1548310454035,
    "data": {
      "coll": "collectionName",
      "selector": "{\"sender._id\":\"userId\"}",
      "func": "count",
      "cursor": true
    }
  },
  {
    "type": "dbend",
    "at": 1548310454040
  }
];

Based on this link: https://github.com/meteorhacks/kadira/issues/174 - the closes relevant package in my case regarding this is natestrauser:publish-performant-counts - but that is not a new package (been using it in the app for about 12 months).

Has anyone come across this or can anyone point me in the right direction as to what could be done about it? Is it simply a case of not returning this.ready() from a particular publication?

Thanks in advance

Update - stripped out the packed: natestrauser:publish-performant-counts and moved the counter requirement of my app into a method call that fires every few seconds instead (I don’t need it to be instant instant anyway).

Zero effect though - this error keeps cropping up.

Is Galaxy Support the go-to here (I take it this is an APM thing)?

Kadira doesn’t cope well with asynchronous calls, either async/await or promises and ends up firing this warning. I think it’s harmless though, but clearly annoying if it’s filling up your logs. We use montiapm and he’s removed the warning but I’m not sure he’s actually sovled the issue yet.

There has been a PR open on Meteor APM for almost a year now to remove it.

1 Like

Ah righto, that sounds slightly reassuring and ties in with the fact that everything seems to be running okay.

I think I’ll leave it alone and observe the issue, especially since I’m in the process of moving out of Galaxy anyway (and MontiAPM was good when I previously tried it).

Thanks @marklynch :+1:

PR https://github.com/meteor/meteor-apm-agent/pull/5 has just been released in mdg:meteor-apm-agent@3.2.1. Please try running meteor update mdg:meteor-apm-agent when you have a chance!

1 Like

Cheers mate. I’ll update and post back/mark as solved once I do :+1:

For anybody else having this issue, can confirm that @benjamn’s fix above does it. Apologies for the slow update here.