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

getScriptTree error #23

Closed
efmunu opened this issue Nov 7, 2021 · 17 comments
Closed

getScriptTree error #23

efmunu opened this issue Nov 7, 2021 · 17 comments

Comments

@efmunu
Copy link

efmunu commented Nov 7, 2021

I was able to install the plugin but when I go to the plugins tab for the remote machine I get the following error:

TypeError: Cannot read property 'getScriptTree' of null at Object.obj.handleAdminReq (/home/ec2-user/meshcentral-data/plugins/scripttask/scripttask.js:224:20) at Object.obj.handleAdminReq (/home/ec2-user/node_modules/meshcentral/pluginHandler.js:522:40) at obj.handlePluginAdminReq (/home/ec2-user/node_modules/meshcentral/webserver.js:5376:34) at Layer.handle [as handle_request] (/home/ec2-user/node_modules/express/lib/router/layer.js:95:5) at next (/home/ec2-user/node_modules/express/lib/router/route.js:137:13) at Route.dispatch (/home/ec2-user/node_modules/express/lib/router/route.js:112:3) at Layer.handle [as handle_request] (/home/ec2-user/node_modules/express/lib/router/layer.js:95:5) at /home/ec2-user/node_modules/express/lib/router/index.js:281:22 at Function.process_params (/home/ec2-user/node_modules/express/lib/router/index.js:335:12) at next (/home/ec2-user/node_modules/express/lib/router/index.js:275:10) at /home/ec2-user/node_modules/meshcentral/webserver.js:5622:20 at Layer.handle [as handle_request] (/home/ec2-user/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/home/ec2-user/node_modules/express/lib/router/index.js:317:13) at /home/ec2-user/node_modules/express/lib/router/index.js:284:7 at Function.process_params (/home/ec2-user/node_modules/express/lib/router/index.js:335:12) at next (/home/ec2-user/node_modules/express/lib/router/index.js:275:10)

Any ideas why that is?
(Running on Amazon Linux)

@SpookOz
Copy link

SpookOz commented Nov 9, 2021

Same error for me too. Was working perfectly until recent upgrade to 0.9.47 version of MC (or perhaps the previous version). Have updated the plugin to 0.0.17. I'm getting a similar error on your other plugins Ryan. Cheers.

@dmft33
Copy link

dmft33 commented Nov 9, 2021

Same issue here. Running 0.9.38 in Docker.

ERR: TypeError: Cannot read property 'getScriptTree' of null
at Object.obj.handleAdminReq (/opt/meshcentral/meshcentral-data/plugins/scripttask/scripttask.js:224:20)
at Object.obj.handleAdminReq (/opt/meshcentral/node_modules/meshcentral/pluginHandler.js:522:40)
at obj.handlePluginAdminReq (/opt/meshcentral/node_modules/meshcentral/webserver.js:5376:34)
at Layer.handle [as handle_request] (/opt/meshcentral/node_modules/express/lib/router/layer.js:95:5)
at next (/opt/meshcentral/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/opt/meshcentral/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/opt/meshcentral/node_modules/express/lib/router/layer.js:95:5)
at /opt/meshcentral/node_modules/express/lib/router/index.js:281:22
at Function.process_params (/opt/meshcentral/node_modules/express/lib/router/index.js:335:12)
at next (/opt/meshcentral/node_modules/express/lib/router/index.js:275:10)

@dmft33
Copy link

dmft33 commented Nov 9, 2021

I also tried 0.9.47 and got the same.

@SpookOz
Copy link

SpookOz commented Nov 30, 2021

Hi again! Anyone found a workaround for this? All Ryan's plugins are unusable for me currently.

@1ARdotNO
Copy link

Getting the same error, there is also a message pre-ceeding the message posted above here relating to "nedb"

Error instantiating new plugin: { Error: Cannot find module 'nedb', at Timeout._onTimeout (/opt/meshcentral/node_modules/meshcentral/pluginHandler.js:428:146), at Module.require (internal/modules/cjs/loader.js:692:17), at require (internal/modules/cjs/helpers.js:25:18), at Function.Module._load (internal/modules/cjs/loader.js:562:25), at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15), at Object.module.exports.CreateDB (/opt/meshcentral/meshcentral-data/plugins/scripttask/db.js:289:21), at Object.obj.server_startup (/opt/meshcentral/meshcentral-data/plugins/scripttask/scripttask.js:38:85), at ontimeout (timers.js:436:11), at tryOnTimeout (timers.js:300:5), at listOnTimeout (timers.js:263:5) code: 'MODULE_NOT_FOUND' }, ERR: TypeError: Cannot read property 'getScriptTree' of null, at Object.obj.handleAdminReq (/opt/meshcentral/meshcentral-data/plugins/scripttask/scripttask.js:224:20), at Object.obj.handleAdminReq (/opt/meshcentral/node_modules/meshcentral/pluginHandler.js:522:40), at obj.handlePluginAdminReq (/opt/meshcentral/node_modules/meshcentral/webserver.js:5450:34), at Layer.handle [as handle_request] (/opt/meshcentral/node_modules/express/lib/router/layer.js:95:5), at next (/opt/meshcentral/node_modules/express/lib/router/route.js:137:13), at Route.dispatch (/opt/meshcentral/node_modules/express/lib/router/route.js:112:3), at /opt/meshcentral/node_modules/express/lib/router/index.js:281:22, at Function.process_params (/opt/meshcentral/node_modules/express/lib/router/index.js:335:12), at next (/opt/meshcentral/node_modules/express/lib/router/index.js:275:10)

