# Error loading settings file: .node-red/settings.js after server restart

**URL:** <https://discourse.nodered.org/t/error-loading-settings-file-node-red-settings-js-after-server-restart/12435>\
**Category:** General\
**Created:** [20 June 2019 15:52 UTC](https://discourse.nodered.org/t/error-loading-settings-file-node-red-settings-js-after-server-restart/12435 "2019-06-20T15:52:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![noviadiscovery](https://avatars.discourse-cdn.com/v4/letter/n/b487fb/32.png) [@noviadiscovery](https://discourse.nodered.org/u/noviadiscovery)\
**Post date:** [20 June 2019 15:52 UTC](https://discourse.nodered.org/t/error-loading-settings-file-node-red-settings-js-after-server-restart/12435/1 "2019-06-20T15:52:24Z")

</div>

Hi all  
Recently started working with Node-Red for a project I've got; and so far I like it a lot.  
I am going to connect it to Ubidots, to use their functionality as they seem to have what I need.  
Anyway; I am getting this error everytime I restart the server (ubuntu 18.04) or have kept the server turned off (in cloud) when not developing on it.

I have forced HTTPS, installed a cert (in nodecerts subfolder), and made the setup with user authentication.

The error log I get:  
Error loading settings file: /home/noby/.node-red/settings.js  
{ Error: ENOENT: no such file or directory, open 'nodecerts/node-key.pem'  
at Object.openSync (fs.js:443:3)  
at Object.readFileSync (fs.js:343:35)  
at Object. (/home/noby/.node-red/settings.js:151:14)  
at Module.\_compile (internal/modules/cjs/loader.js:776:30)  
at Object.Module.\_extensions..js (internal/modules/cjs/loader.js:787:10)  
at Module.load (internal/modules/cjs/loader.js:653:32)  
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)  
at Function.Module.\_load (internal/modules/cjs/loader.js:585:3)  
at Module.require (internal/modules/cjs/loader.js:690:17)  
at require (internal/modules/cjs/helpers.js:25:18)  
errno: -2,  
syscall: 'open',  
code: 'ENOENT',  
path: 'nodecerts/node-key.pem' }

I am solving the issue simply by opening settings.js, delete one letter of the nodecerts/node-key.pem path and typing it in again; and finish with esc+wq!.  
Restart the server and its running like nothing ever happened.  
Anyway it is pretty anoying that I have to do this everytime the server restarts.  
Does anyone know of a better solution to the issue?

Best Regards

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [20 June 2019 15:58 UTC](https://discourse.nodered.org/t/error-loading-settings-file-node-red-settings-js-after-server-restart/12435/2 "2019-06-20T15:58:49Z")

</div>

> [@noviadiscovery](#):
>
> 'nodecerts/node-key.pem'

So that file doesn't exist, as the error says. I suspect that it isn't in the relative path that you think it is.

Try using an absolute path.

---

<div class="post-metadata">

**Author:** ![noviadiscovery](https://avatars.discourse-cdn.com/v4/letter/n/b487fb/32.png) [@noviadiscovery](https://discourse.nodered.org/u/noviadiscovery)\
**Post date:** [20 June 2019 16:53 UTC](https://discourse.nodered.org/t/error-loading-settings-file-node-red-settings-js-after-server-restart/12435/3 "2019-06-20T16:53:03Z")

</div>

Thanks - The thing is that the path/file does exist.  
Edit:  
After using absolute path in the settings.js file I no longer experience this error.  
Issue solved - thank you TotallyInformation.
