ryanblenis / MeshCentral-FileDistribution

File Distribution plugin for MeshCentral
Apache License 2.0
21 stars 5 forks source link

Error in device's plugin tab #1

Closed hchkim closed 2 years ago

hchkim commented 4 years ago

Thank you for creating a nice plugin. When I try to install and use it, I get the following error. How should I do to solve it? image

image

ryanblenis commented 4 years ago

Hi @hchkim,

I'm having trouble replicating the exact issue, but while testing it does look like a prior pull request to MeshCentral caused an issue with newly installed or removed plugins. I've submitted a PR for that here.

Your particular error makes me believe the database was not loaded.

  1. Does the issue persist if you restart your MeshCentral server?
  2. If 1 does not solve the issue, can you confirm that the db.js file exists in your /meshcentral-data/plugins/filedist/ folder?

Thank you.

hchkim commented 4 years ago

Thank you for reply. I found a solution. I just commented "require ('promise')" in the /meshcentral-data/plugins/filedist/db.js file. I guess it caused by nodejs version difference.

ryanblenis commented 4 years ago

Thanks for the info. If you don't mind, what is your Node version so I can test / update the code accordingly? Thank you.

hchkim commented 4 years ago

OK. Thank you. It runs on Ubuntu 16.04.6 LTS

$ node -v v10.16.3

cfoellmann commented 1 year ago

I got the "same" error. I use the docker deployment for meshcentral with the official container image.

In my case the error is only in the mesherrors.txt and the plugin tab only shows Internal Server Error.

-------- 5/10/2023, 8:24:56 AM ---- 1.1.4 --------

TypeError: Cannot read properties of null (reading 'getFileMapsForNode')
    at obj.handleAdminReq (/opt/meshcentral/meshcentral-data/plugins/filedist/filedist.js:147:20)
    at obj.handleAdminReq (/opt/meshcentral/meshcentral/pluginHandler.js:521:40)
    at obj.handlePluginAdminReq (/opt/meshcentral/meshcentral/webserver.js:5971:34)
    at Layer.handle [as handle_request] (/opt/meshcentral/meshcentral/node_modules/express/lib/router/layer.js:95:5)
    at next (/opt/meshcentral/meshcentral/node_modules/express/lib/router/route.js:144:13)
    at Route.dispatch (/opt/meshcentral/meshcentral/node_modules/express/lib/router/route.js:114:3)
    at Layer.handle [as handle_request] (/opt/meshcentral/meshcentral/node_modules/express/lib/router/layer.js:95:5)
    at /opt/meshcentral/meshcentral/node_modules/express/lib/router/index.js:284:15
    at Function.process_params (/opt/meshcentral/meshcentral/node_modules/express/lib/router/index.js:346:12)
    at next (/opt/meshcentral/meshcentral/node_modules/express/lib/router/index.js:280:10)

there in no promise requirement to comment out anymore. Since I have no skills when it comes to JS I am not seeing the underlying issue here