Picking up different flows file

I am working on a custom node which involves having to restart node-red quite often. I've just noticed something strange though. Node-red suddenly started loading a different flows file. Take a look at his log piece:

6 Aug 22:03:16 - [info] Node-RED version: v0.20.5
6 Aug 22:03:16 - [info] Node.js  version: v11.10.1
6 Aug 22:03:16 - [info] Darwin 18.5.0 x64 LE
6 Aug 22:03:17 - [info] Loading palette nodes
6 Aug 22:03:17 - [debug] Module: node-red-contrib-ikea-home-smart 1.0.0
6 Aug 22:03:17 - [debug]         /Users/myName/.node-red/node_modules/node-red-contrib-ikea-home-smart
6 Aug 22:03:17 - [debug] Module: node-red-dashboard 2.15.3
6 Aug 22:03:17 - [debug]         /Users/myName/.node-red/node_modules/node-red-dashboard
6 Aug 22:03:17 - [debug] Module: node-red-node-email 1.4.0
6 Aug 22:03:17 - [debug]         /usr/local/lib/node_modules/node-red/node_modules/node-red-node-email
6 Aug 22:03:17 - [debug] Module: node-red-node-feedparser 0.1.14
6 Aug 22:03:17 - [debug]         /usr/local/lib/node_modules/node-red/node_modules/node-red-node-feedparser
6 Aug 22:03:17 - [debug] Module: node-red-node-rbe 0.2.4
6 Aug 22:03:17 - [debug]         /usr/local/lib/node_modules/node-red/node_modules/node-red-node-rbe
6 Aug 22:03:17 - [debug] Module: node-red-node-sentiment 0.1.3
6 Aug 22:03:17 - [debug]         /usr/local/lib/node_modules/node-red/node_modules/node-red-node-sentiment
6 Aug 22:03:17 - [debug] Module: node-red-node-tail 0.0.2
6 Aug 22:03:17 - [debug]         /usr/local/lib/node_modules/node-red/node_modules/node-red-node-tail
6 Aug 22:03:17 - [debug] Module: node-red-node-twitter 1.1.4
6 Aug 22:03:17 - [debug]         /usr/local/lib/node_modules/node-red/node_modules/node-red-node-twitter
6 Aug 22:03:17 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
6 Aug 22:03:17 - [info] Dashboard version 2.15.3 started at /ui
6 Aug 22:03:17 - [info] Settings file  : /Users/myName/.node-red/settings.js
6 Aug 22:03:17 - [info] Context store  : 'default' [module=memory]
6 Aug 22:03:17 - [info] User directory : /Users/myName/.node-red
6 Aug 22:03:17 - [warn] Projects disabled : editorTheme.projects.enabled=false
6 Aug 22:03:17 - [info] Flows file     : /Users/myName/.node-red/flows_MyNames-MBP.local.json
6 Aug 22:03:17 - [debug] loaded flow revision: 55b7841aec62164d5358ef96fda05a3a
6 Aug 22:03:17 - [debug] red/runtime/nodes/credentials.load : no user key present
6 Aug 22:03:17 - [debug] red/runtime/nodes/credentials.load : using default key
6 Aug 22:03:17 - [debug] red/runtime/nodes/credentials.load : keyType=system
6 Aug 22:03:17 - [warn]

and then a couple of minutes later:

6 Aug 22:14:44 - [info] Node-RED version: v0.20.5
6 Aug 22:14:44 - [info] Node.js  version: v11.10.1
6 Aug 22:14:44 - [info] Darwin 18.5.0 x64 LE
6 Aug 22:14:44 - [info] Loading palette nodes
6 Aug 22:14:44 - [debug] Module: node-red-contrib-ikea-home-smart 1.0.0
6 Aug 22:14:44 - [debug]         /Users/myName/.node-red/node_modules/node-red-contrib-ikea-home-smart
6 Aug 22:14:44 - [debug] Module: node-red-dashboard 2.15.3
6 Aug 22:14:44 - [debug]         /Users/myName/.node-red/node_modules/node-red-dashboard
6 Aug 22:14:44 - [debug] Module: node-red-node-email 1.4.0
6 Aug 22:14:44 - [debug]         /usr/local/lib/node_modules/node-red/node_modules/node-red-node-email
6 Aug 22:14:44 - [debug] Module: node-red-node-feedparser 0.1.14
6 Aug 22:14:44 - [debug]         /usr/local/lib/node_modules/node-red/node_modules/node-red-node-feedparser
6 Aug 22:14:44 - [debug] Module: node-red-node-rbe 0.2.4
6 Aug 22:14:44 - [debug]         /usr/local/lib/node_modules/node-red/node_modules/node-red-node-rbe
6 Aug 22:14:44 - [debug] Module: node-red-node-sentiment 0.1.3
6 Aug 22:14:44 - [debug]         /usr/local/lib/node_modules/node-red/node_modules/node-red-node-sentiment
6 Aug 22:14:44 - [debug] Module: node-red-node-tail 0.0.2
6 Aug 22:14:44 - [debug]         /usr/local/lib/node_modules/node-red/node_modules/node-red-node-tail
6 Aug 22:14:44 - [debug] Module: node-red-node-twitter 1.1.4
6 Aug 22:14:44 - [debug]         /usr/local/lib/node_modules/node-red/node_modules/node-red-node-twitter
6 Aug 22:14:45 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
6 Aug 22:14:45 - [info] Dashboard version 2.15.3 started at /ui
6 Aug 22:14:45 - [info] Settings file  : /Users/myName/.node-red/settings.js
6 Aug 22:14:45 - [info] Context store  : 'default' [module=memory]
6 Aug 22:14:45 - [info] User directory : /Users/myName/.node-red
6 Aug 22:14:45 - [warn] Projects disabled : editorTheme.projects.enabled=false
6 Aug 22:14:45 - [info] Flows file     : /Users/myName/.node-red/flows_MyNames-MacBook-Pro.local.json
6 Aug 22:14:45 - [debug] loaded flow revision: 5f33d08dcd5d76dbe78f76298a972aec
6 Aug 22:14:45 - [debug] red/runtime/nodes/credentials.load : no user key present
6 Aug 22:14:45 - [debug] red/runtime/nodes/credentials.load : using default key
6 Aug 22:14:45 - [debug] red/runtime/nodes/credentials.load : keyType=system
6 Aug 22:14:45 - [warn]

Notice the different flows file... What might be causing this? I had only one admin tab open ( chrome) and no other browsers active.

Mac OS networking. You can fix the flows file as an option on startup

https://nodered.org/docs/getting-started/local

Just to spell it out, Node-RED uses the hostname as part of the flow file name by default. This was an early design choice when were copying images around multiple Pis and wanted a convenient way for each Pi to pickup its 'own' flow file.

In retrospect, I wouldn't make that same choice today as I think it causes more problems then it solves.

In this instance, your Mac has picked up a different hostname for some reason. As Mark points out, you can configure Node-RED to use a fixed flows file via either the command-line for the flowsFile option in your settings file.

Thanks all. I'll use the startup option then. I knew a flows file is picked based on a hostname but I guess I didn't expect my mac to suddenly change its hostname...

1 Like

It happens to me all the time -- something to do with mdns/bonjour... I think it can be cured by beating up on your router, but I use @ukmoose's solution.