Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mesh Central deletes itself ?!? #4318

Closed
adsgreen opened this issue Jul 24, 2022 · 6 comments
Closed

Mesh Central deletes itself ?!? #4318

adsgreen opened this issue Jul 24, 2022 · 6 comments

Comments

@adsgreen
Copy link

adsgreen commented Jul 24, 2022

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 ws@5.2.3...
Installing cbor@5.2.0...

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

@adsgreen adsgreen added the bug label Jul 24, 2022
@si458
Copy link
Collaborator

si458 commented Jul 24, 2022

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?

@adsgreen
Copy link
Author

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 acme-client@4.2.5
  • 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)

@si458
Copy link
Collaborator

si458 commented Jul 24, 2022

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...

@Ylianst Ylianst self-assigned this Jul 28, 2022
@Ylianst
Copy link
Owner

Ylianst commented Jul 28, 2022

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 added a commit that referenced this issue Jul 28, 2022
…missing modules. This should remove unwanted module pruning. (#4318)
@Ylianst
Copy link
Owner

Ylianst commented Jul 28, 2022

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

@dinger1986
Copy link
Contributor

@si458 can close

@si458 si458 closed this as completed Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants