MSR Upgrade from 22119 to 22136 fails, service wont start
-
Windows Server 2022 Build 20348
Nodejs v16.14.0
Currently running Reactor (Multi-hub) stable-22119-ae7212f
Linked to Hass 2022.0.5.4 (on a different box)
Windows server is dedicated to MSR and doesn't do anything else.I'd like to upgrade to 22136 to take advantage of the SSL feature added recently, and also to bring my current version of Hass into the 'supported' column with MSR.
Following the instructions here: link text, section "Upgrade Windows Bare Metal"
- Stop Reactor Service
- Extract the zip, overwriting the reactor folder in c:\reactor\reactor
- There is no package-lock.json file so I skip that.
- Run "npm install --no-save --omit dev"
Next step is to start the service. I start the service and it immediately stops. "Windows could not start the Reactor service on Local Computer. Error 1067: The process terminated unexpectedly".
Tried rebooting, service won't stay running.
I suspect I'm missing something, it's probably obvious but I've not been able to figure it out.
I rolled back the reactor folder version (Windows Shadow copies) and then the service starts fine.
Anyone else running Windows and know what I'm missing?
- Tail of log file from running OK version, before upgrade attempt
[stable-22119]2022-06-01T22:20:19.081Z <Rule:INFO> Lounge Billy Ambient Lighting - Turn On (Rule#rule-l0ki453b) evaluation complete [stable-22119]2022-06-01T22:20:19.082Z <httpapi:NOTICE> HTTP API v1 22021 base URL http://172.16.128.6:8111; listening [stable-22119]2022-06-01T22:20:19.228Z <app:NOTICE> HTTP server running; registering proxy endpoints. [stable-22119]2022-06-01T22:20:19.228Z <app:NOTICE> Starting WSAPI... [stable-22119]2022-06-01T22:20:19.229Z <wsapi:NOTICE> wsapi: starting version 21334 [stable-22119]2022-06-01T22:20:19.656Z <Engine:INFO> [Engine]Engine#1 master timer tick, local time "6/2/2022, 8:20:19 AM" (TZ offset 600 mins from UTC) [stable-22119]2022-06-01T22:27:54.788Z <wsapi:INFO> wsapi: connection from ::ffff:172.16.128.5
- Tail of log file from failed to start after upgrade (is identical, ii.e. nothing has been appended to it)
[stable-22119]2022-06-01T22:20:19.081Z <Rule:INFO> Lounge Billy Ambient Lighting - Turn On (Rule#rule-l0ki453b) evaluation complete [stable-22119]2022-06-01T22:20:19.082Z <httpapi:NOTICE> HTTP API v1 22021 base URL http://172.16.128.6:8111; listening [stable-22119]2022-06-01T22:20:19.228Z <app:NOTICE> HTTP server running; registering proxy endpoints. [stable-22119]2022-06-01T22:20:19.228Z <app:NOTICE> Starting WSAPI... [stable-22119]2022-06-01T22:20:19.229Z <wsapi:NOTICE> wsapi: starting version 21334 [stable-22119]2022-06-01T22:20:19.656Z <Engine:INFO> [Engine]Engine#1 master timer tick, local time "6/2/2022, 8:20:19 AM" (TZ offset 600 mins from UTC) [stable-22119]2022-06-01T22:27:54.788Z <wsapi:INFO> wsapi: connection from ::ffff:172.16.128.5
- reactor.wrapper.log (log file the failed to start event points to)
2022-06-02 08:19:23 - Stopping reactor.exe 2022-06-02 08:19:23 - ProcessKill 3628 2022-06-02 08:19:25 - Shutdown exception Message:A system shutdown is in progress. Stacktrace: at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) at System.Management.ManagementScope.InitializeGuts(Object o) at System.Management.ManagementScope.Initialize() at System.Management.ManagementObjectSearcher.Initialize() at System.Management.ManagementObjectSearcher.Get() at winsw.WrapperService.GetChildPids(Int32 pid) at winsw.WrapperService.StopProcessAndChildren(Int32 pid) at winsw.WrapperService.StopIt() at winsw.WrapperService.OnShutdown() 2022-06-02 08:20:11 - Starting C:\Program Files\nodejs\node.exe C:\reactor\reactor\node_modules\node-windows\lib\wrapper.js --file C:\reactor\reactor\app.js --scriptoptions= --log "Reactor wrapper" --grow 0.25 --wait 1 --maxrestarts 3 --abortonerror n --stopparentfirst undefined 2022-06-02 08:20:11 - Started 3272 2022-06-02 08:30:54 - Stopping reactor.exe 2022-06-02 08:30:54 - ProcessKill 3272 2022-06-02 08:30:54 - Found child process: 3280 Name: conhost.exe 2022-06-02 08:30:54 - Found child process: 3504 Name: node.exe 2022-06-02 08:30:54 - Stopping process 3280 2022-06-02 08:30:54 - Send SIGINT 3280 2022-06-02 08:30:54 - SIGINT to 3280 failed - Killing as fallback 2022-06-02 08:30:54 - Stopping process 3504 2022-06-02 08:30:54 - Send SIGINT 3504 2022-06-02 08:30:54 - SIGINT to 3504 failed - Killing as fallback 2022-06-02 08:30:54 - Stopping process 3272 2022-06-02 08:30:54 - Send SIGINT 3272 2022-06-02 08:30:54 - SIGINT to 3272 failed - Killing as fallback 2022-06-02 08:30:54 - Finished reactor.exe 2022-06-02 08:33:41 - Starting C:\Program Files\nodejs\node.exe C:\reactor\reactor\node_modules\node-windows\lib\wrapper.js --file C:\reactor\reactor\app.js --scriptoptions= --log "Reactor wrapper" --grow 0.25 --wait 1 --maxrestarts 3 --abortonerror n --stopparentfirst undefined 2022-06-02 08:33:41 - Started 4184 2022-06-02 08:36:57 - Starting C:\Program Files\nodejs\node.exe C:\reactor\reactor\node_modules\node-windows\lib\wrapper.js --file C:\reactor\reactor\app.js --scriptoptions= --log "Reactor wrapper" --grow 0.25 --wait 1 --maxrestarts 3 --abortonerror n --stopparentfirst undefined 2022-06-02 08:36:57 - Started 3100
- Windows event log event:
Child process [4184 - C:\Program Files\nodejs\node.exe C:\reactor\reactor\node_modules\node-windows\lib\wrapper.js --file C:\reactor\reactor\app.js --scriptoptions= --log "Reactor wrapper" --grow 0.25 --wait 1 --maxrestarts 3 --abortonerror n --stopparentfirst undefined] finished with 1
-
In your Reactor directory, please do
npm ls
and post the results. -
Note this is in the 'rolled back' state, not the 'wont start' state:
PS C:\reactor\reactor> npm ls reactor-multi-system@1.0.3-22041 C:\reactor\reactor +-- @influxdata/influxdb-client@1.23.0 +-- @mdi/font@5.9.55 +-- @popperjs/core@2.11.2 +-- body-parser@1.19.2 +-- bootstrap-icons@1.5.0 +-- bootstrap@4.6.1 +-- cookie@0.4.2 +-- digest-fetch@1.2.1 +-- diskusage-ng@1.0.2 +-- express@4.17.3 +-- feather-icons@4.28.0 +-- font-awesome@4.7.0 +-- gridstack@5.0.0 +-- jquery-ui-dist@1.13.1 +-- jquery@3.6.0 +-- js-yaml@3.14.1 +-- minimist@0.0.10 extraneous +-- node-fetch@2.6.7 +-- node-stream-zip@1.15.0 extraneous +-- node-windows@1.0.0-beta.6 extraneous +-- nodemailer@6.7.2 +-- optimist@0.6.1 extraneous +-- qs@6.10.3 +-- serve-static@1.14.2 +-- uuid@8.3.2 +-- wordwrap@0.0.3 extraneous +-- ws@7.5.7 `-- xml@0.0.12 extraneous PS C:\reactor\reactor>
-
toggledbitswrote on Jun 3, 2022, 4:03 PM last edited by toggledbits Jun 3, 2022, 12:42 PM
That is the correct list. From what you posted, it looks like you are somehow installing the wrong version of
node-windows
. The latest version is known not to work, and the developer is too busy to fix it, so thebeta.6
is the required version. Make sure you are following the installation instructions to the letter (which do specify that particularbeta6
version). This is all confirmed to work, I believe @wmarcolin can confirm, as I went through this with him a couple of weeks ago when we discovered the deficiency innode-windows
.To make sure everything is well and truly cleared out before doing the upgrade, make sure you uninstall any existing Reactor service, then remove completely the package dependencies directory, and then make sure there is no global version of
node-windows
installed:cd \path\to\reactor node tools\install_reactor_windows_service.js -u . del /s /f node_modules npm rm -g node-windows
Then do the full upgrade install.
node-windows
also creates adaemon
directory in the Reactor directory when it attempts to start the service, and places its startup log files there. That would be another place to check for useful messages (particularly the.wrapper.log
file).I've enhanced the upgrade instructions for Windows to more thoroughly document the steps needed while
node-windows
needs to be installed in a downgraded state. -
@toggledbits Thank you for the info and I'll try this later on and report back.
-
So, following:
cd \path\to\reactor node tools\install_reactor_windows_service.js -u . del /s /f node_modules npm rm -g node-windows
npm uninstall node-windows npm uninstall -g node-windows npm install -g node-windows@1.0.0-beta.6 npm link node-windows
...extract the Reactor.zip over the old directory...
node tools\install_reactor_windows_service.js -i .
I'm now running fine with Reactor (Multi-hub) stable-22136.
Thank you @toggledbits for your support and amazing product.
Bonus is the SSL now works too (CertifytheWeb with LetsEncrypt will renew it and drop the key files in the correct location). That means I can have Reactor as a tab in the Hass sidebar (previously https Hass --> http reactor would not work).
2/6