node-red / node-red-ui-nodes

Additional nodes for Node-RED Dashboard
Apache License 2.0
122 stars 83 forks source link

ui-table does not work (Debian Buster) #30

Closed TotallyInformation closed 4 years ago

TotallyInformation commented 4 years ago

Which node are you reporting an issue on?

node-red-ui-table

What are the steps to reproduce?

See below.

What happens?

No data is shown in the ui and the ui-tab containing the table is not shown correctly.

Please tell us about your environment:

Details

image

Welcome to Node-RED
===================
26 Feb 16:00:03 - [info] Node-RED version: v1.0.3
26 Feb 16:00:03 - [info] Node.js  version: v12.16.1
26 Feb 16:00:03 - [info] Linux 4.19.0-8-amd64 x64 LE
26 Feb 16:00:03 - [info] Loading palette nodes
26 Feb 16:00:03 - [info] Settings file  : /home/home/nrmain/data/settings.js
26 Feb 16:00:04 - [info] HTTP Static    : /home/home/nrmain/public
26 Feb 16:00:04 - [info] Context store  : 'default' [module=memory]
26 Feb 16:00:04 - [info] Context store  : 'file' [module=localfilesystem]
26 Feb 16:00:04 - [info] User directory : /home/home/nrmain/data
26 Feb 16:00:04 - [warn] Projects disabled : editorTheme.projects.enabled=false
26 Feb 16:00:04 - [info] Flows file     : /home/home/nrmain/data/nrmain_flows.json
26 Feb 16:00:04 - [info] Server now running at http://127.0.0.1:1880/red/
26 Feb 16:00:04 - [info] Starting flows
26 Feb 16:00:04 - [info] Started flows
26 Feb 16:00:45 - [info] Installing module: node-red-dashboard, version: 2.19.4
26 Feb 16:00:47 - [info] Installed module: node-red-dashboard
26 Feb 16:00:47 - [info] Dashboard version 2.19.4 started at /ui

ui-table installed:

26 Feb 16:04:52 - [info] Installing module: node-red-node-ui-table, version: 0.2.2
26 Feb 16:04:53 - [info] Installed module: node-red-node-ui-table
26 Feb 16:04:53 - [info] Added node types:
26 Feb 16:04:53 - [info]  - node-red-node-ui-table:ui_table

Imported the simple example, changed the tabname to home2: image

and deployed:

26 Feb 16:08:13 - [info] Stopping modified nodes
26 Feb 16:08:13 - [info] Stopped modified nodes
26 Feb 16:08:13 - [info] Starting modified nodes
Error: Cannot find module 'node-red-dashboard'
    at Object.requireModule [as require] (/home/home/nrmain/node_modules/@node-red/registry/lib/util.js:48:19)
    at new TableNode (/home/home/nrmain/data/node_modules/node-red-node-ui-table/node.js:48:30)
    at Object.createNode (/home/home/nrmain/node_modules/@node-red/runtime/lib/nodes/flows/util.js:483:31)
    at Flow.start (/home/home/nrmain/node_modules/@node-red/runtime/lib/nodes/flows/Flow.js:189:48)
    at start (/home/home/nrmain/node_modules/@node-red/runtime/lib/nodes/flows/index.js:329:33)
    at /home/home/nrmain/node_modules/@node-red/runtime/lib/nodes/flows/index.js:196:21 {
  code: 'MODULE_NOT_FOUND'
}
26 Feb 16:08:13 - [info] Started modified nodes

Result is that no second ui tab is shown. Manually move the table card to the main ui tab and redeploy. The table still isn't shown even after reloading the page and re-injecting the data.

image


Delete the flow and the tabs/cards except a single "Home" ui tab. Redeploy. Then add example #2 flow and deploy:

image

Now NOTHING shows in the dashboard other than the default welcome to the dashboard. image


Go back to start. Reset everything, reinstall Dashboard. Add nodes 2 two different ui tabs and confirm everything works. Reinstall ui-table. Add manually to flow and set to use a new, manually created ui tab and use same data input as in the simple example. On deployment, I get the same cannot find module error and the new ui tab never appears.

dceejay commented 4 years ago

(as usual)... working fine here.... The line it is complaining about is

RED.require('node-red-dashboard')(RED);

Wondering if it's anything to do with the way you load node-red locally ?

Christian-Me commented 4 years ago

