Ylianst / MeshCentral

A complete web-based remote monitoring and management web site. Once setup you can install agents and perform remote desktop session to devices on the local network or over the Internet.
https://meshcentral.com
Apache License 2.0
3.68k stars 511 forks source link

Updated from 1.22 to 1.23 and Now Crashing from meshuser.jsL821 realname #6121

Closed scottalanmiller closed 1 month ago

scottalanmiller commented 1 month ago

Errors below. Updated from 1.22 to 1.23 as normal, system starts but crashes and reboots in a few seconds with an error about meshuser.js on line 821.

To Reproduce, just start normally and it happens immediately.

OS: Ubuntu 22.04.04 (fully patched) Virt: KVM on Vultr Version: 1.23 Node: 18.18.2

Additional context MeshCentral HTTP redirection server running on port 80. MeshCentral v1.1.23, WAN mode. MeshCentral Intel(R) AMT server running on mc.ntg.co:4433. MeshCentral HTTPS server running on mc.ntg.co:443. ERR: /opt/meshcentral/node_modules/meshcentral/meshuser.js:821 if (parent.users[a].realname) { docs[i].links[a].name = parent.users[a].realname; } ^

TypeError: Cannot read properties of undefined (reading 'realname') at /opt/meshcentral/node_modules/meshcentral/meshuser.js:821:57 at /opt/meshcentral/node_modules/meshcentral/db.js:2838:61 at newArguments. (/opt/meshcentral/node_modules/@yetzt/nedb/lib/executor.js:29:17) at Cursor.execFn (/opt/meshcentral/node_modules/@yetzt/nedb/lib/datastore.js:485:12) at callback (/opt/meshcentral/node_modules/@yetzt/nedb/lib/cursor.js:126:19) at /opt/meshcentral/node_modules/@yetzt/nedb/lib/cursor.js:193:12 at /opt/meshcentral/node_modules/@yetzt/nedb/lib/datastore.js:330:14 at wrapper (/opt/meshcentral/node_modules/async/dist/async.js:273:20) at replenish (/opt/meshcentral/node_modules/async/dist/async.js:443:29) at /opt/meshcentral/node_modules/async/dist/async.js:453:13 at eachLimit (/opt/meshcentral/node_modules/async/dist/async.js:2720:36) at awaitable (/opt/meshcentral/node_modules/async/dist/async.js:212:32) at Object.eachSeries (/opt/meshcentral/node_modules/async/dist/async.js:2748:16) at Object.awaitable (/opt/meshcentral/node_modules/async/dist/async.js:212:32) at /opt/meshcentral/node_modules/@yetzt/nedb/lib/datastore.js:324:11 at nextTask (/opt/meshcentral/node_modules/async/dist/async.js:5791:13)

Node.js v18.18.2 Error: Command failed: /root/.nvm/versions/node/v18.18.2/bin/node /opt/meshcentral/node_modules/meshcentral --launch 1721 /opt/meshcentral/node_modules/meshcentral/meshuser.js:821 if (parent.users[a].realname) { docs[i].links[a].name = parent.users[a].realname; } ^

TypeError: Cannot read properties of undefined (reading 'realname') at /opt/meshcentral/node_modules/meshcentral/meshuser.js:821:57 at /opt/meshcentral/node_modules/meshcentral/db.js:2838:61 at newArguments. (/opt/meshcentral/node_modules/@yetzt/nedb/lib/executor.js:29:17) at Cursor.execFn (/opt/meshcentral/node_modules/@yetzt/nedb/lib/datastore.js:485:12) at callback (/opt/meshcentral/node_modules/@yetzt/nedb/lib/cursor.js:126:19) at /opt/meshcentral/node_modules/@yetzt/nedb/lib/cursor.js:193:12 at /opt/meshcentral/node_modules/@yetzt/nedb/lib/datastore.js:330:14 at wrapper (/opt/meshcentral/node_modules/async/dist/async.js:273:20) at replenish (/opt/meshcentral/node_modules/async/dist/async.js:443:29) at /opt/meshcentral/node_modules/async/dist/async.js:453:13 at eachLimit (/opt/meshcentral/node_modules/async/dist/async.js:2720:36) at awaitable (/opt/meshcentral/node_modules/async/dist/async.js:212:32) at Object.eachSeries (/opt/meshcentral/node_modules/async/dist/async.js:2748:16) at Object.awaitable (/opt/meshcentral/node_modules/async/dist/async.js:212:32) at /opt/meshcentral/node_modules/@yetzt/nedb/lib/datastore.js:324:11 at nextTask (/opt/meshcentral/node_modules/async/dist/async.js:5791:13)

Node.js v18.18.2

at ChildProcess.exithandler (node:child_process:422:12)
at ChildProcess.emit (node:events:529:35)
at maybeClose (node:internal/child_process:1098:16)
at ChildProcess._handle.onexit (node:internal/child_process:303:5) {

code: 1, killed: false, signal: null, cmd: '/root/.nvm/versions/node/v18.18.2/bin/node /opt/meshcentral/node_modules/meshcentral --launch 1721' } ERROR: MeshCentral failed with critical error, check mesherrors.txt. Restarting in 5 seconds...

Your config.json file

{
  "$schema": "https://raw.githubusercontent.com/Ylianst/MeshCentral/master/meshcentral-config-schema.json",
  "__comment1__": "This is a simple configuration file, all values and sections that start with underscore (_) are ignored. Edit a section and remove the _ in front of the name. Refer to the user's guide for details.",
  "__comment2__": "See node_modules/meshcentral/sample-config-advanced.json for a more advanced example.",
  "settings": {
    "_cert": "myserver.mydomain.com",
    "_WANonly": true,
    "_LANonly": true,
    "_sessionKey": "MyReallySecretPassword1",
    "_port": 443,
    "_aliasPort": 443,
    "_redirPort": 80,
    "_redirAliasPort": 80
  },
  "domains": {
    "": {
      "_title": "MyServer",
      "_title2": "Servername",
      "_minify": true,
      "_newAccounts": true,
      "_userNameIsEmail": true
    }
  },
  "_letsencrypt": {
    "__comment__": "Requires NodeJS 8.x or better, Go to https://letsdebug.net/ first before trying Let's Encrypt.",
    "email": "myemail@mydomain.com",
    "names": "myserver.mydomain.com",
    "production": false
  }
}
si458 commented 1 month ago

DUPLICATE OF https://github.com/Ylianst/MeshCentral/issues/6118 simple patch is here https://github.com/Ylianst/MeshCentral/issues/6118#issuecomment-2129107029 sorry about this! i dont no what happened?

P.S: will try ask @Ylianst to do another release to fix this issue as the patch is already merged