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
4k stars 540 forks source link

Installing MeshCentral 1.1.30 causes loop for installing archiver@7.0.1 #6397

Open 4pack opened 1 day ago

4pack commented 1 day ago

Describe the bug When installing MeshCentral 1.1.30 on Ubuntu 20.04 and NodeJS 20, causes a loop for Missing Module: archiver@7.0.1

NPM reports it as up to date and it is present in node_modules. MeshCentral is configured where it cannot run NPM itself.

MeshCentral 1.1.25 works perfectly fine.

To Reproduce

  1. Configure MeshCentral to not be able to run NPM itself
  2. npm install meshcentral@1.1.30
  3. Manually install dependencies that MeshCentral requests
  4. MeshCentral loops with Missing Module: archiver@7.0.1

Expected behavior MeshCentral installs/upgrades successfully and detects the dependencies correctly.

Server Software (please complete the following information):

Client Device (please complete the following information):

Remote Device (please complete the following information):

Additional context Add any other context about the problem here.

Your config.json file N/A

si458 commented 1 day ago

Yes, this is because the release of 1.1.30 we forgot to change the package.json version! We only changed it inside of meshcentral itself! So a work around is too meshcentral So a normal npm install meshcentral Then do an npm install archiver@7.0.1 Then restart meshcentral

4pack commented 1 day ago

Yeah, that's exactly what I did. It was part of the manual NPM dependency command, but the issue is that MeshCentral doesn't detect that it's actually installed.

image

4pack commented 1 day ago

And this is after fully deleting node_modules, package.json, and package-lock.json.

si458 commented 1 day ago

@4pack that seems weird? i dont have that issue here? whats the testrun.sh inside your screenshot? thats nothing we use?

4pack commented 1 day ago

All ./testrun.sh does is checks permissions and runs meshcentral in debug mode.

#!/bin/sh

chown -R meshcentral:meshcentral /opt/meshcentral

cd /opt/meshcentral
sudo -u meshcentral NODE_EXTRA_CA_CERTS=/opt/meshcentral/rootca.crt node ./node_modules/meshcentral --debug
si458 commented 1 day ago

are you running npm install archiver@7.0.1 from within /opt/meshcentral also?

4pack commented 1 day ago

Yes I am, and using the testrun script ensures that the file owners are correct.

D4V3M0NK commented 20 hours ago

Seeing the same thing here ...

D4V3M0NK commented 19 hours ago

As a follow up to this - I'd like to understand what can be done to revert back to a prior version of MC2.

For example, I've renamed up my meshcentral-data/files and node_modules folders to *.old and then, with the existing version of node etc, used npm install meshcentral@1.1.25 to revert back to a prior version. Starting up appears to work without issue, although I do need to register myself as an admin again. Makes sense.

Now that I have a working server, can I stop the service from running, simply rename my *.old folders back to their original names and then start the server again?

si458 commented 19 hours ago

ok ive just checked on my mac, installing meshcentral and running installs archiver@7.0.1 cuz of the bug but then stop and start and it tries again to install? so the might be a bug with something so ill look into it

it doesnt effect anything, its just annoying that every time you stop meshcentral and start it (or restart) it will attempt to install archiver again 🙄

si458 commented 18 hours ago

ok so to fix the bug,

  1. stop meshcentral
  2. remove archiver npm remove archiver from the root of your folder (/opt/meshcentral in some cases)
  3. cd node_modules/meshcentral/
  4. npm install archiver@7.0.1
  5. start meshcentral