"MongoError" exceptionMessage="Topology was destroyed"

I sometimes get an 502 connection error on CPE. I found out that every time I see a 502 there was a MongoError. Could this be a bug or is this caused by a timeout that can be tweaked?. Don´t see errors in Mongo log.

genieacs v1.1.3 on Ubuntu 14.04 trusty

[ERROR] Uncaught exception; pid=1318 exceptionName=“Error” exceptionMessage=“Invalid alias expression” exceptionStack=“Error: Invalid alias expression\n at parseAlias (/usr/local/share/.config/yarn/global/node_modules/genieacs/lib/common.js:126:15)\n at Object.parsePath (/usr/local/share/.config/yarn/global/node_modules/genieacs/lib/common.js:204:13)\n at Object.refresh (/usr/local/share/.config/yarn/global/node_modules/genieacs/lib/default-provisions.js:30:21)\n at runProvisions (/usr/local/share/.config/yarn/global/node_modules/genieacs/lib/session.js:476:47)\n at Object.rpcRequest (/usr/local/share/.config/yarn/global/node_modules/genieacs/lib/session.js:758:12)\n at nextRpc (/usr/local/share/.config/yarn/global/node_modules/genieacs/lib/cwmp.js:468:18)\n at /usr/local/share/.config/yarn/global/node_modules/genieacs/lib/cwmp.js:585:12\n at Object.rpcRequest (/usr/local/share/.config/yarn/global/node_modules/genieacs/lib/session.js:744:12)\n at nextRpc (/usr/local/share/.config/yarn/global/node_modules/genieacs/lib/cwmp.js:468:18)\n at /usr/local/share/.config/yarn/global/node_modules/genieacs/lib/cwmp.js:978:14”

[ERROR] Uncaught exception; pid=5173 exceptionName=“MongoError” exceptionMessage=“Topology was destroyed” exceptionStack=“MongoError: Topology was destroyed\n at nextFunction (/usr/local/share/.config/yarn/global/node_modules/mongodb-core/lib/cursor.js:547:27)\n at Cursor.next [as _next] (/usr/local/share/.config/yarn/global/node_modules/mongodb-core/lib/cursor.js:701:3)\n at nextObject (/usr/local/share/.config/yarn/global/node_modules/mongodb/lib/cursor.js:680:8)\n at Cursor.next (/usr/local/share/.config/yarn/global/node_modules/mongodb/lib/cursor.js:270:12)\n at findOne (/usr/local/share/.config/yarn/global/node_modules/mongodb/lib/collection.js:1414:10)\n at Collection.findOne (/usr/local/share/.config/yarn/global/node_modules/mongodb/lib/collection.js:1400:44)\n at Object.mongoGet [as get] (/usr/local/share/.config/yarn/global/node_modules/genieacs/lib/cache.js:169:21)\n at Timeout._onTimeout (/usr/local/share/.config/yarn/global/node_modules/genieacs/lib/cwmp.js:786:20)\n at ontimeout (timers.js:386:14)\n at Timer.unrefdHandle (timers.js:492:5)”

Mongodb.log

