Typhonragewind / meshcentral-docker

168 stars 46 forks source link

Unable to install required module "otplib@10.2.3" #27

Closed Jogai closed 1 year ago

Jogai commented 1 year ago

When trying the normal docker compose I get:

Installing otplib@10.2.3...

ERROR: Unable to install required module "otplib@10.2.3". MeshCentral may not have access to npm, or npm may not have suffisent rights to load the new module. To manualy install this module try:
RoBo-OnGitHub commented 1 year ago

Indeed after first having installed docker container typhonragewind/meshcentral successfully, after an upgrade the docker image is stating:

meshcentral | Installing otplib@10.2.3... meshcentral | ERROR: Unable to install required module "otplib@10.2.3". MeshCentral may not have access to npm, or npm may not have suffisent rights to load the new module. To manualy install this module try: meshcentral | meshcentral | cd "/opt/meshcentral" meshcentral | npm install otplib@10.2.3 meshcentral | node node_modules/meshcentral

Not sure why this is not working, but in my case, after docker-compose up --detach I quickly entered following command I was able to get it working: docker exec -it meshcentral /bin/bash -c 'cd /opt/meshcentral ; npm install otplib@10.2.3 ; node node_modules/meshcentral'

Or as a complete script to pull the latest version and apply the fix: #!/bin/bash docker-compose down docker-compose pull docker-compose up --detach docker exec -it meshcentral /bin/bash -c 'cd /opt/meshcentral ; npm install otplib@10.2.3' docker-compose stop docker-compose start meshcentral

Anyways, Typhonragewind, thanks for providing the docker image, I'm sure this simplifies lives of many!

Typhonragewind commented 1 year ago

With these docker images, you shouldn't use the in app upgrade process as that can break stuff. Just pull the new image and recreate the container and it should work fine

RoBo-OnGitHub commented 1 year ago

Hello Typhonragewind, I might have not expressed myself properly. I didn't do any in-image upgrade. I just pulled the latest version when I've stated to 'upgrade'. I don't remember though if in the previous image I've also already installed the otplib though, so maybe I should not have stated anything about an upgrade. Thanks for looking into the issue.

Typhonragewind commented 1 year ago

Hello Typhonragewind, I might have not expressed myself properly. I didn't do any in-image upgrade. I just pulled the latest version when I've stated to 'upgrade'. I don't remember though if in the previous image I've also already installed the otplib though, so maybe I should not have stated anything about an upgrade. Thanks for looking into the issue.

Huh, that is much weirder. I can't seem to reproduce this error on my end, so could you give me some information about your system, please? (OS, version, architecture, etc)

RoBo-OnGitHub commented 1 year ago

For me it's CentOS Linux release 7.9.2009 (Core); Linux 3.10.0-1160.90.1.el7.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux; Docker version 24.0.2, build cb74dfc; docker-compose version 1.29.2, build 5becea4c; typhonragewind/meshcentral:latest

Typhonragewind commented 1 year ago

Can't for the life of me replicate this issue on my end

Typhonragewind commented 1 year ago

I have pushed an imaged that may fix this issue by preloading the necessary libs, Could you please try using the tag typhonragewind/meshcentral:preloadlib ?

RoBo-OnGitHub commented 1 year ago

Hello Typhonragewind, yes, I can confirm, using :preloadlib it's working out of the box. Pulling :latest is again asking for the otplib. It looks that this lib is not included on CentOS 7.9 OS? Which should be reproducible by creating a VM. However I think you've nailed it by preloading these libs!

Typhonragewind commented 1 year ago

Awesome! As soon as i finish up some other changes i'll push this to the main branch

RoBo-OnGitHub commented 1 year ago

Thanks.. pulled latest and all is okay now. Thanks for your support!

ra3ggi commented 1 year ago

Similar problem again and the "preloadlib:latest" tag doesn't help.