MeshCentral icon indicating copy to clipboard operation
MeshCentral copied to clipboard

Mesh Central deletes itself ?!?

Open adsgreen opened this issue 2 years ago • 5 comments

I have a mesh install that has been running fine for years. Auto updates on.

Everything was find until the last 24 hours and then the server had failed.

internal/modules/cjs/loader.js:800
    throw err;
    ^

Error: Cannot find module './exeHandler.js'
Require stack:
- /home/ec2-user/node_modules/meshcentral/meshcentral.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
    at Function.Module._load (internal/modules/cjs/loader.js:690:27)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at CreateMeshCentralServer (/home/ec2-user/node_modules/meshcentral/meshcentral.js:41:22)
    at /home/ec2-user/node_modules/meshcentral/meshcentral.js:3798:26
    at InstallModules (/home/ec2-user/node_modules/meshcentral/meshcentral.js:3583:121)
    at /home/ec2-user/node_modules/meshcentral/meshcentral.js:3605:9
    at ChildProcess.exithandler (child_process.js:286:7)
    at ChildProcess.emit (events.js:210:5) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/home/ec2-user/node_modules/meshcentral/meshcentral.js' ]
}

Went to restart and the node_modules/meshcentral directry is missing?

When I replace the meshcentral directory and attempt to restart I get:

Installing [email protected]...
Installing [email protected]...

and then the above error again (and a missing meshcentral directory?

adsgreen avatar Jul 24 '22 17:07 adsgreen

PLEASE CAN YOU FOLLOW THE BUG TEMPLATE IN THE FUTURE AS IT HAS CRITICAL INFORMATION IN TO HELP US DEBUG YOUR ISSUE what version where you running? (check a backup of package.json) what version does it think its running now? (check package.json) are you using a docker image or directly from npm? what node version are your running? what os are you running?

si458 avatar Jul 24 '22 17:07 si458

The backup of package json was tool old. 1.0.60 is the version I tried to use. no docker, just npm node v12.13.1 ubuntu 18.02

I managed to fix it by

  • creating a brand new install and copying over the contents of the node_modules folder.
  • npm install [email protected]
  • npm install semver

Then it ran ok. On an image I took before running, even if I used the copied node_modules directory and tried to start the same thing would happen. it would try to auto install the above two packages and then complain about no meshcentral module found (as it was somehow deleted after executing node node_modules/meshcentral)

adsgreen avatar Jul 24 '22 18:07 adsgreen

can you also try updating to the latest LTS version of nodejs? 16.16.0 we are getting a lot of reports from people using old LTS and having issues, but the min they upgrade to the newest LTS 16, everything works again? its very strange...

si458 avatar Jul 24 '22 18:07 si458

This may be a problem from people that have the old acme-client module that is used to get a certificate from Let's Encrypt. When trying to update that module to the new one, npm install will remove all the dependencies that are not explicitly in the package.json. Then, you run the server again and it had to re-install all the modules it just removed.

I just worked out a solution for this a week or two ago, I am going to work on adding this to MeshCentral.

Ylianst avatar Jul 28 '22 22:07 Ylianst

Just put in a fox for this, will be in MeshCentral v1.0.61.

Ylianst avatar Jul 28 '22 22:07 Ylianst

@si458 can close

dinger1986 avatar Nov 26 '23 12:11 dinger1986