Delete all flows from the command line

1,503 views
Skip to first unread message

Dan Hoover

unread,
Aug 31, 2017, 8:56:59 PM8/31/17
to Node-RED
My node-red has crashed. How do I delete my flows from the command line in ubuntu?

Colin Law

unread,
Sep 1, 2017, 2:09:19 AM9/1/17
to node...@googlegroups.com
Do you mean it keeps crashing every time you start it? Is it crashing or just hanging? Look at the log to find out. If hanging then often this is due to an mqtt loop, try stopping the mqtt server and see what happens. 
To answer the question if you rename the flows file and restart I think that will do what you want, not sure if you need to make an empty one. Also note that node red keeps a copy of the previous flow (.bak I think) so if you copy this over the original it will put you back to the previous version.

Colin

On 1 Sep 2017 1:57 a.m., "Dan Hoover" <mud...@gmail.com> wrote:
My node-red has crashed. How do I delete my flows from the command line in ubuntu?

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/ced2676f-2a29-4481-86d2-5e303ff4c3c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nick O'Leary

unread,
Sep 1, 2017, 3:48:51 AM9/1/17
to Node-RED Mailing List
Dan,

before deleting anything, you may want to investigate why it is crashing. What does the node-red log say? If there's a node crashing your node-red it would be helpful to the community to identify the issue and help get it fixed.

Nick



Dan Hoover

unread,
Sep 1, 2017, 9:51:07 AM9/1/17
to Node-RED
I don't know what's going on...here's what it says if I try to restart nr while already running...

1 Sep 13:48:47 - [info] Node-RED version: v0.16.2
1 Sep 13:48:47 - [info] Node.js  version: v4.2.6
1 Sep 13:48:47 - [info] Linux 2.6.32-43-pve x64 LE
1 Sep 13:48:48 - [info] Loading palette nodes
1 Sep 13:48:50 - [warn] ------------------------------------------------------
1 Sep 13:48:50 - [warn] [rpi-gpio] Info : Ignoring Raspberry Pi specific node
1 Sep 13:48:50 - [warn] ------------------------------------------------------
1 Sep 13:48:50 - [info] Settings file  : /root/.node-red/settings.js
1 Sep 13:48:50 - [info] User directory : /root/.node-red
1 Sep 13:48:50 - [info] Flows file     : /root/.node-red/flows_ui.json
1 Sep 13:48:50 - [info] Creating new flow file
1 Sep 13:48:50 - [info] Starting flows
1 Sep 13:48:50 - [info] Started flows


It keeps saying creating new flow file. That json file is empty if I try to open it.
/var/logs/syslog. and syslog.1 are blank.

I did see one time that it was trying to connect to an incorrectly configured (in nr) mqtt server, but I can't find the flow files to stop/rename them.


On Thursday, August 31, 2017 at 11:48:51 PM UTC-8, Nick O'Leary wrote:
Dan,

before deleting anything, you may want to investigate why it is crashing. What does the node-red log say? If there's a node crashing your node-red it would be helpful to the community to identify the issue and help get it fixed.

Nick


On 1 September 2017 at 07:09, Colin Law <cla...@gmail.com> wrote:
Do you mean it keeps crashing every time you start it? Is it crashing or just hanging? Look at the log to find out. If hanging then often this is due to an mqtt loop, try stopping the mqtt server and see what happens. 
To answer the question if you rename the flows file and restart I think that will do what you want, not sure if you need to make an empty one. Also note that node red keeps a copy of the previous flow (.bak I think) so if you copy this over the original it will put you back to the previous version.

Colin
On 1 Sep 2017 1:57 a.m., "Dan Hoover" <mud...@gmail.com> wrote:
My node-red has crashed. How do I delete my flows from the command line in ubuntu?

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/ced2676f-2a29-4481-86d2-5e303ff4c3c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Colin Law

unread,
Sep 1, 2017, 9:53:42 AM9/1/17
to node...@googlegroups.com
It looks like you are trying to run node-red as root, which is
generally not a good idea. Are you doing that on purpose? How are you
starting node-red?

Colin
> https://groups.google.com/d/msgid/node-red/ad1a3f00-4cd0-4f13-9385-817fa0c1ba85%40googlegroups.com.

Nick O'Leary

unread,
Sep 1, 2017, 9:54:52 AM9/1/17
to Node-RED Mailing List
Dan, 

I don't see a crash there - that looks like it has started.

Have you looked in /home/pi/.node-red for a flow file? Normally you'd run as the pi user and not as root.

I'm sure we've been through this with you before...

Nick


On 1 September 2017 at 14:51, Dan Hoover <mud...@gmail.com> wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

Nick O'Leary

unread,
Sep 1, 2017, 10:02:08 AM9/1/17
to Node-RED Mailing List
I searched in the group history and sure enough we talked about running as root vs the pi user previously. But it didn't come to a conclusion.

You started this thread asking how to delete your flows because its crashing. The log you've shared says your flow file is empty and doesn't show it crashing. I think you need to explain again what you are seeing and what you want help with.

Nick




Dan Hoover

unread,
Sep 1, 2017, 12:32:53 PM9/1/17
to Node-RED
I appreciate your patience. I did start a new thread because searching the old ones, I couldn't figure out an answer there either.