@1ARdotNO
Copy link

The clue to a fix was in the error message,
I am also running in docker and seems like I was missing a dependency.
npm install nedb
This fixed the issue for me, I was also running in docker so the nedb module was not included there by the npm install meshcentral

if anybody else wants a fix it is published here,
https://github.com/OvrAp3x/meshcentral-docker
https://hub.docker.com/repository/docker/einar/meshcentral (image is rebuilt with newest version of meshcentral daily)

@ternst-micado
Copy link

Thanks @OvrAp3x . Working here with your fix.

@SpookOz
Copy link

SpookOz commented Dec 10, 2021

Thanks @OvrAp3x . Unfortunately, this didn't work in my case - and I don't see the error relating to nedb. Can I ask what version of MC you are using?

@ternst-micado
Copy link

@SpookOz Just as an FYI: I have 0.9.56 running here.

@1ARdotNO
Copy link

Yeah, i also running that version

1ARdotNO added a commit to 1ARdotNO/MeshCentral that referenced this issue Dec 12, 2021
fixes problems with plugins as referenced here ryanblenis/MeshCentral-ScriptTask#23
@thinkbig1979
Copy link

thinkbig1979 commented Dec 24, 2021

I'm also getting a 'getScriptTree' error that is not related to NeDB.
I am on 0.9.62 and the latest version of the plugin (0.0.17).

TypeError: Cannot read property 'getScriptTree' of null
    at Object.obj.handleAdminReq (/root/meshcentral/meshcentral-data/plugins/scripttask/scripttask.js:224:20)
    at Object.obj.handleAdminReq (/root/meshcentral/node_modules/meshcentral/pluginHandler.js:522:40)
    at obj.handlePluginAdminReq (/root/meshcentral/node_modules/meshcentral/webserver.js:5452:34)
    at Layer.handle [as handle_request] (/root/meshcentral/node_modules/express/lib/router/layer.js:95:5)
    at next (/root/meshcentral/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/root/meshcentral/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/root/meshcentral/node_modules/express/lib/router/layer.js:95:5)
    at /root/meshcentral/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/root/meshcentral/node_modules/express/lib/router/index.js:335:12)
    at next (/root/meshcentral/node_modules/express/lib/router/index.js:275:10)

@JSuenram
Copy link

Same here... latest MC and Plugin-Version.
-------- 14.1.2022, 09:46:01 ---- 0.9.68 --------

TypeError: Cannot read property 'getScriptTree' of null
at Object.obj.handleAdminReq (/etc/meshcentral/meshcentral-data/plugins/scripttask/scripttask.js:224:20)
at Object.obj.handleAdminReq (/etc/meshcentral/node_modules/meshcentral/pluginHandler.js:522:40)
at obj.handlePluginAdminReq (/etc/meshcentral/node_modules/meshcentral/webserver.js:5485:34)
at Layer.handle [as handle_request] (/etc/meshcentral/node_modules/express/lib/router/layer.js:95:5)
at next (/etc/meshcentral/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/etc/meshcentral/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/etc/meshcentral/node_modules/express/lib/router/layer.js:95:5)
at /etc/meshcentral/node_modules/express/lib/router/index.js:281:22
at Function.process_params (/etc/meshcentral/node_modules/express/lib/router/index.js:341:12)
at next (/etc/meshcentral/node_modules/express/lib/router/index.js:275:10)

@poiNt3D
Copy link

poiNt3D commented Mar 4, 2022

Same problem. It had worked for a while, but recently it stopped.
Have tried different docker images, no luck.

@djangomcdjangerson
Copy link

I can also confirm this issue running on a Windows Server 2012 instance.

TypeError: Cannot read property 'getScriptTree' of null at Object.obj.handleAdminReq (C:\Program Files\Open Source\MeshCentral\meshcentral-data\plugins\scripttask\scripttask.js:224:20) at Object.obj.handleAdminReq (C:\Program Files\Open Source\MeshCentral\node_modules\meshcentral\pluginHandler.js:521:40) at obj.handlePluginAdminReq (C:\Program Files\Open Source\MeshCentral\node_modules\meshcentral\webserver.js:5527:34) at Layer.handle [as handle_request] (C:\Program Files\Open Source\MeshCentral\node_modules\express\lib\router\layer.js:95:5) at next (C:\Program Files\Open Source\MeshCentral\node_modules\express\lib\router\route.js:137:13) at Route.dispatch (C:\Program Files\Open Source\MeshCentral\node_modules\express\lib\router\route.js:112:3) at Layer.handle [as handle_request] (C:\Program Files\Open Source\MeshCentral\node_modules\express\lib\router\layer.js:95:5) at C:\Program Files\Open Source\MeshCentral\node_modules\express\lib\router\index.js:281:22 at Function.process_params (C:\Program Files\Open Source\MeshCentral\node_modules\express\lib\router\index.js:341:12) at next (C:\Program Files\Open Source\MeshCentral\node_modules\express\lib\router\index.js:275:10)

@ryanblenis
Copy link
Owner

Updated to use MC's latest version of nedb (@yetzt/nedb), and remove the promise requirement which has gone away in the latest MC in lieu of later versions of Node.

@SpookOz
Copy link

SpookOz commented Mar 13, 2022

Thanks Ryan! It's working again. Really appreciate you taking the time to look into this and resolve it. These plugins add so much functionality to MC!

@thinkbig1979
Copy link

Solved for ma as well. Many thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants