Updated to latest MSR 21243 and no entities are being executed I Hubitat
-
After update no entities are being executed in Hubitat..... I can se in Recently Changed Entities that a motion sensor for example is triggered but the rule in it is not getting set
im I missing something in the update @toggledbits ?getting this in msr log:
Require stack:
- /home/pi/reactor/server/lib/Engine.js
- /home/pi/reactor/server/lib/httpapi.js
- /home/pi/reactor/app.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Engine._get_lexp_extensions (/home/pi/reactor/server/lib/Engine.js:862:25)
at Rule.evaluateExpressions (/home/pi/reactor/server/lib/Rule.js:904:330)
at Rule._evaluate (/home/pi/reactor/server/lib/Rule.js:994:344)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async /home/pi/reactor/server/lib/Rule.js:963:17 {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/pi/reactor/server/lib/Engine.js',
'/home/pi/reactor/server/lib/httpapi.js',
'/home/pi/reactor/app.js'
]
}
-
toggledbitswrote on Sep 1, 2021, 10:44 PM last edited by toggledbits Sep 1, 2021, 6:46 PM
When posting error messages, please don't (a) edit the error message down to what you think is relevant, and (b) not post context for the error -- several lines, ideally a dozen or two at least, before the error occurred.
Also I need to know what platform you are on (e.g. are you bare metal, docker, etc. -- don't assume I remember from the last discussion we had, whenever that was).
-
Hi Sorry.. my bad....
Im on RPi4 with ssd
2021-09-02T04:01:04.708Z Rule:5:980:Rule.js Rule#rule-koqsgr9w._evaluate() mutex acquired, evaluating
2021-09-02T04:01:04.709Z Rule:5:984:Rule.js Rule#rule-koqsgr9w update rate is 1/min limit 60/min
2021-09-02T04:01:04.710Z Rule:5:904:Rule.js Rule#rule-koqsgr9w evaluateExpressions() with 0 expressions
2021-09-02T04:01:04.712Z Rule:CRIT Error: Cannot find module 'common/util'
Require stack:- /home/pi/reactor/server/lib/Engine.js
- /home/pi/reactor/server/lib/httpapi.js
- /home/pi/reactor/app.js
Error: Cannot find module 'common/util'
Require stack: - /home/pi/reactor/server/lib/Engine.js
- /home/pi/reactor/server/lib/httpapi.js
- /home/pi/reactor/app.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Engine._get_lexp_extensions (/home/pi/reactor/server/lib/Engine.js:862:25)
at Rule.evaluateExpressions (/home/pi/reactor/server/lib/Rule.js:904:330)
at Rule._evaluate (/home/pi/reactor/server/lib/Rule.js:994:344)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async /home/pi/reactor/server/lib/Rule.js:963:17
Error: Cannot find module 'common/util'
Require stack: - /home/pi/reactor/server/lib/Engine.js
- /home/pi/reactor/server/lib/httpapi.js
- /home/pi/reactor/app.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Engine._get_lexp_extensions (/home/pi/reactor/server/lib/Engine.js:862:25)
at Rule.evaluateExpressions (/home/pi/reactor/server/lib/Rule.js:904:330)
at Rule._evaluate (/home/pi/reactor/server/lib/Rule.js:994:344)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async /home/pi/reactor/server/lib/Rule.js:963:17 {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/pi/reactor/server/lib/Engine.js',
'/home/pi/reactor/server/lib/httpapi.js',
'/home/pi/reactor/app.js'
]
}
2021-09-02T04:01:04.715Z Rule:5:980:Rule.js Rule#rule-knhvm6nr._evaluate() mutex acquired, evaluating
2021-09-02T04:01:04.716Z Rule:5:984:Rule.js Rule#rule-knhvm6nr update rate is 1/min limit 60/min
2021-09-02T04:01:04.717Z Rule:5:904:Rule.js Rule#rule-knhvm6nr evaluateExpressions() with 0 expressions
2021-09-02T04:01:04.719Z Rule:CRIT Error: Cannot find module 'common/util'
Require stack: - /home/pi/reactor/server/lib/Engine.js
- /home/pi/reactor/server/lib/httpapi.js
- /home/pi/reactor/app.js
Error: Cannot find module 'common/util'
Require stack: - /home/pi/reactor/server/lib/Engine.js
- /home/pi/reactor/server/lib/httpapi.js
- /home/pi/reactor/app.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Engine._get_lexp_extensions (/home/pi/reactor/server/lib/Engine.js:862:25)
at Rule.evaluateExpressions (/home/pi/reactor/server/lib/Rule.js:904:330)
at Rule._evaluate (/home/pi/reactor/server/lib/Rule.js:994:344)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async /home/pi/reactor/server/lib/Rule.js:963:17
Error: Cannot find module 'common/util'
Require stack: - /home/pi/reactor/server/lib/Engine.js
- /home/pi/reactor/server/lib/httpapi.js
- /home/pi/reactor/app.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Engine._get_lexp_extensions (/home/pi/reactor/server/lib/Engine.js:862:25)
at Rule.evaluateExpressions (/home/pi/reactor/server/lib/Rule.js:904:330)
at Rule._evaluate (/home/pi/reactor/server/lib/Rule.js:994:344)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async /home/pi/reactor/server/lib/Rule.js:963:17 {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/pi/reactor/server/lib/Engine.js',
'/home/pi/reactor/server/lib/httpapi.js',
'/home/pi/reactor/app.js'
]
}
-
@matteburk could check this post, although you probably have some other issue
-
Looks like the same issue I'm having in this post which I haven't been able to solve yet.
-
Had the same issue. Reaction as a group would not fire but entities within the Reaction would when manually selecting them (hit the little play button next to them). Everything else looked normal from a Status perspective (i.e. motion detected sending the rule into green status, etc). I fixed the problem by installing a fresh copy (leaving the reactor-data folder untouched).
-
Make sure you are on the latest version, and
NODE_PATH
(environment variable) is defined correctly (how that is done depends on how you run Reactor). -
@toggledbits I run it with Node app.js
-
@matteburk OK. So the direct solution to your problem is to run it this way:
NODE_PATH=$(pwd) node app.js
You really should be running it from
systemd
on the RPi, though. The command line startup is only for initial validation and setup, it's not meant to be the way to run MSR long term.In the
tools
subdirectory, you'll find a file calledreactor.service-example
. To install MSR undersystemd
, do the following:-
Copy the above-named file into your
/etc/systemd/system
directory and rename it to drop the-example
part. For example:sudo cp tools/reactor.service-example /etc/systemd/system/reactor.service
-
Edit the new file and change the pathnames to match your install directory. Remember that the file is installed in a restricted directory, so you need to use
sudo
with your editor:sudo nano /etc/systemd/system/reactor.service
-
Once you have the file edited with correct names/parameters, stop your existing Reactor process.
-
Make
systemd
aware of the changed configuration file:sudo systemctl daemon-reload
-
Start Reactor under
systemd
:sudo systemctl start reactor
If you need to stop Reactor later, that's
systemctl stop reactor
. You can also restart a running Reactor withsystemctl restart reactor
.Running Reactor under
systemd
will automatically restart it if it crashes, and start it up automatically when your RPi boots up. -
-
@toggledbits@
Followed your instructions to run it under systemd but when i do nr 4 and 5 reactor won't start...
Should I write sudo systemctl start reactor under pi@raspberrypi as in picture?/Mattias
-
This is correct. Check
/var/log/syslog
for startup errors. -
This is what the log says:
Sep 5 00:00:00 raspberrypi rsyslogd: [origin software="rsyslogd" swVersion="8.1901.0" x-pid="383" x-info="https://www.rsyslog.com"] rsyslogd was HUPed
Sep 5 00:00:00 raspberrypi rsyslogd: [origin software="rsyslogd" swVersion="8.1901.0" x-pid="383" x-info="https://www.rsyslog.com"] rsyslogd was HUPed
Sep 5 00:00:00 raspberrypi systemd[1]: logrotate.service: Succeeded.
Sep 5 00:00:00 raspberrypi systemd[1]: Started Rotate log files.
Sep 5 00:00:00 raspberrypi systemd[1]: man-db.service: Succeeded.
Sep 5 00:00:00 raspberrypi systemd[1]: Started Daily man-db regeneration.
Sep 5 00:00:02 raspberrypi colord[955]: failed to get session [pid 17774]: Inga data tillg\u00e4ngliga
Sep 5 00:00:05 raspberrypi systemd[1]: reactor.service: Service RestartSec=5s expired, scheduling restart.
Sep 5 00:00:05 raspberrypi systemd[1]: reactor.service: Scheduled restart job, restart counter is at 9474.
Sep 5 00:00:05 raspberrypi systemd[1]: Stopped Multi System Reactor.
Sep 5 00:00:05 raspberrypi systemd[1]: Started Multi System Reactor.
Sep 5 00:00:05 raspberrypi systemd[17799]: reactor.service: Failed to determine user credentials: No such process
Sep 5 00:00:05 raspberrypi systemd[17799]: reactor.service: Failed at step USER spawning /usr/local/lib/nodejs/bin/node: No such process
Sep 5 00:00:05 raspberrypi systemd[1]: reactor.service: Main process exited, code=exited, status=217/USER
Sep 5 00:00:05 raspberrypi systemd[1]: reactor.service: Failed with result 'exit-code'.
Sep 5 00:00:10 raspberrypi systemd[1]: reactor.service: Service RestartSec=5s expired, scheduling restart.
Sep 5 00:00:10 raspberrypi systemd[1]: reactor.service: Scheduled restart job, restart counter is at 9475.
Sep 5 00:00:10 raspberrypi systemd[1]: Stopped Multi System Reactor.
Sep 5 00:00:10 raspberrypi systemd[1]: Started Multi System Reactor.
Sep 5 00:00:10 raspberrypi systemd[17800]: reactor.service: Failed to determine user credentials: No such process
Sep 5 00:00:10 raspberrypi systemd[17800]: reactor.service: Failed at step USER spawning /usr/local/lib/nodejs/bin/node: No such process
Sep 5 00:00:10 raspberrypi systemd[1]: reactor.service: Main process exited, code=exited, status=217/USER
Sep 5 00:00:10 raspberrypi systemd[1]: reactor.service: Failed with result 'exit-code'.
Sep 5 00:00:15 raspberrypi systemd[1]: reactor.service: Service RestartSec=5s expired, scheduling restart.
Sep 5 00:00:15 raspberrypi systemd[1]: reactor.service: Scheduled restart job, restart counter is at 9476.
Sep 5 00:00:15 raspberrypi systemd[1]: Stopped Multi System Reactor.
Sep 5 00:00:15 raspberrypi systemd[1]: Started Multi System Reactor.
Sep 5 00:00:15 raspberrypi systemd[17801]: reactor.service: Failed to determine user credentials: No such process
Sep 5 00:00:15 raspberrypi systemd[17801]: reactor.service: Failed at step USER spawning /usr/local/lib/nodejs/bin/node: No such process
Sep 5 00:00:15 raspberrypi systemd[1]: reactor.service: Main process exited, code=exited, status=217/USER
Sep 5 00:00:15 raspberrypi systemd[1]: reactor.service: Failed with result 'exit-code'.
Sep 5 00:00:21 raspberrypi systemd[1]: reactor.service: Service RestartSec=5s expired, scheduling restart.
Sep 5 00:00:21 raspberrypi systemd[1]: reactor.service: Scheduled restart job, restart counter is at 9477.
Sep 5 00:00:21 raspberrypi systemd[1]: Stopped Multi System Reactor.
Sep 5 00:00:21 raspberrypi systemd[1]: Started Multi System Reactor.
Sep 5 00:00:21 raspberrypi systemd[17802]: reactor.service: Failed to determine user credentials: No such process
Sep 5 00:00:21 raspberrypi systemd[17802]: reactor.service: Failed at step USER spawning /usr/local/lib/nodejs/bin/node: No such process
Sep 5 00:00:21 raspberrypi systemd[1]: reactor.service: Main process exited, code=exited, status=217/USER
Sep 5 00:00:21 raspberrypi systemd[1]: reactor.service: Failed with result 'exit-code'.
Sep 5 00:00:26 raspberrypi systemd[1]: reactor.service: Service RestartSec=5s expired, scheduling restart.
Sep 5 00:00:26 raspberrypi systemd[1]: reactor.service: Scheduled restart job, restart counter is at 9478. -
Looks like you haven't set the
User=
line correctly in thereactor.service
file. It should be the name of the user that owns the directory in which Reactor is installed. While you are at it, check the pathname to the Reactor install (in theWorkingDirectory
andEnvironment
keys), and the pathname to thenode
executable used in theExecStart
key. If you're not sure where yournode
lives, just typewhich node
on the command line and it will tell you. -
I checked and changed the lines to this ( I guess something is wrong there)
[Unit]
Description=Multi System Reactor
After=network.target[Service]
Type=simple
User=pi
WorkingDirectory=/home/pi/reactor
Environment=NODE_PATH=/home/pi/reactor
ExecStart=/home/pi/.local/lib/nodejs/node-v14.15.4-linux-armv7l/bin/nodeRestart=on-failure
RestartSec=5s[Install]
WantedBy=multi-user.targetand restarted reactor....... then I see this in log.....
Sep 5 15:26:16 raspberrypi systemd[9870]: reactor.service: Failed to determine user credentials: No such process
Sep 5 15:26:16 raspberrypi systemd[9870]: reactor.service: Failed at step USER spawning /usr/local/lib/nodejs/bin/node: No such process
Sep 5 15:26:16 raspberrypi systemd[1]: reactor.service: Main process exited, code=exited, status=217/USER
Sep 5 15:26:16 raspberrypi systemd[1]: reactor.service: Failed with result 'exit-code'.
Sep 5 15:26:21 raspberrypi systemd[1]: reactor.service: Service RestartSec=5s expired, scheduling restart.
Sep 5 15:26:21 raspberrypi systemd[1]: reactor.service: Scheduled restart job, restart counter is at 20060.
Sep 5 15:26:21 raspberrypi systemd[1]: Stopped Multi System Reactor.
Sep 5 15:26:21 raspberrypi systemd[1]: Started Multi System Reactor.
Sep 5 15:26:21 raspberrypi systemd[9871]: reactor.service: Failed to determine user credentials: No such process
Sep 5 15:26:21 raspberrypi systemd[9871]: reactor.service: Failed at step USER spawning /usr/local/lib/nodejs/bin/node: No such process
Sep 5 15:26:21 raspberrypi systemd[1]: reactor.service: Main process exited, code=exited, status=217/USER
Sep 5 15:26:21 raspberrypi systemd[1]: reactor.service: Failed with result 'exit-code'.
Sep 5 15:26:22 raspberrypi systemd[1]: Reloading.
Sep 5 15:26:22 raspberrypi systemd[1]: /etc/systemd/system/teamviewerd.service:8: PIDFile= references path below legacy directory /var/run/, updating /var/run/teamviewerd.pid \u2192 /run/teamviewerd.pid; please update the unit file accordingly.
Sep 5 15:26:26 raspberrypi systemd[1]: reactor.service: Service RestartSec=5s expired, scheduling restart.
Sep 5 15:26:26 raspberrypi systemd[1]: reactor.service: Scheduled restart job, restart counter is at 20061.
Sep 5 15:26:26 raspberrypi systemd[1]: Stopped Multi System Reactor.
Sep 5 15:26:26 raspberrypi systemd[1]: Started Multi System Reactor.
Sep 5 15:26:27 raspberrypi systemd[1]: reactor.service: Succeeded.
Sep 5 15:26:42 raspberrypi systemd[1]: Started Multi System Reactor.
Sep 5 15:26:43 raspberrypi systemd[1]: reactor.service: Succeeded.
Sep 5 15:34:06 raspberrypi systemd[1]: Started Multi System Reactor.
Sep 5 15:34:06 raspberrypi systemd[1]: reactor.service: Succeeded. -
It looks like it's referring to a different pathname for nodejs than you have configured in the service file. Did you make a change to that value somewhere along the way? If you make any changes to the config file, you need to do
sudo systemctl daemon-reload
to get systemd to read the updated config file. So the first step is to trysudo systemctl daemon-reload
followed bysudo systemctl restart reactor
.If that doesn't work, it is reported elsewhere that
sudo systemctl daemon-reexec
may resolve this (or perhaps simply rebooting the whole system).Then step three, if you're still not successful, is to see if Reactor is logging anything in its own log files.
-
I have followed your instructions but no success.
Dont no what to do..... Here is the log from msr
/MattiasRequire stack:
- /home/pi/reactor/server/lib/Engine.js
- /home/pi/reactor/server/lib/httpapi.js
- /home/pi/reactor/app.js
Error: Cannot find module 'common/util'
Require stack: - /home/pi/reactor/server/lib/Engine.js
- /home/pi/reactor/server/lib/httpapi.js
- /home/pi/reactor/app.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Engine._get_lexp_extensions (/home/pi/reactor/server/lib/Engine.js:862:25)
at Rule.evaluateExpressions (/home/pi/reactor/server/lib/Rule.js:904:330)
at Rule._evaluate (/home/pi/reactor/server/lib/Rule.js:994:344)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async /home/pi/reactor/server/lib/Rule.js:963:17
2021-09-06T16:19:30.352Z Rule:5:980:Rule.js Rule#rule-ksn5u2pn._evaluate() mutex acquired, evaluating
2021-09-06T16:19:30.352Z Rule:5:984:Rule.js Rule#rule-ksn5u2pn update rate is 0/min limit 60/min
2021-09-06T16:19:30.353Z Rule:5:904:Rule.js Rule#rule-ksn5u2pn evaluateExpressions() with 0 expressions
2021-09-06T16:19:30.354Z Rule:CRIT Error: Cannot find module 'common/util'
Require stack: - /home/pi/reactor/server/lib/Engine.js
- /home/pi/reactor/server/lib/httpapi.js
- /home/pi/reactor/app.js
Error: Cannot find module 'common/util'
Require stack: - /home/pi/reactor/server/lib/Engine.js
- /home/pi/reactor/server/lib/httpapi.js
- /home/pi/reactor/app.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Engine._get_lexp_extensions (/home/pi/reactor/server/lib/Engine.js:862:25)
at Rule.evaluateExpressions (/home/pi/reactor/server/lib/Rule.js:904:330)
at Rule._evaluate (/home/pi/reactor/server/lib/Rule.js:994:344)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async /home/pi/reactor/server/lib/Rule.js:963:17
2021-09-06T16:19:30.356Z Rule:5:980:Rule.js Rule#rule-ksm11ihr._evaluate() mutex acquired, evaluating
2021-09-06T16:19:30.356Z Rule:5:984:Rule.js Rule#rule-ksm11ihr update rate is 0/min limit 60/min
2021-09-06T16:19:30.357Z Rule:5:904:Rule.js Rule#rule-ksm11ihr evaluateExpressions() with 0 expressions
2021-09-06T16:19:30.358Z Rule:CRIT Error: Cannot find module 'common/util'
Require stack: - /home/pi/reactor/server/lib/Engine.js
- /home/pi/reactor/server/lib/httpapi.js
- /home/pi/reactor/app.js
Error: Cannot find module 'common/util'
Require stack: - /home/pi/reactor/server/lib/Engine.js
- /home/pi/reactor/server/lib/httpapi.js
- /home/pi/reactor/app.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Engine._get_lexp_extensions (/home/pi/reactor/server/lib/Engine.js:862:25)
at Rule.evaluateExpressions (/home/pi/reactor/server/lib/Rule.js:904:330)
at Rule._evaluate (/home/pi/reactor/server/lib/Rule.js:994:344)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async /home/pi/reactor/server/lib/Rule.js:963:17
-
@matteburk Try installing 21200 just to see if you get MSR running again.
-
The messages in the log you posted indicate that NODE_PATH is incorrectly set, so I now cannot be sure if we're back at your original problem because you have tried to run it from the command line and this log is from that, or if this log is from an attempted systemd startup, which makes no sense because the service file you published earlier sets the environment variable correctly.
I've given you everything you need to get going again. I'm not sure what else to do. You need to figure it out, though, because this is how this and all future builds will be working, and right now, you're the only person I know of that isn't running, so I'm assuming its a local configuration issue and not a package/software issue.
Can you stop any local startup, start again with systemd, and post the startup portion of the log file? I don't want to see the error message again, I need to see all the messages from a Reactor startup under systemd. That will start with the string
Reactor <version> starting on <nodejs version>
and give me everything up toStartup complete
. -
@toggledbits ok... yes for sure it is me setting something up wrong... will struggle some more...
4/47