[Solved] Migrating MSR to Docker on Proxmox
-
- Zero issues installing Proxmox on a new MiniPC.
- Zero issues migrating my HA instance over to the new hotness (I know, I was surprised, too!)
And then MSR...
My first issue: I'm logged into the
msr
CT asreactor
(I used the suggested username just to keep things simple as this is new space for me and I was high off my success of migrating HA over).When I run
docker pull toggledbits/reactor:latest-amd64
... it assigns the \reactor\ subdirectory where installed
root
ownership. I am absolutely logged in with the correct non-root user.
Second issue: I copied over the following folders:
When MSR loads, all of my Global Expressions are missing.
Third issue:
All controllers connect wonderfully (Hubitat, etc)... except HA.
After changing ownership of the logs toreactor
again I can see this when MSR calls HA:[latest-24366]2025-01-12T00:03:43.128Z <HubitatController:INFO> HubitatController#hubitat successful connection to ws://192.168.1.214/eventsocket [latest-24366]2025-01-12T00:03:43.151Z <HubitatController:NOTICE> HubitatController#hubitat current mode is Evening (2) [latest-24366]2025-01-12T00:03:43.212Z <HubitatController:NOTICE> HubitatController#hubitat HSM status is disarmed [latest-24366]2025-01-12T00:03:43.214Z <Controller:NOTICE> Controller HubitatController#hubitat is now online. [latest-24366]2025-01-12T00:03:43.255Z <MQTTController:INFO> MQTTController#mqtt2 connected; opening subscriptions [latest-24366]2025-01-12T00:03:43.371Z <MQTTController:INFO> MQTTController#mqtt2 sending inits and going online! [latest-24366]2025-01-12T00:03:43.373Z <Controller:NOTICE> Controller MQTTController#mqtt2 is now online. [latest-24366]2025-01-12T00:03:47.179Z <HassController:NOTICE> HassController#hass connecting to ws://192.168.1.123:8123/api/websocket [latest-24366]2025-01-12T00:03:47.180Z <HassController:WARN> HassController#hass websocket error during open/negotation: [Error] connect ECONNREFUSED 192.168.1.123:8123 [-] [latest-24366]2025-01-12T00:03:47.180Z <HassController:WARN> HassController#hass ws error code ECONNREFUSED [latest-24366]2025-01-12T00:03:47.180Z <HassController:NOTICE> HassController#hass websocket to ws://192.168.1.123:8123/api/websocket closed during open/negotiation [latest-24366]2025-01-12T00:03:47.180Z <HassController:WARN> HassController#hass failed to connect/initialize communication: [Error] connect ECONNREFUSED 192.168.1.123:8123 [-] [latest-24366]2025-01-12T00:03:52.181Z <HassController:NOTICE> HassController#hass connecting to ws://192.168.1.123:8123/api/websocket [latest-24366]2025-01-12T00:03:52.183Z <HassController:WARN> HassController#hass websocket error during open/negotation: [Error] connect ECONNREFUSED 192.168.1.123:8123 [-] [latest-24366]2025-01-12T00:03:52.183Z <HassController:WARN> HassController#hass ws error code ECONNREFUSED [latest-24366]2025-01-12T00:03:52.183Z <HassController:NOTICE> HassController#hass websocket to ws://192.168.1.123:8123/api/websocket closed during open/negotiation [latest-24366]2025-01-12T00:03:52.183Z <HassController:WARN> HassController#hass failed to connect/initialize communication: [Error] connect ECONNREFUSED 192.168.1.123:8123 [-]
Yes, I created a fresh new long-lived access token for the MSR containerized install and updated the
reactor.yaml
config file correctly.Honestly, all-in-all, for my total lack of expertise here I'm very pleased that I only have these three issues. But they are def blockers atm.
My RPi bare metal install of MSR hooked right up to the new HA and is humming along just fine (I used hostnames were possible and shuffled some IPs in other places so I wouldn't run into things later that were mapped incorrectly that I'd forgotten about.)
- Proxmox 8.3.2
- MSR lives in an Ubuntu 24.04 Proxmox container
- MSR is latest docker version
What else can I provide to those smarter than me here?
-
So I searched this forum earlier but didn't find this thread. A generic global Internet search netted me this old nugget of info on exactly the first issue, the MSR>HA connectivity.
Using @toggledbits one-liner
curl -o - 'http://192.168.0.15:8123/api/config'
returned just what I needed to determine it was an IP configuration error. I'd taken painstaking efforts to re-IP the new HA to the old HA's original IP... and then (for some inexplicable reason) updated the
reactor.yaml
with the new long-lived access token AND the temporary IP. Dunno what I was thinking... or if I was thinking... in that moment. But that's fixed now and MSR and HA are happily chatting away.So now I have the two issues remaining:
My first issue: I'm logged into the msr CT as reactor (I used the suggested username just to keep things simple as this is new space for me and I was high off my success of migrating HA over).
When I run
docker pull toggledbits/reactor:latest-amd64 ... it assigns the \reactor\ subdirectory where installed root ownership. I am absolutely logged in with the correct non-root user.
Second issue: I copied over the following folders:
When MSR loads, all of my Global Expressions are missing.
-
@gwp1 said in Migrating MSR to Docker on Proxmox:
My first issue: ... it assigns the \reactor\ subdirectory where installed root ownership
That would be correct. Reactor runs as root inside its docker container (very common with docker).
@gwp1 said in Migrating MSR to Docker on Proxmox:
Second issue: When MSR loads, all of my Global Expressions are missing.
Always look at the logs. Something is probably in there. Your screen shot doesn't show permissions, but that's likely the issue. Reactor runs as root in the container, and will have rootish behavior in the config, logs, storage, etc.
VMs often have virtual network switches/routers and virtual firewalls. That could be the issue. It could also be that filtering/firewall on the HA side doesn't like the IP address the Reactor VM is coming from. That seems more likely as other controller endpoints are connectable.
-
gwp1replied to toggledbits on Jan 12, 2025, 4:54 PM last edited by gwp1 Jan 12, 2025, 12:00 PM
@toggledbits very helpful on the docker explanation - this is my very first foray into docker (using it with MSR) so it's all fresh and new to me. Thank you.
I resolved the HA <-> MSR issue - it was a bad IP in the
reactor.yaml
file.What file do Global Expressions live in? They are literally gone from the UI.
And I have LOTS of them in production.
The log shows this, which is not surprising given none of them are there:
[latest-24366]2025-01-12T16:58:29.554Z <Rule:ERR> Predicate#rule-m34m60yh/trig condition refers to undefined global `ambient_windspeed'
-
toggledbitsreplied to gwp1 on Jan 12, 2025, 11:21 PM last edited by toggledbits Jan 12, 2025, 6:36 PM
@gwp1 said in Migrating MSR to Docker on Proxmox:
The log shows this,
Look at the startup messages. Reactor loads the global expressions at startup. That's where the useful messages will be.
@gwp1 said in Migrating MSR to Docker on Proxmox:
What file do Global Expressions live in?
They live in
storage/expressions.json
, but recent similar experience suggests that if one file has broken permissions, many do, so whatever you learn from that one file will likely need to be applied to many. Log in to your virtual machine, dols -la
from inside thestorage
subdirectory, and post the entire output. Also fetchhttp://reactor-ip-address:port/api/v1/system
and post that output.By the way, it's also plausible that you haven't mapped your docker container to the right directory. Can you describe how you are launching the docker container, and post any commands you may have executed doing that?
-
@toggledbits the link to @cw-kid's issue was the key: what he saw was exactly what I saw. 1kb file size, all of it.
I did copy the entire
storage
folder (along with the rest) vs cherry-picking but somehow the file size thing he saw was replicated here. I recopied but checked <user> <group> theexpressions.json
file (after confirming both file size and contents) and started the new MSR and it's all there. I even did a test Rule Set > Rule create/del and all is well.I've shut down the RPi legacy system for now... gonna test run the new one.
QQ... at the bottom of the rules now I see a history that I don't recall seeing in my legacy system (which is bare metal and current). I went back and it's in the legacy system - very nice. Shamefully going to ask when that was added.
-
toggledbitsreplied to gwp1 on Jan 13, 2025, 3:47 PM last edited by toggledbits Jan 13, 2025, 10:50 AM
@gwp1 said in Migrating MSR to Docker on Proxmox:
Shamefully going to ask when that was added.
Check the release notes.
@gwp1 said in Migrating MSR to Docker on Proxmox:
I even did a test Rule Set > Rule create/del and all is well.
Make sure you restart Reactor after doing a create, and make sure the rule still exists, and then delete it, restart, and make sure it stays gone after the restart. If not, your storage permissions don't have sufficient write privileges. The reason for this particular sequence is that Reactor caches writes to reduce load on flash memories (like the MicroSD cards typical of Pi's), so it may be several minutes before stuff in memory is written to disk. Restarting Reactor forces the write during shudown.
-
@toggledbits Fair enough
-
Also see the edit I just made regarding your test. Apologies for brevity. I'm on the run today.
-
@toggledbits AH - will do that post-haste. Thanks. And fully appreciate the "on the run".
-
@toggledbits Confirmed. Added test Ruleset and Rule.
Tools
>Restart
, they stuck. Deleted test Rule and Ruleset,Tools
>Restart
, they were still gone.Next up:
docker-compose
-
To bring this all full circle, I had installed Portainer just to see what it was/did. Rereading the manual for MSR I stumbled across Portainer-specific instructions.
Short story long, I deleted the original container and created a new one thru the Portainer path. Done in mere minutes, runs flawlessly and I don't need to worry about the
docker-compose
errors I was getting.Going to mark this topic as
solved
as all of the three issues were addressed.
8/12