๐ŸŽ‰ Node-RED 1.3.3 released

Node-RED 1.3.3 is now available.

Fixes include:

  • Palette Manager not showing all available updates
  • MQTT nodes not publishing 'on-close' message when stopped cleanly

More details:

9 Likes

Great, MQTT on-close message and palette manager now working perfectly, for me at least. Thanks.

Hi... I have a problem.... the command node-red-start is equal to node-red. The service doesn't start. I have started the service with a sudo systemctl start nodered.service.

Are you sure you are doing
node-red-start
and not
node-red start

Run the command in a terminal and copy/paste the output here, including the command line you enter.

Colin, thank'you very much ... I'm sure of command. Sorry if I was not clear, node-red-start should start as a service and itself starts ... but if I do CTRL + C to execute other commands, it stops the flow. I don't know why he behaves differently than before.

I pasted the node-red command below (is ok ):

node-red-start

Start Node-RED

Once Node-RED has started, point a browser at http://10.0.0.4:1880
On Pi Node-RED works better with the Firefox or Chrome browser

Use sudo systemctl enable nodered.service to autostart Node-RED at every boot
Use sudo systemctl disable nodered.service to disable autostart on boot

To find more nodes and example flows - go to http://flows.nodered.org

Starting as a normal user.
21 Apr 13:22:21 - [info]

Welcome to Node-RED

etc.....

How did you install node-red?

Which version of node-red are you using?

Please post the rest of the startup log, that will give us some extra information about your environment. When posting it use the technique in this link so the forum does not mess with it. How to share code or flow json

[Edit] I think I may see the issue. Have you changed the user running node-red? The user needs to be in the sudo group.

[Further Edit] The user running node-red doesn't need to be in the sudo group if you don't want that, it is the user running node-red-start that needs to be able to use sudo. If you think the user does have sudo rights then what does the command
groups
show?

  1. I have upgraded the version from 1.3.1 to 1.3.3 with:
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)
  1. 1.3.3
node-red-start

Start Node-RED

Once Node-RED has started, point a browser at http://10.0.0.4:1880
On Pi Node-RED works better with the Firefox or Chrome browser

Use   sudo systemctl enable nodered.service  to autostart Node-RED at every boot
Use   sudo systemctl disable nodered.service to disable autostart on boot

To find more nodes and example flows - go to http://flows.nodered.org

Starting as a normal user.
21 Apr 13:22:21 - [info]

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

21 Apr 13:22:21 - [info] Node-RED version: v1.3.3
21 Apr 13:22:21 - [info] Node.js  version: v10.17.0
21 Apr 13:22:21 - [info] Linux 4.14.35-1902.5.2.2.el7uek.x86_64 x64 LE
21 Apr 13:22:22 - [info] Loading palette nodes
node-telegram-bot-api deprecated Automatic enabling of cancellation of promises is deprecated.
In the future, you will have to enable it yourself.
See https://github.com/yagop/node-telegram-bot-api/issues/319. internal/modules/cjs/loader.js:778:30
21 Apr 13:22:25 - [info] RedBot version: 0.19.7 (node-red-contrib-chatbot)
21 Apr 13:22:30 - [info] Dashboard version 2.23.0 started at /ui
21 Apr 13:22:30 - [warn] ------------------------------------------------------
21 Apr 13:22:30 - [warn] [ttb-node-red-counter/counter] Type already registered
21 Apr 13:22:30 - [warn] ------------------------------------------------------
21 Apr 13:22:30 - [info] Settings file  : /home/opc/.node-red/settings.js
21 Apr 13:22:30 - [info] Context store  : 'default' [module=localfilesystem]
21 Apr 13:22:30 - [info] User directory : /home/opc/.node-red
21 Apr 13:22:30 - [warn] Projects disabled : editorTheme.projects.enabled=false
21 Apr 13:22:30 - [info] Flows file     : /home/opc/.node-red/flows_node-red.json
21 Apr 13:22:30 - [info] Server now running at http://127.0.0.1:1880/
21 Apr 13:22:31 - [warn]

---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.

You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------

21 Apr 13:22:31 - [info] Starting flows
Telegram Bot PromemoriaBot will be launched, environment is development
Telegram Bot node will be launched, environment is development
21 Apr 13:22:31 - [info] Started flows

After this, I have a log from chatbot node, when I press CTRL + C , the flow is stopped


^C21 Apr 13:24:48 - [info] Stopping flows
^C21 Apr 13:24:58 - [info] Stopped flows

Did you see the edits to my post?

Sorry Colin. I response now:

[Edit] No, the VM is running from 18:00:31 up 545 days, 21:33, 1 user, load average: 0.00, 0.00, 0.00
I haven't upgraded the system and I haven't changed the user

