# Main process exited, code=killed, status=9/KILL

**URL:** https://discourse.nodered.org/t/main-process-exited-code-killed-status-9-kill/5276
**Category:** General
**Created:** [28 November 2018 19:29 UTC](https://discourse.nodered.org/t/main-process-exited-code-killed-status-9-kill/5276 "2018-11-28T19:29:38Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![JoseGodinho](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@JoseGodinho](https://discourse.nodered.org/u/JoseGodinho)
#### Post date: [28 November 2018 19:29 UTC](https://discourse.nodered.org/t/main-process-exited-code-killed-status-9-kill/5276/1 "2018-11-28T19:29:38Z")

</div>

Any suggestions to debug?

8 Nov 19:23:38 - [info] Node-RED version: v0.19.5  
28 Nov 19:23:38 - [info] Node.js version: v8.12.0  
28 Nov 19:23:38 - [info] Linux 4.14.71-v7+ arm LE  
28 Nov 19:23:38 - [info] Loading palette nodes  
28 Nov 19:23:48 - [info] Dashboard version 2.11.0 started at /ui  
28 Nov 19:23:48 - [info] Settings file : /home/pi/.node-red/settings.js  
28 Nov 19:23:48 - [info] HTTP Static : /home/pi/node-red-static  
28 Nov 19:23:48 - [info] Context store : 'default' [module=memory]  
28 Nov 19:23:48 - [info] User directory : /home/pi/.node-red  
28 Nov 19:23:48 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable  
28 Nov 19:23:48 - [info] Flows file : /home/pi/.node-red/flows\_raspberrypi.json  
nodered.service: Main process exited, code=killed, status=9/KILL  
nodered.service: Unit entered failed state.  
nodered.service: Failed with result 'signal'.  
nodered.service: Service hold-off time over, scheduling restart.  
Stopped Node-RED graphical event wiring tool..

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [28 November 2018 20:52 UTC](https://discourse.nodered.org/t/main-process-exited-code-killed-status-9-kill/5276/2 "2018-11-28T20:52:53Z")

</div>

Did it used to work? If so what happened that might have caused it?  
First make a copy of the file `.flows_raspberrypi.json.backup`, it may be useful later. Note there is a leading dot on the name.  
Next rename the flows file `flows_raspberrypi.json` and restart node red then it will start with an empty flow file. See if it is ok then. If it is ok then it is something in the flows file that is causing it. Copy the saved backup file back and rename it `flows_raspberrypi.json`. The backup file is the previous version of the file so should be it before your last edit. Restart node red again.

---

<div class="post-metadata">

### Author: ![JoseGodinho](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@JoseGodinho](https://discourse.nodered.org/u/JoseGodinho)
#### Post date: [28 November 2018 20:53 UTC](https://discourse.nodered.org/t/main-process-exited-code-killed-status-9-kill/5276/3 "2018-11-28T20:53:27Z")

</div>

been there done that

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [28 November 2018 20:54 UTC](https://discourse.nodered.org/t/main-process-exited-code-killed-status-9-kill/5276/4 "2018-11-28T20:54:59Z")

</div>

> [@JoseGodinho](#):
>
> been there done that

Done which part and what was the result? We are not telepathic.  
[Edit] Also please answer the questions in the first line.

---

<div class="post-metadata">

### Author: ![JoseGodinho](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@JoseGodinho](https://discourse.nodered.org/u/JoseGodinho)
#### Post date: [28 November 2018 21:08 UTC](https://discourse.nodered.org/t/main-process-exited-code-killed-status-9-kill/5276/5 "2018-11-28T21:08:00Z")

</div>

Hello colin  
My apologies for my rude answer.

so i have started node red with a clean flow, and tried to install a node

8 Nov 21:04:18 - [info] Node-RED version: v0.19.5  
28 Nov 21:04:18 - [info] Node.js version: v8.14.0  
28 Nov 21:04:18 - [info] Linux 4.14.79-v7+ arm LE  
28 Nov 21:04:19 - [info] Loading palette nodes  
28 Nov 21:04:34 - [info] Dashboard version 2.11.0 started at /ui  
28 Nov 21:04:34 - [info] Settings file : /home/pi/.node-red/settings.js  
28 Nov 21:04:34 - [info] HTTP Static : /home/pi/node-red-static  
28 Nov 21:04:34 - [info] Context store : 'default' [module=memory]  
28 Nov 21:04:34 - [info] User directory : /home/pi/.node-red  
28 Nov 21:04:34 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable  
28 Nov 21:04:34 - [info] Flows file : /home/pi/.node-red/flows\_raspberrypi.json  
28 Nov 21:04:34 - [info] Creating new flow file  
28 Nov 21:04:35 - [info] Server now running at [http://127.0.0.1:1880/](http://127.0.0.1:1880/)  
28 Nov 21:04:35 - [info] Starting flows  
28 Nov 21:04:35 - [info] Started flows  
28 Nov 21:05:46 - [info] Installing module: node-red-contrib-modbus, version: 4.1.1  
28 Nov 21:06:03 - [warn] Installation of module node-red-contrib-modbus failed:  
28 Nov 21:06:03 - [warn] ------------------------------------------  
28 Nov 21:06:03 - [warn] Killed  
28 Nov 21:06:03 - [warn] ------------------------------------------

is there any way to clean all the nodes? and start all over again  
?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [28 November 2018 21:09 UTC](https://discourse.nodered.org/t/main-process-exited-code-killed-status-9-kill/5276/6 "2018-11-28T21:09:59Z")

</div>

What does `npm -v` show  
What do you see if you install from the comand line?

```bash
cd ~/.node-red
npm install node-red-contrib-modbus

```

---

<div class="post-metadata">

### Author: ![JoseGodinho](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@JoseGodinho](https://discourse.nodered.org/u/JoseGodinho)
#### Post date: [28 November 2018 21:11 UTC](https://discourse.nodered.org/t/main-process-exited-code-killed-status-9-kill/5276/7 "2018-11-28T21:11:52Z")

</div>

> [@Colin](#):
>
> npm -v

pi@raspberrypi:~ $ npm -v  
6.4.1

npm install node-red-contrib-modbus  
Killed

---

<div class="post-metadata">

### Author: ![JoseGodinho](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@JoseGodinho](https://discourse.nodered.org/u/JoseGodinho)
#### Post date: [28 November 2018 21:13 UTC](https://discourse.nodered.org/t/main-process-exited-code-killed-status-9-kill/5276/8 "2018-11-28T21:13:42Z")

</div>

sorry wrong DIR

now in .node-red

pi@raspberrypi:~/.node-red $ npm install node-red-contrib-modbus  
npm WARN checkPermissions Missing write access to /home/pi/.node-red/node\_modules/jsmodbus  
npm WARN checkPermissions Missing write access to /home/pi/.node-red/node\_modules/source-map-support  
npm WARN checkPermissions Missing write access to /home/pi/.node-red/node\_modules/vm2  
npm WARN node-red-project@0.0.1 No repository field.  
npm WARN node-red-project@0.0.1 No license field.

npm ERR! path /home/pi/.node-red/node\_modules/jsmodbus  
npm ERR! code EACCES  
npm ERR! errno -13  
npm ERR! syscall access  
npm ERR! Error: EACCES: permission denied, access '/home/pi/.node-red/node\_modules/jsmodbus'  
npm ERR! { Error: EACCES: permission denied, access '/home/pi/.node-red/node\_modules/jsmodbus'  
npm ERR! stack: 'Error: EACCES: permission denied, access '/home/pi/.node-red/node\_modules/jsmodbus'',  
npm ERR! errno: -13,  
npm ERR! code: 'EACCES',  
npm ERR! syscall: 'access',  
npm ERR! path: '/home/pi/.node-red/node\_modules/jsmodbus' }  
npm ERR!  
npm ERR! The operation was rejected by your operating system.  
npm ERR! It is likely you do not have the permissions to access this file as the current user  
npm ERR!  
npm ERR! If you believe this might be a permissions issue, please double-check the  
npm ERR! permissions of the file and its containing directories, or try running  
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:  
npm ERR! /home/pi/.npm/\_logs/2018-11-28T21\_13\_01\_771Z-debug.log

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [28 November 2018 21:14 UTC](https://discourse.nodered.org/t/main-process-exited-code-killed-status-9-kill/5276/9 "2018-11-28T21:14:19Z")

</div>

Hmm, odd. You could try renaming the .node-red directory. Then restart node-red. That should recreate the directory with no local nodes installed. Then try the install from the command line again.  
You still haven't told us what happened that might have triggered this.  
Is the pi otherwise behaving normally?

---

<div class="post-metadata">

### Author: ![JoseGodinho](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@JoseGodinho](https://discourse.nodered.org/u/JoseGodinho)
#### Post date: [28 November 2018 21:18 UTC](https://discourse.nodered.org/t/main-process-exited-code-killed-status-9-kill/5276/10 "2018-11-28T21:18:39Z")

</div>

i have been using node-red for one year now, and haven't done nothing differently.  
I just started to have this memory Leaks.

I have daily saved the flows and the flows\_raspberrypi\_cred.json.

Should I clean all the raspebrry SD and start with a clean sheet?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [28 November 2018 21:22 UTC](https://discourse.nodered.org/t/main-process-exited-code-killed-status-9-kill/5276/11 "2018-11-28T21:22:54Z")

</div>

Just seen your post in the right directory. It seems you have not got access to some folders. Possibly you have been running node-red or npm with sudo, which can cause that. To fix it

```bash
cd ~/.node-red
sudo chown -R pi:pi .

```

That should change the ownership of everything in .node red back to being owned by pi.

---

<div class="post-metadata">

### Author: ![JoseGodinho](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@JoseGodinho](https://discourse.nodered.org/u/JoseGodinho)
#### Post date: [28 November 2018 21:30 UTC](https://discourse.nodered.org/t/main-process-exited-code-killed-status-9-kill/5276/12 "2018-11-28T21:30:58Z")

</div>

colin

Thank you stil the same

how may clean all and install again?

JLG

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [28 November 2018 21:34 UTC](https://discourse.nodered.org/t/main-process-exited-code-killed-status-9-kill/5276/13 "2018-11-28T21:34:58Z")

</div>

> [@JoseGodinho](#):
>
> Thank you stil the same

So after running chown you still see the access permissions error?

But if you don't want to investigate further then as I suggested you can rename the .node-red directory and restart node-red and it will create a new directory with no local nodes installed.

---

<div class="post-metadata">

### Author: ![JoseGodinho](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@JoseGodinho](https://discourse.nodered.org/u/JoseGodinho)
#### Post date: [28 November 2018 21:40 UTC](https://discourse.nodered.org/t/main-process-exited-code-killed-status-9-kill/5276/14 "2018-11-28T21:40:57Z")

</div>

done that stiil the same

## =================== 28 Nov 21:39:09 - [info] Node-RED version: v0.19.5 28 Nov 21:39:09 - [info] Node.js version: v8.14.0 28 Nov 21:39:09 - [info] Linux 4.14.79-v7+ arm LE 28 Nov 21:39:10 - [info] Loading palette nodes 28 Nov 21:39:16 - [info] Settings file : /home/pi/.node-red/settings.js 28 Nov 21:39:16 - [info] Context store : 'default' [module=memory] 28 Nov 21:39:16 - [info] User directory : /home/pi/.node-red 28 Nov 21:39:16 - [warn] Projects disabled : editorTheme.projects.enabled=false 28 Nov 21:39:16 - [info] Flows file : /home/pi/.node-red/flows\_raspberrypi.json 28 Nov 21:39:16 - [info] Creating new flow file 28 Nov 21:39:16 - [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.

28 Nov 21:39:16 - [info] Starting flows  
28 Nov 21:39:16 - [info] Started flows  
28 Nov 21:39:16 - [info] Server now running at [http://127.0.0.1:1880/](http://127.0.0.1:1880/)  
28 Nov 21:40:05 - [info] Installing module: node-red-contrib-modbus, version: 4.1.1  
28 Nov 21:40:26 - [warn] Installation of module node-red-contrib-modbus failed:  
28 Nov 21:40:26 - [warn] ------------------------------------------  
28 Nov 21:40:26 - [warn] Killed  
28 Nov 21:40:26 - [warn] ------------------------------------------

---

<div class="post-metadata">

### Author: ![JoseGodinho](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@JoseGodinho](https://discourse.nodered.org/u/JoseGodinho)
#### Post date: [28 November 2018 21:41 UTC](https://discourse.nodered.org/t/main-process-exited-code-killed-status-9-kill/5276/15 "2018-11-28T21:41:23Z")

</div>

the raspberry pi is a rabit hole

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [28 November 2018 21:51 UTC](https://discourse.nodered.org/t/main-process-exited-code-killed-status-9-kill/5276/16 "2018-11-28T21:51:59Z")

</div>

> [@JoseGodinho](#):
>
> nstalling module: node-red-contrib-modbus, version: 4.1.1

Please try and make it clear what you have done. Do you mean you renamed the .node-red directory?  
Are you telling it to install the node or is it doing that by itself?

---

<div class="post-metadata">

### Author: ![JoseGodinho](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@JoseGodinho](https://discourse.nodered.org/u/JoseGodinho)
#### Post date: [28 November 2018 22:45 UTC](https://discourse.nodered.org/t/main-process-exited-code-killed-status-9-kill/5276/17 "2018-11-28T22:45:57Z")

</div>

renamed the directory.  
started node red with a new flow , and tested by trying to install that node again

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [28 November 2018 23:06 UTC](https://discourse.nodered.org/t/main-process-exited-code-killed-status-9-kill/5276/18 "2018-11-28T23:06:42Z")

</div>

As per the readme for the node did you try a manual install with --unsafe-perm ?
