Comments (17)
Thanks @OvrAp3x . Working here with your fix.
from meshcentral-scripttask.
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.
from meshcentral-scripttask.
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.
from meshcentral-scripttask.
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)
from meshcentral-scripttask.
I also tried 0.9.47 and got the same.
from meshcentral-scripttask.
Hi again! Anyone found a workaround for this? All Ryan's plugins are unusable for me currently.
from meshcentral-scripttask.
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)
from meshcentral-scripttask.
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)
from meshcentral-scripttask.
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?
from meshcentral-scripttask.
@SpookOz Just as an FYI: I have 0.9.56 running here.
from meshcentral-scripttask.
Yeah, i also running that version
from meshcentral-scripttask.
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)
from meshcentral-scripttask.
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)
from meshcentral-scripttask.
Same problem. It had worked for a while, but recently it stopped.
Have tried different docker images, no luck.
from meshcentral-scripttask.
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)
from meshcentral-scripttask.
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!
from meshcentral-scripttask.
Solved for ma as well. Many thanks!!
from meshcentral-scripttask.
Related Issues (20)
- Feature request: Tags in scripts
- No vertical scroll bar when number of scripts exceed window height
- -
- Bypass ExecutionPolicy HOT 2
- High CPU usage with ScriptTask plugin enabled HOT 2
- Cant get the plugin to install HOT 3
- Reboot loop in Linux
- Schedule task to launch as soon as agents are connected
- Memory leak
- Error instantiating new plugin: Error: Cannot find module 'mongodb
- Dark Mode Compatibility HOT 2
- Enhancement: Python 3.x Execution enablement?
- only allow a specific group to use this
- unable to scroll down list of tasks HOT 1
- Install Issues - Internal Server Error HOT 1
- Attempting to install results in Value not defined HOT 1
- Question-is it possible to trigger a script upon guest link expiration
- Repeating Scripts being saved in the Mesh Agent folder and filling up the client disk
- Cannot use script task
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meshcentral-scripttask.