# NodeRED ENOENT error when trying to reading the Certificate files

**URL:** https://discourse.nodered.org/t/nodered-enoent-error-when-trying-to-reading-the-certificate-files/76754
**Category:** General
**Created:** [20 March 2023 14:33 UTC](https://discourse.nodered.org/t/nodered-enoent-error-when-trying-to-reading-the-certificate-files/76754 "2023-03-20T14:33:26Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![rahul.abraham](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@rahul.abraham](https://discourse.nodered.org/u/rahul.abraham)
#### Post date: [20 March 2023 14:33 UTC](https://discourse.nodered.org/t/nodered-enoent-error-when-trying-to-reading-the-certificate-files/76754/1 "2023-03-20T14:33:26Z")

</div>

Hi,

I get the following error when I try to enable the 'HTTPS' option in settings.js

Error loading settings file: /data/settings.js  
Error: ENOENT: no such file or directory, open '/home/user/Certificates/key.pem'  
at Object.openSync (node:fs:585:3)  
at Object.readFileSync (node:fs:453:35)  
at Object. (/data/settings.js:94:26)  
at Module.\_compile (node:internal/modules/cjs/loader:1105:14)  
at Object.Module.\_extensions..js (node:internal/modules/cjs/loader:1159:10)  
at Module.load (node:internal/modules/cjs/loader:981:32)  
at Function.Module.\_load (node:internal/modules/cjs/loader:822:12)  
at Module.require (node:internal/modules/cjs/loader:1005:19)  
at require (node:internal/modules/cjs/helpers:102:18)  
at Object. (/usr/src/node-red/node\_modules/node-red/red.js:140:20) {  
errno: -2,  
syscall: 'open',  
code: 'ENOENT',  
path: '/home/user/Certificates/key.pem'

Steps completed so far

1. Ensure directory and file exists (cat /home/user/Certificates/key.pem)
2. Permissions (chmod 777)
3. Absolute and relative paths
4. Different folders
5. File renames

---

<div class="post-metadata">

### Author: ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)
#### Post date: [20 March 2023 16:10 UTC](https://discourse.nodered.org/t/nodered-enoent-error-when-trying-to-reading-the-certificate-files/76754/2 "2023-03-20T16:10:46Z")

</div>

Please stop and start NR and then copy and paste the output from the start command to the line where it says:  
`6 Mar 16:34:42 - [info] Started flows`  
(and your date and time will be different)

It NR really running under the user 'user'?

---

<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: [20 March 2023 16:24 UTC](https://discourse.nodered.org/t/nodered-enoent-error-when-trying-to-reading-the-certificate-files/76754/3 "2023-03-20T16:24:21Z")

</div>

Also, is this a Docker install? If so, code running inside the docker container can only see those parts of the host file system that are made available to it, so by default it will not be able to see the users home folder

---

<div class="post-metadata">

### Author: ![rahul.abraham](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@rahul.abraham](https://discourse.nodered.org/u/rahul.abraham)
#### Post date: [21 March 2023 10:58 UTC](https://discourse.nodered.org/t/nodered-enoent-error-when-trying-to-reading-the-certificate-files/76754/4 "2023-03-21T10:58:05Z")

</div>

Please see the attached.

I've relocated the certificates inside the \_data folder and is running the container from the root user(for validation)

 ![Node](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/0/b0611c94dfdac412b8d934e91efeff5a1003d45c.jpeg)

---

<div class="post-metadata">

### Author: ![rahul.abraham](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@rahul.abraham](https://discourse.nodered.org/u/rahul.abraham)
#### Post date: [21 March 2023 10:58 UTC](https://discourse.nodered.org/t/nodered-enoent-error-when-trying-to-reading-the-certificate-files/76754/5 "2023-03-21T10:58:57Z")

</div>

Yes, it's a docker install. I moved the files inside the \_data folder and still get the same error.

---

<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: [21 March 2023 11:12 UTC](https://discourse.nodered.org/t/nodered-enoent-error-when-trying-to-reading-the-certificate-files/76754/7 "2023-03-21T11:12:26Z")

</div>

You have to refer to it by its location within the docker environment, not the location from the external environment.  
Since you don't seem to know a great deal about docker are you sure you want to use it? It is often much simpler to do a native install of node-red rather than a Docker install, as you are finding out.

---

<div class="post-metadata">

### Author: ![rahul.abraham](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@rahul.abraham](https://discourse.nodered.org/u/rahul.abraham)
#### Post date: [21 March 2023 11:26 UTC](https://discourse.nodered.org/t/nodered-enoent-error-when-trying-to-reading-the-certificate-files/76754/8 "2023-03-21T11:26:18Z")

</div>

Unfortunately not ☹

---

<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: [21 March 2023 11:29 UTC](https://discourse.nodered.org/t/nodered-enoent-error-when-trying-to-reading-the-certificate-files/76754/9 "2023-03-21T11:29:58Z")

</div>

Where have you put them relative to where settings.js is? You can see in the log that this is referenced by /data/settings.js.

---

<div class="post-metadata">

### Author: ![rahul.abraham](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@rahul.abraham](https://discourse.nodered.org/u/rahul.abraham)
#### Post date: [21 March 2023 11:55 UTC](https://discourse.nodered.org/t/nodered-enoent-error-when-trying-to-reading-the-certificate-files/76754/10 "2023-03-21T11:55:45Z")

</div>

In the same folder - /var/lib/docker/volumes/node\_red\_data/\_data/

 ![Node](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/3/a3172800f6d3c0de71d194077a487afea65f16c5.jpeg)

---

<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: [21 March 2023 11:59 UTC](https://discourse.nodered.org/t/nodered-enoent-error-when-trying-to-reading-the-certificate-files/76754/11 "2023-03-21T11:59:38Z")

</div>

Please don't post screenshots, copy/paste instead, it is much easier to read.

Well if it is in that folder then, since settings is /data/settings.js (as you can see from the log) then presumabley it is /data/whatever-it-is-called.

---

<div class="post-metadata">

### Author: ![rahul.abraham](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@rahul.abraham](https://discourse.nodered.org/u/rahul.abraham)
#### Post date: [21 March 2023 12:17 UTC](https://discourse.nodered.org/t/nodered-enoent-error-when-trying-to-reading-the-certificate-files/76754/12 "2023-03-21T12:17:58Z")

</div>

That did the trick!

I had it `/_data/` instead of `/data`

As you said, I presume the absolute path is outside the container environment!

Thank you soo much 🙂

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [4 April 2023 12:18 UTC](https://discourse.nodered.org/t/nodered-enoent-error-when-trying-to-reading-the-certificate-files/76754/13 "2023-04-04T12:18:44Z")

</div>

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