Global context variables do not display in the Context Sidebar

So, another suggestion... How about changing the debug level in your system to try to catch if something is going unnoticed ? If you want to do so you need to change the debug level in your seetings.js file, restart node-RED and then run again some of those test flows that use context and check the initialization log in the console.

Here the lines to change: comment line infoand uncomment line trace

 logging: {
        // Only console logging is currently supported
        console: {
            // Level of logging to be recorded. Options are:
            // fatal - only those errors which make the application unusable should be recorded
            // error - record errors which are deemed fatal for a particular request + fatal errors
            // warn - record problems which are non fatal + errors + fatal errors
            // info - record information about the general running of the application + warn + error + fatal errors
            // debug - record information which is more verbose than info + info + warn + error + fatal errors
             trace - record very detailed logging + debug + info + warn + error + fatal errors
            // off - turn off all logging (doesn't affect metrics or audit)
            // level: "info",
            // Whether or not to include metric events in the log output
            metrics: false,
            // Whether or not to include audit events in the log output
            audit: false
        }
    },
    editorTheme: {
        projects: {
            enabled: true
        }
    },
    contextStorage: {
        default: {
            module: "localfilesystem"
        },
        memoryOnly: {
            module: "memory"
        }
     }

@tree-frog as I asked and suggested before 'are you running NR v0.19.3? if so try upgrading to v0.19.4 and test again'

I upgraded to v0.19.4 upon the first suggestion. way back there.

so you what I found out is that you cannot just un-comment the line. You need to have
Level: "trace",
or
Level: "info",

and there is a verbose display, which tells me the modules loaded and the flows, but really no errors at this point other than its just not able to do a global.keys() function.

That is correct. Comment line info so that only line trace will be used.

I just ran your flow on a:

  • pi (stretch) nr v0.19.3 works fine
  • osx nr v0.19.4 works fine

I wonder if this is a Windows issue (which I can't test on since I don't have one)

Has anyone else tested it in Windows 10?

I am running Node-RED on windows and all works perfectly well.

1 Like

The fellows here are running Windows 10 with me. They report that the global.keys() works on their PC's. I asked Nick if he could dig a little deeper since this would probably affect other Windows users. It's something that does not hinder performance, but you cannot list any of your global variables which I was hoping to do. I have a bunch of globals which I did not want to add flows to just pull up the values in the debug window. I was hoping to "Wow" people with the functionality and debugging features of Node-RED. :roll_eyes: .

I am hoping that we figure it out soon. or at least find what is causing the behavior of the keys() function to not work. Again, The flow.keys() apparently is working fine. I would assume that Nick/development could look into the source code and see anything that would prevent the global version from acting predictably. Or what is the difference between flow variables and global variables and see how Windows 10 or other would affect behavior between them.

Kind Regards,
Kyle

Well yes. That's what we've been doing over the last 3+ days.

As Ive said repeatedly, I'm at a loss to explain how this is at all possible.

Please can you send me (directly if you like) your settings file?

Just to clarify... Why do you think this will affect other windows users if your colleagues who run Windows aren't hitting it?

As I've said, you are the only person who has reported this issue and we need to find what is unique about your environment to cause this issue. So far we've seemingly ruled out almost everything I can think of. So there must be some detail you are overlooking - the smoking gun that you may not realise is even there.

Correcting what i wrote before: the right way to change the debugging level is changing the value of property "lelvel", as you mentioned before.

        console: {
            // Level of logging to be recorded. Options are:
            // fatal - only those errors which make the application unusable should be recorded
            // error - record errors which are deemed fatal for a particular request + fatal errors
            // warn - record problems which are non fatal + errors + fatal errors
            // info - record information about the general running of the application + warn + error + fatal errors
            // debug - record information which is more verbose than info + info + warn + error + fatal errors
            // trace - record very detailed logging + debug + info + warn + error + fatal errors
            // off - turn off all logging (doesn't affect metrics or audit)
            level: "trace",
            // Whether or not to include metric events in the log output
            metrics: false,
            // Whether or not to include audit events in the log output
            audit: false
        }

