mindsphere / node-red-contrib-mindconnect

Node-RED Agent for the MindConnect API (community driven project)
https://opensource.mindsphere.io/docs/node-red-contrib-mindconnect/index.html
MIT License
48 stars 1 forks source link

Error: EROFS: read-only file system, mkdir '//.mc/' #173

Open nehemiascr opened 1 year ago

nehemiascr commented 1 year ago

Describe the bug I am trying to configure MindConnect Node-RED Agent v3.12.1 node installed in Node-RED v2.2.3 on IOT2050 Debian Example Image build V01.03.01 In this build of the IOT2050 Image, the filesystem of / is a read-only filesystem of type squashfs

root@iot2050-debian:/home/root# df -Th
Filesystem             Type      Size  Used Avail Use% Mounted on
udev                   devtmpfs  952M     0  952M   0% /dev
tmpfs                  tmpfs     500M  1.6M  499M   1% /run
/dev/mmcblk0p4         squashfs  911M  911M     0 100% /
/dev/disk/by-label/var ext4      638M  369M  223M  63% /var
overlay                overlay   638M  369M  223M  63% /etc
tmpfs                  tmpfs     967M     0  967M   0% /dev/shm
tmpfs                  tmpfs     5.0M     0  5.0M   0% /run/lock
tmpfs                  tmpfs     500M  4.0K  500M   1% /tmp
/dev/mmcblk0p7         ext4       21G  137M   19G   1% /home
tmpfs                  tmpfs     194M  8.0K  194M   1% /run/user/108
tmpfs                  tmpfs     194M  4.0K  194M   1% /run/user/0

This is causing the error Error: EROFS: read-only file system, mkdir '//.mc/'

mindconnect-EROFS-error

To Reproduce Steps to reproduce the behavior:

  1. Go to the Mindconnect node, paste your onboarding configuration from Mindsphere
  2. Deploy
  3. See error

Expected behavior Mindconnect onboarding should succeed

Desktop (please complete the following information):

MindSphere Plan

nehemiascr commented 1 year ago

As a workaround from this comment https://github.com/mindsphere/node-red-contrib-mindconnect/issues/150#issuecomment-1047828633, I was able to change the default location to a writable folder from basePath: string | IConfigurationStorage = process.cwd() + "/.mc/" to basePath: string | IConfigurationStorage = "/home/root/.mc/"

fmoessbauer commented 1 year ago

All library data / state has to be stored in userDir, but not in the CWD: https://nodered.org/docs/user-guide/runtime/configuration

In general, state has to be stored either in /var or in /home/<user>. When starting node-red without arguments, the userDir points to $HOME/.node-red, which is a valid directory.