I gave it a try on a virtual box ubuntu 18.04.1 LTE - unfortunate I can reproduce the problem: Fresh install of

On my windows machines running 0.2.1 of ui-table all works fine. Perhaps something happened between 0.2.2 and 0.2.1?

27 Feb 09:10:19 - [info] Starting flows
{ Error: Cannot find module 'node-red-dashboard'
    at Object.requireModule [as require] (/usr/local/lib/node_modules/node-red/node_modules/@node-red/registry/lib/util.js:48:19)
    at new TableNode (/home/cmeinert/.node-red/node_modules/node-red-node-ui-table/node.js:48:30)
    at Object.createNode (/usr/local/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/flows/util.js:483:31)
    at Flow.start (/usr/local/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/flows/Flow.js:189:48)
    at start (/usr/local/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/flows/index.js:329:33)
    at stop.then.then (/usr/local/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/flows/index.js:196:21)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7) code: 'MODULE_NOT_FOUND' }
Christian-Me commented 4 years ago

I was too fast, sorry just recognized that nodejs is quite old ... I do not use this machine very often ;) updated nodejs to 13.9.0 ...

27 Feb 09:27:45 - [info] Node-RED Version: v1.0.3
27 Feb 09:27:45 - [info] Node.js  Version: v13.9.0
27 Feb 09:27:45 - [info] Linux 5.3.0-40-generic x64 LE

and here we go: image

dceejay commented 4 years ago

so all ok for you ?

Christian-Me commented 4 years ago

Sorry not to be clear. Yes after upgrade to node.js 13.9.0 the ui-table example works fine!

All ok for now.

dceejay commented 4 years ago

