# Project flakiness on macintosh

**URL:** <https://discourse.nodered.org/t/project-flakiness-on-macintosh/7493>\
**Category:** General\
**Created:** [1 February 2019 19:13 UTC](https://discourse.nodered.org/t/project-flakiness-on-macintosh/7493 "2019-02-01T19:13:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [1 February 2019 19:13 UTC](https://discourse.nodered.org/t/project-flakiness-on-macintosh/7493/1 "2019-02-01T19:13:25Z")

</div>

I have hesitated to ask about this issue because at first I it seemed hard to reproduce. It may also be platform specific, since it happens on my mac but not (apparently) on a Rpi. Recently, though, I have started shutting down my mac every night instead of just putting the machine to sleep (see below), and it has really started to make me crazy. So here goes.

If I shut down and restart my mac (macOS 10.11.6), having stopped NR first, when I restart NR it fails to find the current project and uses the default flows file instead:

> # Welcome to Node-RED
> 
> 1 Feb 12:55:14 - [info] Node-RED version: v0.19.5  
> 1 Feb 12:55:14 - [info] Node.js version: v8.11.2  
> 1 Feb 12:55:14 - [info] Darwin 15.6.0 x64 LE  
> 1 Feb 12:55:14 - [info] Loading palette nodes  
> 1 Feb 12:55:15 - [warn] rpi-gpio : Raspberry Pi specific node set inactive  
> 1 Feb 12:55:16 - [info] Dashboard version 2.13.2 started at /ui  
> 1 Feb 12:55:16 - [info] Settings file : /Users/mikebell/.node-red/settings.js  
> 1 Feb 12:55:16 - [info] Context store : 'default' [module=memory]  
> 1 Feb 12:55:16 - [info] User directory : /Users/mikebell/.node-red  
> 1 Feb 12:55:16 - [warn] No active project : using default flows file  
> 1 Feb 12:55:16 - [info] Flows file : /Users/mikebell/.node-red/flows\_MIB-MBP.local.json  
> 1 Feb 12:55:16 - [info] Server now running at [http://127.0.0.1:1880/](http://127.0.0.1:1880/)

The editor knows that projects are enabled, but the `Projects/Open` menu item is grey. The  
`.config.json` file contains

> "projects": {  
> "projects": {  
> "control": {  
> "credentialSecret": "secret"  
> },  
> "worldmap-demo": {  
> "credentialSecret": "secret"  
> },  
> "test": {  
> "credentialSecret": "secret"  
> },  
> "gate\_examples": {  
> "credentialSecret": false  
> },  
> "flow\_analysis": {  
> "credentialSecret": false  
> },  
> "ha\_expt": {  
> "credentialSecret": false  
> },  
> "remote-gate": {  
> "credentialSecret": ""  
> },  
> "debug-status-question": {  
> "credentialSecret": false  
> }  
> },  
> "activeProject": "ha\_expt"  
> }

So it is as if this file is not being read (assuming that is where NR should be looking). I can recover by stopping and restarting NR. The dialogs that follow include:

> The flows on the server have been updated.  
> The server is running a more recent set of flows.  
> The changes include no conflicts and can be merged automatically.

Merging shows all nodes as "dirty" but the `Deploy` button is disabled. After refreshing the browser, everything is back to normal.

I should mention that I start NR from the command line, since I have never figured out how to run it as system service on the mac. I use systemd on the Rpi, so I suppose this could make a difference. Any thoughts?

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [1 February 2019 19:18 UTC](https://discourse.nodered.org/t/project-flakiness-on-macintosh/7493/2 "2019-02-01T19:18:44Z")

</div>

When you start NR from the command exactly what do you enter?

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [1 February 2019 19:22 UTC](https://discourse.nodered.org/t/project-flakiness-on-macintosh/7493/3 "2019-02-01T19:22:09Z")

</div>

`node-red`

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [1 February 2019 20:28 UTC](https://discourse.nodered.org/t/project-flakiness-on-macintosh/7493/4 "2019-02-01T20:28:11Z")

</div>

Ok, then it will start up NR using the flow in _youruserid_/.node\_red and the flow will be something like flows\_Pauls-mini.local.json - the Pauls-mini comes from the computer name you can see in the System Preferences/Sharing/Computer name where spaces are replaced by the underscore.

You could go look in the .node\_red folder to see what the last flow that was updated is. In the finder go to your user folder and then select in the `Go` menu `Go to Folder...` and enter `.node-red`.

This might give you an idea of what is happening.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [1 February 2019 20:33 UTC](https://discourse.nodered.org/t/project-flakiness-on-macintosh/7493/5 "2019-02-01T20:33:24Z")

</div>

@zenofmud you've missed the part where @drmibell explained he was using Projects.

@drmibell that is very odd. Your `.config.json` file includes the `projects.activeProject` setting which is the only thing it uses to know what project it ought to be running.

The fact it has logged `[warn] No active project : using default flows file` means it knows you have Projects enabled, but hasn't found the `activeProject` setting.

I'm at a loss to explain that.

The rest of the behaviour you describe stems from that; it hasn't found the active project so found and is running the default flows file. The editor reconnects to the runtime, finds the flows are different and offers to merge them. You probably don't want to do that. A reload of the editor will load the clean set of flows it is currently running.

So... thanks for reporting. I haven't seen this behaviour myself, nor can think what could cause that set of events given what you've shown us. A bit inconclusive.

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [1 February 2019 21:35 UTC](https://discourse.nodered.org/t/project-flakiness-on-macintosh/7493/6 "2019-02-01T21:35:36Z")

</div>

> [@knolleary](#):
>
> I'm at a loss to explain that.

I'm almost glad that I haven't missed anything obvious. If I find a cure, I'll post it.

> [@knolleary](#):
>
> The editor reconnects to the runtime, finds the flows are different and offers to merge them. You probably don't want to do that. A reload of the editor will load the clean set of flows it is currently running.

OK, but how do I get back to running my Projects? I'll try not merging and restarting NR. Perhaps it will find them on the second try.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [1 February 2019 21:53 UTC](https://discourse.nodered.org/t/project-flakiness-on-macintosh/7493/7 "2019-02-01T21:53:30Z")

</div>

> [@drmibell](#):
>
> OK, but how do I get back to running my Projects?

If the `Projects -> Open` option isn't available, can you do `Projects -> New` and then switch to the Open Project tab in the dialog?

You should also be able to get to the Open Project dialog with `Cmd-Alt-O`

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [5 February 2019 17:08 UTC](https://discourse.nodered.org/t/project-flakiness-on-macintosh/7493/8 "2019-02-05T17:08:38Z")

</div>

Thanks for the suggestions.

> [@knolleary](#):
>
> If the `Projects -> Open` option isn't available, can you do `Projects -> New` and then switch to the Open Project tab in the dialog?

For some (or possibly the same) reason, the `Projects -> New` dialog does not show Open Project, just Create Project and Clone Repository.

> [@knolleary](#):
>
> You should also be able to get to the Open Project dialog with `Cmd-Alt-O`

This works and gets me a clean start of the project I select.

Chasing this down has been slow, since it requires a reboot each time I want to try something different. The only progress is that I have started getting error messages that I had not seen before. (I'm not sure what I did to make this happen. 😕)

> # Welcome to Node-RED
> 
> 5 Feb 11:45:20 - [info] Node-RED version: v0.19.5  
> 5 Feb 11:45:20 - [info] Node.js version: v8.11.2  
> 5 Feb 11:45:20 - [info] Darwin 15.6.0 x64 LE  
> 5 Feb 11:45:20 - [info] Loading palette nodes  
> 5 Feb 11:45:21 - [warn] rpi-gpio : Raspberry Pi specific node set inactive  
> 5 Feb 11:45:22 - [info] Dashboard version 2.13.2 started at /ui  
> 5 Feb 11:45:22 - [info] Settings file : /Users/mikebell/.node-red/settings.js  
> 5 Feb 11:45:22 - [info] Context store : 'default' [module=memory]  
> 5 Feb 11:45:22 - [info] User directory : /Users/mikebell/.node-red  
> 5 Feb 11:45:22 - [warn] No active project : using default flows file  
> 5 Feb 11:45:22 - [info] Flows file : /Users/mikebell/.node-red/flows\_MIB-MBP.local.json  
> 5 Feb 11:45:22 - [info] Creating new flow file  
> 5 Feb 11:45:22 - [info] Starting flows  
> 5 Feb 11:45:22 - [info] Started flows  
> 5 Feb 11:45:22 - [info] Server now running at [http://127.0.0.1:1880/](http://127.0.0.1:1880/)  
> Error: Cannot operate on inactive project wanted:ha\_expt current:undefined  
> at checkActiveProject (/usr/local/lib/node\_modules/node-red/red/runtime/storage/localfilesystem/projects/index.js:224:15)  
> at Object.getStatus (/usr/local/lib/node\_modules/node-red/red/runtime/storage/localfilesystem/projects/index.js:283:5)  
> at /usr/local/lib/node\_modules/node-red/red/api/editor/projects/index.js:152:38  
> at Layer.handle [as handle\_request] (/usr/local/lib/node\_modules/node-red/node\_modules/express/lib/router/layer.js:95:5)  
> at next (/usr/local/lib/node\_modules/node-red/node\_modules/express/lib/router/route.js:137:13)  
> at /usr/local/lib/node\_modules/node-red/red/api/auth/index.js:63:13  
> at Layer.handle [as handle\_request] (/usr/local/lib/node\_modules/node-red/node\_modules/express/lib/router/layer.js:95:5)  
> at next (/usr/local/lib/node\_modules/node-red/node\_modules/express/lib/router/route.js:137:13)  
> at Route.dispatch (/usr/local/lib/node\_modules/node-red/node\_modules/express/lib/router/route.js:112:3)  
> at Layer.handle [as handle\_request] (/usr/local/lib/node\_modules/node-red/node\_modules/express/lib/router/layer.js:95:5)  
> Error: Cannot operate on inactive project wanted:ha\_expt current:undefined  
> at checkActiveProject (/usr/local/lib/node\_modules/node-red/red/runtime/storage/localfilesystem/projects/index.js:224:15)  
> at Object.getProject (/usr/local/lib/node\_modules/node-red/red/runtime/storage/localfilesystem/projects/index.js:206:5)  
> at /usr/local/lib/node\_modules/node-red/red/api/editor/projects/index.js:124:38  
> at Layer.handle [as handle\_request] (/usr/local/lib/node\_modules/node-red/node\_modules/express/lib/router/layer.js:95:5)  
> at next (/usr/local/lib/node\_modules/node-red/node\_modules/express/lib/router/route.js:137:13)  
> at /usr/local/lib/node\_modules/node-red/red/api/auth/index.js:63:13  
> at Layer.handle [as handle\_request] (/usr/local/lib/node\_modules/node-red/node\_modules/express/lib/router/layer.js:95:5)  
> at next (/usr/local/lib/node\_modules/node-red/node\_modules/express/lib/router/route.js:137:13)  
> at Route.dispatch (/usr/local/lib/node\_modules/node-red/node\_modules/express/lib/router/route.js:112:3)  
> at Layer.handle [as handle\_request] (/usr/local/lib/node\_modules/node-red/node\_modules/express/lib/router/layer.js:95:5)  
> Error: Cannot operate on inactive project wanted:ha\_expt current:undefined  
> at checkActiveProject (/usr/local/lib/node\_modules/node-red/red/runtime/storage/localfilesystem/projects/index.js:224:15)  
> at Object.getCommits (/usr/local/lib/node\_modules/node-red/red/runtime/storage/localfilesystem/projects/index.js:254:5)  
> at /usr/local/lib/node\_modules/node-red/red/api/editor/projects/index.js:308:38  
> at Layer.handle [as handle\_request] (/usr/local/lib/node\_modules/node-red/node\_modules/express/lib/router/layer.js:95:5)  
> at next (/usr/local/lib/node\_modules/node-red/node\_modules/express/lib/router/route.js:137:13)  
> at /usr/local/lib/node\_modules/node-red/red/api/auth/index.js:63:13  
> at Layer.handle [as handle\_request] (/usr/local/lib/node\_modules/node-red/node\_modules/express/lib/router/layer.js:95:5)  
> at next (/usr/local/lib/node\_modules/node-red/node\_modules/express/lib/router/route.js:137:13)  
> at Route.dispatch (/usr/local/lib/node\_modules/node-red/node\_modules/express/lib/router/route.js:112:3)  
> at Layer.handle [as handle\_request] (/usr/local/lib/node\_modules/node-red/node\_modules/express/lib/router/layer.js:95:5)

To me, this just confirms that the active project is not being found, but I'm sure it will mean more to you.