This is not a pi, it's a Ubuntu 16.04 server in the cloud.  It's one I setup when I was first learning node-red so that's why it's installed as root.  I'm trying to shut it down and move the flows to one that is "properly" configured, but I can't get to the ui on this one.  

I'm sorry. I'm a linux noob and it works great for me until it doesn't and then I'm totally lost.

To summarize. NR starts on boot so I cannot see the "initial" messages (unless there is some other log). The best I can do is just type node-red at the command prompt when I ssh in, but of course, nr is already started, so it will fail.  At least it tells me where the flows are supposed to be, but once I navigate there, they're blank...so I'm lost. 

I'm really not trying to bother you with the same questions, but I seem to have three problems pretty consistently on different installs.
1. Something crashes on NR and I can't figure out how to stop it.
2. NR won't ask for a password.
3. NR "hangs" when I put in the proper password.

Here is the complete log when I type nr at the ssh command prompt. THANK YOU for your patience and your persistence. NR has been such a massive help to me.
Welcome to Node-RED
===================

1 Sep 16:32:13 - [info] Node-RED version: v0.16.2
1 Sep 16:32:13 - [info] Node.js  version: v4.2.6
1 Sep 16:32:13 - [info] Linux 2.6.32-43-pve x64 LE
1 Sep 16:32:14 - [info] Loading palette nodes
1 Sep 16:32:16 - [warn] ------------------------------------------------------
1 Sep 16:32:16 - [warn] [rpi-gpio] Info : Ignoring Raspberry Pi specific node
1 Sep 16:32:16 - [warn] ------------------------------------------------------
1 Sep 16:32:16 - [info] Settings file  : /root/.node-red/settings.js
1 Sep 16:32:16 - [info] User directory : /root/.node-red
1 Sep 16:32:16 - [info] Flows file     : /root/.node-red/flows_ui.json
1 Sep 16:32:16 - [info] Creating new flow file
1 Sep 16:32:16 - [info] Starting flows
1 Sep 16:32:16 - [info] Started flows
1 Sep 16:32:16 - [warn] Communication server error: Error: listen EADDRINUSE 0.0.0.0:1880
1 Sep 16:32:16 - [error] Unable to listen on http://127.0.0.1:1880/
1 Sep 16:32:16 - [error] Error: port in use




David Caparrós

unread,
Sep 2, 2017, 2:00:11 PM9/2/17
to Node-RED
To stop it try:  sudo service nodered stop

Dan Hoover

unread,
Sep 4, 2017, 3:25:19 PM9/4/17
to Node-RED
It says Failed to stop nodered.service: Unit nodered.service not loaded.

Although node-red is running and started at boot.  And it still only intermittently asks me for a password

Colin Law

unread,
Sep 4, 2017, 3:53:41 PM9/4/17
to node...@googlegroups.com
On 4 September 2017 at 20:25, Dan Hoover <mud...@gmail.com> wrote:
> It says Failed to stop nodered.service: Unit nodered.service not loaded.
>
> Although node-red is running and started at boot. And it still only
> intermittently asks me for a password

How is it starting at boot?

Colin

>
>
> On Saturday, September 2, 2017 at 10:00:11 AM UTC-8, David Caparrós wrote:
>>
>> To stop it try: sudo service nodered stop
>
> --
> http://nodered.org
>
> Join us on Slack to continue the conversation: http://nodered.org/slack
> ---
> You received this message because you are subscribed to the Google Groups
> "Node-RED" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to node-red+u...@googlegroups.com.
> To post to this group, send email to node...@googlegroups.com.
> Visit this group at https://groups.google.com/group/node-red.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/node-red/58f38112-7101-4bd1-90cc-e2cf363967e7%40googlegroups.com.

David Caparrós

unread,
Sep 4, 2017, 4:36:21 PM9/4/17
to Node-RED

Look which process number it is with "ps aux" once you have located it "kill process_number"  or  killall name_process  if you know it (maybe node-red or nodered).

Regards

David Caparrós

unread,
Sep 4, 2017, 4:37:15 PM9/4/17
to Node-RED

forgot to tell you to use sudo first or log as root, of course

Dan Hoover

unread,
Sep 4, 2017, 5:45:15 PM9/4/17
to Node-RED
I usually start it by editing the rc.local file and telling it to run node red at boot. 

Thanks for the tip on killing node red @David. I'm still not sure how to delete individual (or even all nodes that crash on boot).

Colin Law

unread,
Sep 5, 2017, 2:06:07 AM9/5/17
to node...@googlegroups.com
To enable nodered to run on boot you should use
sudo systemctl enable nodered
Then to manually start or stop it use
sudo systemctl stop nodered
Use start or restart in that command to manually start or restart it.

Obviously remove the rc.local stuff.

Colin

To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.

To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.

David Caparrós

unread,
Sep 5, 2017, 2:46:46 AM9/5/17
to Node-RED

Hello Dan

To delete your flows, once you stopped node-red you can go to node-red folder (/home/pi/.node-red/)  and delete/rename the files:
flows_raspberrypi.json    &    flows_raspberrypi_cred.json

After this once you start again node-red it will create again this files on blank, unfortunately you will lose your previous job, this is clear but node-red will work again straight.

Regards


Reply all
Reply to author
Forward
0 new messages