(though we don't support node 13... preferring LTS versions.... but hmm - Julian already on 12. (as was I).

Christian-Me commented 4 years ago

Sorry when it comes to linux I feel like a monkey: barely able to type or read understanding nearly nothing. So the only way I do is google, copy, paste, hope ....

I accident grabbed the current version instead of the LTS, ups.

On Windows I`m on 10 and everything works fine (Never change a running system?):

27 Feb 10:08:09 - [info] Node-RED Version: v1.0.2
27 Feb 10:08:09 - [info] Node.js  Version: v10.16.3
27 Feb 10:08:09 - [info] Windows_NT 10.0.18363 x64 LE

But why not updating? on windows 10: first node.js

27 Feb 10:17:57 - [info] Node-RED Version: v1.0.2
27 Feb 10:17:57 - [info] Node.js  Version: v12.16.1

All fine. Then Upgrading to Node-RED 1.0.3

27 Feb 10:56:43 - [info] Node-RED version: v1.0.3
27 Feb 10:56:43 - [info] Node.js  version: v12.16.1

Everything still works fine and as expected! image

TotallyInformation commented 4 years ago

I'm prepared to concede that this is down to the way I install Node-RED. However, that method is perfectly valid and everything else works just fine. All I'm doing is installing NR locally to a folder and running it from there with the userDir folder directly beneath it. So I can't see why the require would fail.

TotallyInformation commented 4 years ago

On Windows 10 with same configuration:

I get the following warning:

1|Node-RED  | 27 Feb 18:12:35 - [info] Stopped modified nodes
1|Node-RED  | 27 Feb 18:12:35 - [info] Starting modified nodes
1|Node-RED  | 27 Feb 18:12:35 - [warn] [ui_table:5a802dcb.0e64a4] *** Order property not set. Please contact developer. ***
1|Node-RED  | 27 Feb 18:12:35 - [info] Started modified nodes

But everything works as expected.

Actually slight difference on Windows - the version of Node.js installed is v12.14.0, npm is the same though (v6.13.4). Otherwise same versions of the nodes and of Node-RED, same browser. Same installation of Node-RED with the same userDir.

TotallyInformation commented 4 years ago

Well that stinks. I update node.js to the latest LTS on my W10 device and now I get this:

1|Node-RED  | Welcome to Node-RED
1|Node-RED  | ===================
1|Node-RED  | 27 Feb 19:34:45 - [info] Node-RED version: v1.0.3
1|Node-RED  | 27 Feb 19:34:45 - [info] Node.js  version: v12.16.1
1|Node-RED  | 27 Feb 19:34:45 - [info] Windows_NT 10.0.18363 x64 LE
1|Node-RED  | 27 Feb 19:34:48 - [info] Loading palette nodes
1|Node-RED  | Thu, 27 Feb 2020 19:34:52 GMT node-telegram-bot-api deprecated Automatic enabling of cancellation of promises is deprecated.
1|Node-RED  | In the future, you will have to enable it yourself.
1|Node-RED  | See https://github.com/yagop/node-telegram-bot-api/issues/319. at internal\modules\cjs\loader.js:1158:30
1|Node-RED  | 27 Feb 19:34:53 - [info] +-----------------------------------------------------
1|Node-RED  | 27 Feb 19:34:53 - [info] | uibuilder initialised:
1|Node-RED  | 27 Feb 19:34:53 - [info] |   root folder: C:\src\nr2\data\uibuilder
1|Node-RED  | 27 Feb 19:34:53 - [info] |   version . .: 3.0.0-dev1
1|Node-RED  | 27 Feb 19:34:53 - [info] |   packages . : vue,bootstrap,bootstrap-vue,jquery,moonjs,socket.io
1|Node-RED  | 27 Feb 19:34:53 - [info] +-----------------------------------------------------
1|Node-RED  | [NRTEST:module] RED.settings.contextStorage { default: { module: 'memory' }, file: { module: 'localfilesystem' } }
1|Node-RED  | 27 Feb 19:34:53 - [info] Dashboard version 2.19.3 started at /nr/ui
1|Node-RED  | 27 Feb 19:34:54 - [info] Settings file  : C:\src\nr2\data\settings.js
1|Node-RED  | 27 Feb 19:34:54 - [info] HTTP Static    : C:\src\nr2\public
1|Node-RED  | 27 Feb 19:34:54 - [info] Context store  : 'default' [module=memory]
1|Node-RED  | 27 Feb 19:34:54 - [info] Context store  : 'file' [module=localfilesystem]
1|Node-RED  | 27 Feb 19:34:54 - [info] User directory : C:\src\nr2\data
1|Node-RED  | 27 Feb 19:34:54 - [warn] No active project : using default flows file
1|Node-RED  | 27 Feb 19:34:54 - [info] Flows file     : C:\src\nr2\data\flows_DESKTOP-M1M6R28.json
1|Node-RED  | 27 Feb 19:34:54 - [info] Server now running at http://127.0.0.1:1880/red/
1|Node-RED  | 27 Feb 19:34:54 - [warn] Error loading credentials: SyntaxError: Unexpected token 
                                                                                                 in JSON at position 0
1|Node-RED  | 27 Feb 19:34:54 - [warn] Error loading flows: Error: Failed to decrypt credentials

~~The credentials file is certainly valid JSON and the timestamp on the file is from December Urm, that doesn't make any sense since I've installed ui-table and added a flow today! Weird.~~

Yes, I was right of course - weird. Because I always forget that I have PROJECTS turned on! I only use it for testing uibuilder, not for anything else.


Right, let me apologies up front for what I'm about to say as I know a lot of work has gone into them - it comes from frustration at time wasted.

Sodding projects!

Lord knows why that upgrade killed my Node-RED cred file and equally why NR suddenly decided to ignore my projects setup. But I have moved my project flow/cred file and associated uibuilder folders back to the userDir root folder and everything is working again.

After that, I can say that ui-table is still working on the Windows version of Node.js v12.16.1

dceejay commented 4 years ago

so ok to close now ?

TotallyInformation commented 4 years ago

Well only if you don't mind it still not working on Debian Buster. No difference there.

dceejay commented 4 years ago

It's working fine on Buster here . Ok - so the bit above where you say it's now working is on Windows ? and the projects piece was just a distraction...

TotallyInformation commented 4 years ago

It always worked on Windows. I just updated Node.js to the same version that I have on Buster just to make sure there is no problem there. There isn't.

The projects part was just me sounding off my frustration since the Node.js installation for some reason hosed my projects. A distraction, sorry.

On my Buster install which uses exactly the same installation format as Windows and indeed as my 2 Pi's and which has been working fine for a couple of years now, ui-table fails as indicated. It does not appear to be able to find the dashboard module for some reason.

TotallyInformation commented 4 years ago

OK, this is weird. Following on from some further chatter on ui table and context menu in the forum, I decided that I would try this again to see if I could spot the problem.

This time though, everything is working!

So I can no longer do any debugging on this. Sorry. I guess we will have to close this for now until someone else stumbles upon the same set of circumstances?