Just checked on my Windows 10 build and everything is working fine for me.

Welcome to Node-RED
===================

22 Sep 16:09:02 - [info] Node-RED version: v0.19.2
22 Sep 16:09:02 - [info] Node.js  version: v8.11.3
22 Sep 16:09:02 - [info] Windows_NT 10.0.17134 x64 LE

A somewhat non-standard build as I use a local install of Node-RED but otherwise pretty vanilla as I use it for development.


Hang on, I notice that you are using Node.JS v 8.9 - is anyone else using that version? I think there was a version of 8.x that had some issues wasn't there? Clutching at straws but it might be worth updating Node.JS. You are also a little behind on Windows 10 updates though that shouldn't matter here.

On my Mac I got 8.9.4 but it works fine for me
On my Pi I've got v8.12.0

1 Like

On my Win10 PC I'm using 8.9.4 as well

Nick,
Please bear with me/us. I have tried to go through each and every suggestion here. Sometimes 2 and 3 times just to be sure I have not left anything out or have assumed something I shouldn't. It is unfortunate. And I can certainly attest that most of my problems, so far, have been misunderstanding and assumptions on my part. I see that this isn't necessarily a "Windows" thing. All I can ask is due diligence on this matter. This is a frustrating one, apparently for everyone. All I can do is trial and report my failure/success.

I am upgrading Node.js this morning. I will continue to post and read suggestions that I can work on this end.

Thank you Nick, and everyone, for your kind suggestions and support.
Kyle

All,
I upgraded to Node.js v8.12.0 this morning... There are no changes from last week. Node-RED will still not return global context keys from memory.

Thanks in advance for your help.

24 Sep 15:35:09 - [info] Node-RED version: v0.19.4
24 Sep 15:35:09 - [info] Node.js version: v8.12.0
24 Sep 15:35:09 - [info] Windows_NT 10.0.16299 x64 LE

Nick,

settings.txt (10.6 KB)

I copied the settings.js content to settings.txt to send the file in the forum.

Is it possible for you to try with projects turned off in case you've hit an edge-case with that?

Nick,
I don't know it is a Windows problem. It may be completely isolated to my laptop. Is it? :thinking: I'm at the end of my rope.

I was hoping that you had some means of peeking into the source code and finding why Global keys() would behave differently than Flow keys(). Perhaps you have already. I will probably remove it from my W 10 laptop and then try to reinstall on a Windows 7 PC, perhaps when I get some time to do that.

Kyle

TotallyInformation;

Here is my powershell status screen.
24 Sep 15:35:15 - [warn] Projects disabled : git command not found

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

PS C:\Users\myname> node-red
24 Sep 15:35:09 - [info]

Welcome to Node-RED

24 Sep 15:35:09 - [info] Node-RED version: v0.19.4
24 Sep 15:35:09 - [info] Node.js version: v8.12.0
24 Sep 15:35:09 - [info] Windows_NT 10.0.16299 x64 LE
24 Sep 15:35:10 - [info] Loading palette nodes
24 Sep 15:35:15 - [info] Dashboard version 2.9.8 started at /ui
24 Sep 15:35:15 - [warn] ------------------------------------------------------
24 Sep 15:35:15 - [warn] [node-red/tail] Not currently supported on Windows.
24 Sep 15:35:15 - [warn] ------------------------------------------------------
24 Sep 15:35:15 - [info] Settings file : \Users\myname.node-red\settings.js
24 Sep 15:35:15 - [info] Context store : 'default' [module=memory]
24 Sep 15:35:15 - [info] User directory : \Users\myname.node-red
24 Sep 15:35:15 - [warn] Projects disabled : git command not found
24 Sep 15:35:15 - [info] Flows file : \Users\myname.node-red\flows_myname.json
24 Sep 15:35:15 - [warn]