Node-red does not run on IoT Edge module on a Windows device

Hi there,

I am trying to deploy node-red on IoT edge device installed on Windows device (bash).

IoT edge device is succesfully installed on Windows device following the manual from Microsoft.

On my IoT edge device I am trying to deploy node-red similar to Raspberry Pi as discussed here.

I already had problem when deploying on Raspberry Pi and solved it with the help of the community: here, you will also find my old question on stackoverflow.
The error is similar, so I thought the problem might be in

  "Binds": [
        "/node-red:/data"
    ],

which I changed to

"Binds": [
            "/home/iotedge-user/node-red:/data"
        ],

(in the case of Raspberry Pi instead of iotedge-user was pi).
And I still have this error logs:

Error: EACCES: permission denied, lstat '/data/settings.js'
    at Object.lstatSync (node:fs:1529:3)
    at Object.lstatSync (/usr/src/node-red/node_modules/graceful-fs/polyfills.js:318:34)
    at statFunc (/usr/src/node-red/node_modules/fs-extra/lib/util/stat.js:24:20)
    at getStatsSync (/usr/src/node-red/node_modules/fs-extra/lib/util/stat.js:27:16)
    at Object.checkPathsSync (/usr/src/node-red/node_modules/fs-extra/lib/util/stat.js:67:33)
    at Object.copySync (/usr/src/node-red/node_modules/fs-extra/lib/copy/copy-sync.js:27:38)
    at Object.<anonymous> (/usr/src/node-red/node_modules/node-red/red.js:129:20)
    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) {
  errno: -13,
  syscall: 'lstat',
  code: 'EACCES',
  path: '/data/settings.js'
}

Here is the system information:

Icon name: computer-vm
         Chassis: vm đź–´
      Machine ID: e32db979ebe04313a64c390f6d3b20d7
         Boot ID: 6c5236241c5b4a799fef72c6d9d1724a
  Virtualization: microsoft
Operating System: CBL-Mariner/Linux
          Kernel: Linux 5.15.67.1-4.cm2
    Architecture: x86-64
 Hardware Vendor: Microsoft Corporation
  Hardware Model: Virtual Machine

The docker image for the node-red: nodered/node-red:latest as in Raspberry Pi ARM32v7.

Let's find out the issue together :slight_smile:

Never used Azure IoT Edge but it says that the modules are Docker compatible containers. So if you want to run on a Windows host, I'm guessing that the container will be a Windows container not a Linux one and if so, you would need to build your own custom Windows node-red container?

Here they say that Azure IoT Edge for Linux on Windows (EFLOW) allows you to run containerized Linux workloads alongside Windows applications in Windows deployments.
So as far as I understand it is a virtual machine on Windows. I managed to deploy two containers: one with edgeHub and the other with edgeAgent. However, it does not work for the node-red.

OK, my assumption was wrong then. Couldn't tell from a quick view and that seemed like a possibility.

Can you get a remote shell to the node-red container? If so, you can check the permissions for the data container directly.

Answered on Stack Overflow here

1 Like

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