node-red / node-red-docker

Repository for all things Node-RED and Docker related

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EACCES: permission denied, open '/data/.config.json'

scottsweb opened this issue · comments

Trying to get node-red up and running on my Raspberry Pi. The docker command I am using is:

docker run -it -p 1880:1880 --restart=always --name="nodered" -v /media/data/node-red/:/data -e FLOWS=flows.json nodered/node-red-docker:rpi

Full log output is:

npm info it worked if it ends with ok
npm info using npm@2.15.1
npm info using node@v4.4.4
npm info prestart node-red-docker@0.14.6
npm info start node-red-docker@0.14.6

> node-red-docker@0.14.6 start /usr/src/node-red
> node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/data"



Welcome to Node-RED
===================

12 Sep 21:00:37 - [info] Node-RED version: v0.14.6
12 Sep 21:00:37 - [info] Node.js  version: v4.4.4
12 Sep 21:00:37 - [info] Linux 4.4.13-v7+ arm LE
12 Sep 21:00:37 - [info] Loading palette nodes
{ [Error: EACCES: permission denied, open '/data/.config.json']
  errno: -13,
  code: 'EACCES',
  syscall: 'open',
  path: '/data/.config.json' }
12 Sep 21:00:45 - [info] Server now running at http://127.0.0.1:1880/
12 Sep 21:01:59 - [error] Node-RED runtime not started
^C12 Sep 21:02:18 - [info] Stopping flows

/media/data/node-red contains a settings.js file and a flows.json file too, any ideas what might be causing this permissions problem?

do the permissions on the host side allow that docker user access ?

I'm having trouble replicating your user error locally, using the following command.

docker run -it -p 1880:1880 --restart=always --name="nodered" -v /tmp/node-red/:/data -e FLOWS=flows.json nodered/node-red-docker:rpi

My NR instance starts and is usable without seeing the error you encountered above.

Can you try @dceejay's suggestion about checking the user perms?

We have published an update to the Docker images today that means you don't actually need to use volumes to persist user data. There's more details in the updated README.
If you drop the -v /media/data/node-red/:/data parameters I'm assuming it works?

Thanks for the tips. Removing -v /media/data/node-red/:/data does indeed work.

It turns out that the vfat partition was not writeable by anything other than my user (my user also runs docker). Fixed that (added a umask in /etc/fstab) and Node-RED now starts correctly. Interestingly other container types could write logs etc without issue.

can anyone share an example of the configuration on the umask entry?

@StuckInLoop my /etc/fstab has the following entry:

UUID=XXXX /media/data vfat auto,nofail,noatime,users,rw,uid=pilot,gid=pilot,umask=000 0 0

You will need to add the UUID of your media in place of XXXX