Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User data not being stored in mounted /data directory #70

Closed
5 tasks done
jhelmink opened this issue Apr 4, 2018 · 8 comments
Closed
5 tasks done

User data not being stored in mounted /data directory #70

jhelmink opened this issue Apr 4, 2018 · 8 comments

Comments

@jhelmink
Copy link

jhelmink commented Apr 4, 2018

What are the steps to reproduce?

Mount /data directory to external volume.
Use the --user myLocalUserName parameter so that container has permission to read/write to the external volume. (Container will not launch without this)

From the log the command lines used are;

node-red-docker@1.0.0 start /usr/src/node-red
node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/data" "--user" "myLocalUserName"

Where the environment variable $FLOWS is just the default flows.json

What happens?

See in the log that a user directory is created and my settings and flows are stored there;
4 Apr 06:34:50 - [info] Settings file : /usr/src/node-red/myLocalUserName/settings.js
4 Apr 06:34:50 - [info] User directory : /usr/src/node-red/myLocalUserName
4 Apr 06:34:50 - [info] Flows file : /usr/src/node-red/myLocalUserName/flows.json
However there is nothing stored in the mounted /data directory.

What do you expect to happen?

That the user directory and/or data would appear in the mounted /data directory and therefore my settings and flows would be external to the container, so could be backed up and survive container upgrades etc.

Please tell us about your environment:

  • Node-RED version: 4 Apr 06:34:48 - [info] Node-RED version: v0.18.4
  • node.js version: 4 Apr 06:34:48 - [info] Node.js version: v8.10.0
  • npm version: unknown
  • Platform/OS: Synology Docker (DSM 6.1.6-15266)
  • Browser: Chrome (latest)
@jhelmink jhelmink mentioned this issue Aug 29, 2018
@codegrau
Copy link

codegrau commented Sep 7, 2018

Would be great to see a solution to this issue.

@alexsahka
Copy link

Same problem.

@drcobra
Copy link

drcobra commented Feb 6, 2019

I think there is a bug.

When you place the required files in the /data directory the docker will automatically assign them to user 1001 instead of the user you define at -e PUID=1000 -e PGID=100. In this example the user is the 1000. To find your user UID type id <<username>>.

Temporary solution: You have to change permissions of the mounted folder to 777, so other users can write to it chmod 777 /path/to/the/mound/. For security reasons, it should not be a permanent solution.

Similar to #82 I think.

@jhelmink
Copy link
Author

@drcobra unfortunately using Synology Docker which is all UI based. Reluctant to SSH into the box to make this permissions change if I can avoid it. Makes sense that the PUID/PGID environment variables are not being honoured like most other containers which is causing the issue.

@jhelmink
Copy link
Author

jhelmink commented Sep 18, 2019

A workaround update for anyone else that finds this.
I was able to modify the permission on my docker\node-red\data folder through the UI.
Setting the permissions for this folder so Everyone has read/write access.
Then I did not need to specify --user myLocalUserName
Node Red was able to write to the container volume as normal with default settings.

@alexsahka
Copy link

alexsahka commented Sep 18, 2019

I fixed this by running Portainer container under Synology Docker, and then I modify user = root, but this only available under Portainer UI. I can't find these options under Synology Docker UI.
image

@RaymondMouthaan
Copy link
Contributor

Node-RED 1.0.0 is now available on docker hub - https://hub.docker.com/r/nodered/node-red.

This closes this issue.

There are a few changes to the new release, please read the README for further details.

However Synology Docker UI does not allow you to add the --user option to start node-red with a different uid:gid. Like @alexsahka purpose, with portainer you can or start node-red from the synology command line using ssh.

@unholyhimura
Copy link

unholyhimura commented Sep 26, 2020

Hello, to solve the issue it's possible to change the folder permission using SSH. Here is a small guide on how to do it on Synology NAS:
https://www.atomicha.com/synology-nas-docker-installing-node-red-part-4-persistent-volume-optional-advanced/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants