node-red / node-red-docker

Repository for all things Node-RED and Docker related
Apache License 2.0
469 stars 382 forks source link

I'm not able to create mountpath: /data #413

Closed Visheshpapreja closed 4 months ago

Visheshpapreja commented 4 months ago

Hello,

I hope you are doing well!!

I have encountered an issue with the Helm chart YAML file for our web application named Node-Red. The application comprises two services: one secured with IAP (Identity-Aware Proxy) and the other accessible via VPN for the dashboard. While I have successfully created the services, I am currently facing a challenge with the configuration of the mount path.

The Persistent Volume Claim (PVC) is being created successfully, but the problem arises when configuring the mount path as "/data." The specific issue is related to permission denial during the copy process, manifesting as the following error: Error: EACCES: permission denied, copyfile '/usr/src/node-red/node_modules/node-red/settings.js' -> '/data/settings.js' at Object.copyFileSync (node:fs:2847:3) at copyFile (/usr/src/node-red/node_modules/fs-extra/lib/copy/copy-sync.js:64:6) at onFile (/usr/src/node-red/node_modules/fs-extra/lib/copy/copy-sync.js:50:25) at getStats (/usr/src/node-red/node_modules/fs-extra/lib/copy/copy-sync.js:42:44) at Object.copySync (/usr/src/node-red/node_modules/fs-extra/lib/copy/copy-sync.js:32:10) at Object. (/usr/src/node-red/node_modules/node-red/red.js:129:20) at Module._compile (node:internal/modules/cjs/loader:1198:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10) at Module.load (node:internal/modules/cjs/loader:1076:32) at Function.Module._load (node:internal/modules/cjs/loader:911:12) { errno: -13, syscall: 'copyfile', code: 'EACCES', path: '/usr/src/node-red/node_modules/node-red/settings.js', dest: '/data/settings.js' } This error suggests that there are permission constraints preventing the application from copying the settings file to the intended destination ("/data/settings.js"). also I tired with all the possible ways gave the permissions and all. I am seeking assistance in resolving this matter to ensure proper configuration and functionality of the Node-Red application.

Your guidance and support in overcoming this challenge would be greatly appreciated.

Thanks & Regards Vishesh Paperaja

hardillb commented 4 months ago

What ever you mount on /data needs to be writeable by the node-red user uid which defaults to 1000

Visheshpapreja commented 4 months ago

spec: securityContext: runAsUser: 1000 runAsGroup: 1000 # Replace with the desired user ID runAsRoot: true

    I tried with this
hardillb commented 4 months ago

The problem will be with the PV not being writeable by that uid, not the uid of the user in the container.

We can't help you with how the PV works, because we know nothing about it.

Visheshpapreja commented 4 months ago

But really appreciate your prompt response Thank you