I have only upgraded node-red first from 1.0.x (i don't remember.... 6 days ago) to 1.3.1, now to 1.3.1 to 1.3.3

Further Edit

 groups
opc adm wheel systemd-journal

The default user is opc

Can the user pi use sudo?

The problem is as I said, the user must be in the sudo group. That may be a change to the command with the node red update. If the user can use sudo but is not in the sudo group then that is something that the command does not cope with and maybe needs to be addressed. You can workaround it by adding the user to the sudo group.

I used sudo with my user opc. For example I have used "sudo systemctl enable nodered.service" anche i haven't received the negative response or password require. I have try now "sudo node-red-start" and I have a log:

 sudo node-red-start

Start Node-RED

Once Node-RED has started, point a browser at http://10.0.0.4:1880
On Pi Node-RED works better with the Firefox or Chrome browser

Use   sudo systemctl enable nodered.service  to autostart Node-RED at every boot
Use   sudo systemctl disable nodered.service to disable autostart on boot

To find more nodes and example flows - go to http://flows.nodered.org

Starting as root systemd service.
Started Node-RED graphical event wiring tool.
21 Apr 18:26:52 - [info]
Welcome to Node-RED
===================
21 Apr 18:26:52 - [info] Node-RED version: v1.3.3
21 Apr 18:26:52 - [info] Node.js  version: v10.17.0
21 Apr 18:26:52 - [info] Linux 4.14.35-1902.5.2.2.el7uek.x86_64 x64 LE
21 Apr 18:26:52 - [info] Loading palette nodes
Wed, 21 Apr 2021 16:26:57 GMT node-telegram-bot-api deprecated Automatic enabling of cancellation of promises is deprecated.
In the future, you will have to enable it yourself.
See https://github.com/yagop/node-telegram-bot-api/issues/319. at internal/modules/cjs/loader.js:778:30
21 Apr 18:26:57 - [info] RedBot version: 0.19.7 (node-red-contrib-chatbot)
21 Apr 18:27:03 - [info] Dashboard version 2.23.0 started at /ui
21 Apr 18:27:03 - [warn] ------------------------------------------------------
21 Apr 18:27:03 - [warn] [ttb-node-red-counter/counter] Type already registered
21 Apr 18:27:03 - [warn] ------------------------------------------------------
21 Apr 18:27:03 - [info] Settings file  : /home/opc/.node-red/settings.js
21 Apr 18:27:03 - [info] Context store  : 'default' [module=localfilesystem]
21 Apr 18:27:03 - [info] User directory : /home/opc/.node-red
21 Apr 18:27:03 - [warn] Projects disabled : editorTheme.projects.enabled=false
21 Apr 18:27:03 - [info] Flows file     : /home/opc/.node-red/flows_node-red.json
21 Apr 18:27:03 - [info] Server now running at http://127.0.0.1:1880/
21 Apr 18:27:03 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
21 Apr 18:27:04 - [info] Starting flows
Telegram Bot PromemoriaBot will be launched, environment is development
Telegram Bot node will be launched, environment is development
21 Apr 18:27:04 - [info] Started flows
------ WebHooks for TELEGRAM----------------
http://localhost:1880/redbot/telegram/test
http://localhost:1880/redbot/telegram
Chat server started, transport: telegram
21 Apr 18:27:05 - [error] [process-list:e94c1a0.13a17e8] Error: can't open stat
21 Apr 18:27:05 - [info] [debug:89e92a71.825228]
602036
21 Apr 18:27:05 - [warn] Communication send error: Error: WebSocket is not open: readyState 3 (CLOSED)

In the log the user is root now (not normal user ), and now I work correctly (if I send ctrl+c for next command the process is remain active)

sudo systemctl status  nodered.service
โ— nodered.service - Node-RED graphical event wiring tool
   Loaded: loaded (/etc/systemd/system/nodered.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2021-04-21 18:26:50 CEST; 3min 53s ago
     Docs: http://nodered.org/docs/hardware/raspberrypi.html
 Main PID: 26647 (node-red)
   CGroup: /system.slice/nodered.service
           โ””โ”€26647 node-red

I suspect that your pi is setup to allow anyone to use sudo and not require a password, which is a bad idea in my opinion, but may be the default for a pi, I don't know. What does the file /etc/sudoers contain?

Have you still got the default pi user (assuming you installed raspbian)? What groups is that user in? You can find out using groups pi. I haven't got a default Raspbian install so can't check.

I'm in a oracle linux on cloud...not in raspbian. I haven't touched the user (or not remember)...but the user opc has similar to pi on Rasperry OS for the command sudo.

If in my system I need add sudo to node-red-start (it wasn't necessary before)....The problem is solved.

Now with different linux distros I always find myself slightly different behavior.

The file /etc/sudoers

## Sudoers allows particular users to run various commands as
## the root user, without needing the root password.
##
## Examples are provided at the bottom of the file for collections
## of related commands, which can then be delegated out to particular
## users or groups.
##
## This file must be edited with the 'visudo' command.

## Host Aliases
## Groups of machines. You may prefer to use hostnames (perhaps using
## wildcards for entire domains) or IP addresses instead.
# Host_Alias     FILESERVERS = fs1, fs2
# Host_Alias     MAILSERVERS = smtp, smtp2

## User Aliases
## These aren't often necessary, as you can use regular groups
## (ie, from files, LDAP, NIS, etc) in this file - just use %groupname
## rather than USERALIAS
# User_Alias ADMINS = jsmith, mikem


## Command Aliases
## These are groups of related commands...

## Networking
# Cmnd_Alias NETWORKING = /sbin/route, /sbin/ifconfig, /bin/ping, /sbin/dhclient, /usr/bin/net, /sb$

## Installation and management of software
# Cmnd_Alias SOFTWARE = /bin/rpm, /usr/bin/up2date, /usr/bin/yum

## Services
# Cmnd_Alias SERVICES = /sbin/service, /sbin/chkconfig, /usr/bin/systemctl start, /usr/bin/systemct$

## Updating the locate database
# Cmnd_Alias LOCATE = /usr/bin/updatedb

## Storage
# Cmnd_Alias STORAGE = /sbin/fdisk, /sbin/sfdisk, /sbin/parted, /sbin/partprobe, /bin/mount, /bin/u$

## Delegating permissions
# Cmnd_Alias DELEGATING = /usr/sbin/visudo, /bin/chown, /bin/chmod, /bin/chgrp

## Processes
# Cmnd_Alias PROCESSES = /bin/nice, /bin/kill, /usr/bin/kill, /usr/bin/killall

## Drivers
# Cmnd_Alias DRIVERS = /sbin/modprobe

# Defaults specification

#
# Refuse to run if unable to disable echo on the tty.
#
Defaults   !visiblepw

#
# Preserving HOME has security implications since many programs
# use it when searching for configuration files. Note that HOME
# is already set when the the env_reset option is enabled, so
# this option is only effective for configurations where either
# env_reset is disabled or HOME is present in the env_keep list.
#
Defaults    always_set_home
Defaults    match_group_by_gid

# Prior to version 1.8.15, groups listed in sudoers that were not
# found in the system group database were passed to the group
# plugin, if any. Starting with 1.8.15, only groups of the form
# %:group are resolved via the group plugin by default.
# We enable always_query_group_plugin to restore old behavior.
# Disable this option for new behavior.
Defaults    always_query_group_plugin

Defaults    env_reset
Defaults    env_keep =  "COLORS DISPLAY HOSTNAME HISTSIZE KDEDIR LS_COLORS"
Defaults    env_keep += "MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE"
Defaults    env_keep += "LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES"
Defaults    env_keep += "LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE"
Defaults    env_keep += "LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY"

#
# Adding HOME to env_keep may enable a user to run unrestricted
# commands via sudo.
# Defaults   env_keep += "HOME"

Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin



## Next comes the main part: which users can run what software on
## which machines (the sudoers file can be shared between multiple
## systems).
## Syntax:
##
##      user    MACHINE=COMMANDS
##
## The COMMANDS section may have other options added to it.
##
## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL

## Allows members of the 'sys' group to run networking, software,
## service management apps and more.
# %sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, DELEGATING, PROCESSES, LOCATE, DRIVERS

## Allows people in group wheel to run all commands
%wheel  ALL=(ALL)       ALL

## Same thing without a password
# %wheel        ALL=(ALL)       NOPASSWD: ALL

## Allows members of the users group to mount and unmount the
## cdrom as root
# %users  ALL=/sbin/mount /mnt/cdrom, /sbin/umount /mnt/cdrom

## Allows members of the users group to shutdown this system
# %users  localhost=/sbin/shutdown -h now

## Read drop-in files from /etc/sudoers.d (the # here does not mean a comment)
#includedir /etc/sudoers.d

Sorry, I don't know why I thought you were on a pi, trying to track too many threads at once I think.

Well I have no idea why you did not have the problem previously as that part of the command does not appear to have changed recently. The fix is to add the user to the sudo group, or does that give you a problem? It appears that oracle linux is a unusual in not using the sudo group to specify users that can use sudo.

Or of course you could edit /usr/bin/node-red-start and remove that test, or just create an alias for the systemctl start command to use instead.

Colin, the important thing is to solve the problem. I had not thought of starting the node-red service with sudo and second, since it did not start as a service I thought to inform you about it thinking there had been some changes in this regard (which you have denied).

I have no problem with starting node-red with sudo.

Thanks for your patience.

I don't think I denied that something had changed, I said it doesn't appear to have changed, but there may be something I haven't noticed. If you used to be able to use node-red-start but now can't then something must have changed somewhere, but it isn't clear just what that is.

Having looked at your sudoers file it says that users in the group wheel can use sudo commands without having to enter a password. The user opc is in that group so that explains why you can do that.

If you want to use node-red-start (which uses systemctl) rather than using systemctl manually then you can add the user to the sudo group, just by running
sudo usermod -a -G sudo opc
then log out and in again and the command groups should show you now in sudo group and node-red-start/node-red-stop should work.

it is working fine for me. thanks for your hardwork team!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.