2019-08-28T12:13:45.026+0200 I NETWORK [thread1] connection accepted from 127.0.0.1:39242 #1076 (59 connections now open)
2019-08-28T12:13:51.290+0200 I NETWORK [thread1] connection accepted from 127.0.0.1:39244 #1077 (60 connections now open)
2019-08-28T12:13:56.660+0200 I NETWORK [thread1] connection accepted from 127.0.0.1:39246 #1078 (61 connections now open)
2019-08-28T12:13:58.774+0200 I NETWORK [thread1] connection accepted from 127.0.0.1:39248 #1079 (62 connections now open)
2019-08-28T12:14:01.482+0200 I NETWORK [thread1] connection accepted from 127.0.0.1:39252 #1080 (63 connections now open)
2019-08-28T12:14:01.482+0200 I NETWORK [conn1080] received client metadata from 127.0.0.1:39252 conn1080: { driver: { name: “PyMongo”, version: “3.7.2” }, os: { type: “Linux”, name: “Ubuntu 14.04 trusty”, architecture: “x86_64”, version: “4.4.0-124-generic” }, platfor$
2019-08-28T12:14:01.484+0200 I NETWORK [thread1] connection accepted from 127.0.0.1:39254 #1081 (64 connections now open)
2019-08-28T12:14:01.484+0200 I NETWORK [conn1081] received client metadata from 127.0.0.1:39254 conn1081: { driver: { name: “PyMongo”, version: “3.7.2” }, os: { type: “Linux”, name: “Ubuntu 14.04 trusty”, architecture: “x86_64”, version: “4.4.0-124-generic” }, platfor$
2019-08-28T12:14:01.484+0200 I - [conn1081] end connection 127.0.0.1:39254 (64 connections now open)
2019-08-28T12:14:01.484+0200 I - [conn1080] end connection 127.0.0.1:39252 (64 connections now open)
2019-08-28T12:14:04.931+0200 I NETWORK [thread1] connection accepted from 127.0.0.1:39280 #1082 (63 connections now open)
2019-08-28T12:14:04.932+0200 I NETWORK [conn1082] received client metadata from 127.0.0.1:39280 conn1082: { driver: { name: “PyMongo”, version: “3.7.2” }, os: { type: “Linux”, name: “Ubuntu 14.04 trusty”, architecture: “x86_64”, version: “4.4.0-124-generic” }, platfor$
2019-08-28T12:14:04.933+0200 I NETWORK [thread1] connection accepted from 127.0.0.1:39282 #1083 (64 connections now open)
2019-08-28T12:14:04.933+0200 I NETWORK [conn1083] received client metadata from 127.0.0.1:39282 conn1083: { driver: { name: “PyMongo”, version: “3.7.2” }, os: { type: “Linux”, name: “Ubuntu 14.04 trusty”, architecture: “x86_64”, version: “4.4.0-124-generic” }, platfor$
2019-08-28T12:14:04.940+0200 I - [conn1083] end connection 127.0.0.1:39282 (64 connections now open)
2019-08-28T12:14:04.940+0200 I - [conn1082] end connection 127.0.0.1:39280 (64 connections now open)
2019-08-28T12:14:10.242+0200 I - [conn944] end connection 127.0.0.1:37834 (62 connections now open)
2019-08-28T12:14:10.242+0200 I - [conn986] end connection 127.0.0.1:38230 (61 connections now open)
2019-08-28T12:14:10.242+0200 I - [conn940] end connection 127.0.0.1:37826 (61 connections now open)
2019-08-28T12:14:10.242+0200 I - [conn943] end connection 127.0.0.1:37832 (61 connections now open)
2019-08-28T12:14:10.242+0200 I - [conn941] end connection 127.0.0.1:37828 (58 connections now open)
2019-08-28T12:14:10.242+0200 I - [conn942] end connection 127.0.0.1:37830 (58 connections now open)
2019-08-28T12:14:10.242+0200 I - [conn949] end connection 127.0.0.1:37910 (56 connections now open)
2019-08-28T12:14:11.691+0200 I - [conn1071] end connection 127.0.0.1:39206 (55 connections now open)
2019-08-28T12:14:11.692+0200 I - [conn1067] end connection 127.0.0.1:39198 (54 connections now open)
2019-08-28T12:14:11.692+0200 I - [conn1070] end connection 127.0.0.1:39204 (53 connections now open)
2019-08-28T12:14:11.692+0200 I - [conn1076] end connection 127.0.0.1:39242 (52 connections now open)
2019-08-28T12:14:11.693+0200 I - [conn1069] end connection 127.0.0.1:39202 (51 connections now open)
2019-08-28T12:14:11.693+0200 I - [conn1068] end connection 127.0.0.1:39200 (50 connections now open)
2019-08-28T12:14:19.531+0200 I NETWORK [thread1] connection accepted from 127.0.0.1:39348 #1084 (50 connections now open)

This error is basically saying that in one of your scripts you’re calling declare() on path that contains an invalid alias expression.

This happens when a task stucks in queue. When I delete the CPE and it gets re-added again everything is fine. Problem is that the worker dies every time I get this exception and other provisioning tasks gets impacted. What does “MongoError: Topology was destroyed” mean?

What’s the task? Did you double check your scripts for potentially invalid parameter paths?

That’s from the MongoDB connector and I haven’t actually looked into it. It’s the first exception that’s important here.