Code Monkey home page Code Monkey logo

node-red-docker's Introduction

Node-RED

https://nodered.org

Build Status

Low-code programming for event-driven applications.

Node-RED: Low-code programming for event-driven applications

Quick Start

Check out https://nodered.org/docs/getting-started/ for full instructions on getting started.

  1. sudo npm install -g --unsafe-perm node-red
  2. node-red
  3. Open http://localhost:1880

Getting Help

More documentation can be found here.

For further help, or general discussion, please use the Node-RED Forum or slack team.

Developers

If you want to run the latest code from git, here's how to get started:

  1. Clone the code:

     git clone https://github.com/node-red/node-red.git
     cd node-red
    
  2. Install the node-red dependencies

     npm install
    
  3. Build the code

     npm run build
    
  4. Run

     npm start
    

Contributing

Before raising a pull-request, please read our contributing guide.

This project adheres to the Contributor Covenant 1.4. By participating, you are expected to uphold this code. Please report unacceptable behavior to any of the project's core team at [email protected].

Authors

Node-RED is a project of the OpenJS Foundation.

It is maintained by:

Copyright and license

Copyright OpenJS Foundation and other contributors, https://openjsf.org under the Apache 2.0 license.

node-red-docker's People

Contributors

dceejay avatar dschmidt avatar etienne-goumet avatar garethcmurphy avatar greenkeeper[bot] avatar greenkeeperio-bot avatar hardillb avatar jthomas avatar knolleary avatar maxvram avatar michaelleehobbs avatar moolbits avatar natcl avatar noderedbot avatar raymondmouthaan avatar takuya-o avatar vielmetti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-red-docker's Issues

synology folder mount problem

hi,
i am very new to docker world
I run docker on my Synology and I deploy this image without mounting folder in Synology and it works.
But I don't have access to the files in the container and any problem I have I need to reinstall.

i want to use, the Synology to mount option and link the folder in my nas so it will be the /data folder.
If I put /data as the mount path the container dosent start.

Any help on what to do?

Builtin twitter node is outdated

Respecting Twitter's recent API changes/limitations, node-red-node-twitter has published version 1.0.1 lately. https://www.npmjs.com/package/node-red-node-twitter
The node-red docker container still installs version 0.1.15, which cannot be upgraded via the "Manage palette" menu, since it is builtin.

What are the steps to reproduce?

Download the image, start the container. Look in the "Manage Palette" menu, the twitter node shows up as 0.1.15

What do you expect to happen?

Two possible solutions:

  • The docker image is updated with Twitter node 1.0.1 or
  • completely remove the Twitter node, so it is installable and upgradeable via the "Manage Palette" menu

Please tell us about your environment:

I am using the latest image by the time of writing this issue. This is node-red v0.18.7. OS is Arch Linux, Browser is Google Chrome.

Raspberry install breaks

I'm trying to get this running on my Raspberry Pi 3 running OSMC.
It took me literally hours to get here (You guys should really improve the README. If you don't have docker experience you don't understand what $ docker build -f <version>/Dockerfile -t mynodered:<version> . should be!). What I've done now:

  • git clone this repo, cd into it and run docker build -f rpi/Dockerfile -t nodered/node-red-docker:rpi .
    But now I'm getting:

npm info lifecycle [email protected]~install: [email protected]

[email protected] install /usr/src/node-red/node_modules/bcrypt
node-pre-gyp install --fallback-to-build

The command '/bin/sh -c npm install' returned a non-zero code: 1

[warn] Cannot find Pi RPi.GPIO python library

Hi,

when I try to run the node-red-docker rpi image, there's the following warning in the log:

18 Jun 18:07:18 - [warn] Cannot find Pi RPi.GPIO python library
18 Jun 18:07:21 - [warn] ------------------------------------------------------
18 Jun 18:07:21 - [warn] [rpi-gpio] Warning : Cannot find Pi RPi.GPIO python library
18 Jun 18:07:21 - [warn] ------------------------------------------------------

How is it possible to enable GPIO library, as I want to use node-red to interact with the gpio of the raspberry?

Thanks,
Diego

Unable to install/use node-red-admin

What are the steps to reproduce?

Install the NodeRED docker image on a Synology DS718+ (NAS) using the Docker-application that comes with the Synology NAS. Open a bash-terminal from within the container and try running "npm install -g node-red-admin"

What happens?

It will output some errors because it doesn't have sufficient rights to /usr/local/lib/node_modules.
When trying to sudo the npm install command it cannot find sudo.
My data-folder is located and accessible on the NAS, NodeRED is able to read/write from/in this location.

What do you expect to happen?

I would expect it to install node-red-admin on my docker NodeRED installation.

Please tell us about your environment:

  • Node-RED version: v. 0.19.4
  • node.js version: v. 6.14.4
  • npm version: v. 3.10.10
  • Platform/OS: Synology DSM 6.2.1-23824
  • Browser: Firefox 62.0.3 (64-bit), running on Windows 10

Docker volume mapped /data volume uses irritating UID/GID

I have a server with a few containers, most I can configure the UID/GID of the container's run user using environment variables PUID and PGID (or advertise another variable for this purpose).

The node-red container runs as a user with UID 1001 which maps on my host to a user with another purpose. Docker seems to have little support for addressing this issue.

Is there a method to force the UID of the container to another number?

Copy flows.json and settings.js directly into the container

Hi everyone,

I would like to know if it's possible to COPY directly the flows.json and settins.js files during build time. In this way, I'm not dependent on the file system and the container self-hosts all the files needed.

Is there a way to do it?

Many thanks,
Diego

Container attachment gets interrupted.

I was attached to my Node-RED container using docker attach --sig-proxy=false when the following error printed out and the attachment broke, returning me to prompt:

/usr/local/bin/node[17]: ../src/node_buffer.cc:752:void node::Buffer::ReadFloatGeneric(const v8::FunctionCallbackInfov8::Value&) [with T = float; node::Endianness endianness = (node::Endianness)0u]: Assertion `(offset + sizeof(T)) <= (ts_obj_length)' failed.
1: node::Abort() [node-red]
2: node::Assert(char const* const () [4]) [node-red]
3: void node::Buffer::ReadFloatGeneric<float, (node::Endianness)0>(v8::FunctionCallbackInfov8::Value const&) [node-red]
4: v8::internal::FunctionCallbackArguments::Call(void (
)(v8::FunctionCallbackInfov8::Value const&)) [node-red]
5: 0x9ec66e [node-red]
6: 0x9ecf0e [node-red]
7: 0x28ed6a8060c7
Aborted (core dumped)

npm info lifecycle [email protected]~start: Failed to exec start script
npm ERR! Linux 4.4.0-81-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" "--" "--userDir" "/data"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/data"
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the [email protected] start script 'node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/data"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-red-docker package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/data"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-red-docker
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls node-red-docker
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /usr/src/node-red/npm-debug.log

At first I thought the container had crashed, but after checking I saw it was still running, I could connect to it and all the flows were working properly. After some more testing I discovered this only happens after being attached to the container for three to four minutes. This doesn't impact the performance of the container at all and is only mildly inconvenient, but I have absolutely no idea what's going on and I'd like to fix it if possible.

Thank you for the help.

Unable to login from domain

  • Node-RED version: 0.19.4
  • node.js version: 6.14.4
  • npm version: 3.10.10
  • Platform/OS: Synology DSM 6.2-23739 update 2
  • Browser: Firefox (latest), Google Chrome, Safari mobile, Microsoft Edge

Dear community, developers,

I’ve installed the Docker image of NodeRED on my Synology DS 718+, I’ve enabled login. Whenever I’m using my local IP-address, I’ll get a login screen and can login. Whenever I enable port forwarding and try to login from my domain (domain.xxx:1880), I’ll get the login-screen but after each login attempt I’m transferred to the login again. This behavior is on all mentioned browsers (Windows 10) except Safari mobile that is running on my iPhone. With login disabled NodeRED is running fine locally and from the domain. Any idea or suggestion?

Unable to install node-red-admin

I cannot install node-red-admin because node-red user is not owner of /usr/local/lib/node_modules :

npm ERR! Linux 4.9.35-v7+ npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "node-red-admin" npm ERR! node v6.11.0 npm ERR! npm v3.10.10 npm ERR! path /usr/local/lib/node_modules npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall access npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules' npm ERR! at Error (native) npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules' npm ERR! at Error (native) npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'access', npm ERR! path: '/usr/local/lib/node_modules' } npm ERR! npm ERR! Please try running this command again as root/Administrator. npm ERR! Please include the following file with any support request: npm ERR! /usr/src/node-red/.node-gyp/6.11.0/npm-debug.log

and the directory is owned by 1001:1001

$ ls -ltra /usr/local/lib/node_modules total 12 drwxr-xr-x 3 1001 1001 4096 Jul 18 20:33 . drwxr-xr-x 11 1001 1001 4096 Jul 18 20:33 npm drwxr-xr-x 4 1001 1001 4096 Jul 18 20:33 ..

but node-red user is 1000:1000

$ id node-red uid=1000(node-red) gid=1000(node-red) groups=1000(node-red)

and I cannot sudo because it asks for a password that I don't know.

$ sudo su - We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. [sudo] password for node-red: Sorry, try again.

I'm using nodered/node-red-docker:rpi

Timezones

I am running the image in Docker on a Synology Diskstation and it shows UTC timezone instead of the local one. Unlike the internet suggests, setting the environment variable TZ does not change anything. Is TZ not supported?

suggestion: install CLI text editor

I'd like to suggest installing a CLI text editor like nano or vim as part of this docker image.
This would make it more straight-forward to change the settings.js file inside the container e.g.

Running in AWS, best practise for settings.js changes?

This is not solely for AWS I guess but what would be the best approach for changing server settings(.js) after deployment in runtime?

  1. Change settings locally, rebuild Docker container and redeploy?
  2. Access running server(s) and change in "runtime" and change in local Docker container for next deploy?

#2 is, of course, better from a downtime perspective but it doesn't feel "right" to change in a running container/server...

Also, is there any "runtime change" API/SDK planned for node-red that you would know of (to be able to change settings without changing settings.js)?

MQTT node connection error since version 0.17

I've had a Node-Red instance deployed with Docker for months now, and a separate Mosquitto Docker container. All the node-red-docker versions since 0.17 give me a persistent error on Node-Red's MQTTnodes when it tries to connect to Mosquitto. It doesn't work with neither my deployed container, nor the the public iot.eclipse.org one. This error does not exist when I roll back to version 0.16.2. The configuration of the mqtt nodes, the Mosquitto container and the Node-Red container on my part are the same.

Node-Red's output when it tries to connect to Mosquitto:

10 Jul 06:57:17 - [info] Starting flows
10 Jul 06:57:17 - [debug] red/nodes/flows.start : starting flow : global
10 Jul 06:57:17 - [debug] red/nodes/flows.start : starting flow : b8183da5.b7a0d
10 Jul 06:57:17 - [debug] red/nodes/flows.start : starting flow : 74a79f12.b7e46
10 Jul 06:57:17 - [debug] red/nodes/flows.start : starting flow : 97581168.06c34
10 Jul 06:57:17 - [debug] red/nodes/flows.start : starting flow : 778ebfa1.31277
10 Jul 06:57:17 - [info] [inject:6c5e27a3.74c0f8] repeat = 6000
10 Jul 06:57:17 - [info] [inject:Check Gateway status] repeat = 31000
10 Jul 06:57:17 - [info] [python-function:c7430adf.cbdd58] Python function '' running on PID 32
10 Jul 06:57:17 - [info] Started flows

Mosquitto's output when it receives the connection:

10 Jul 06:57:17 - New connection from 100.64.144.1 on port 8883.
10 Jul 06:57:17 - New connection from 172.17.0.1 on port 8883.
10 Jul 06:57:17 - Socket error on client <unknown>, disconnecting.
10 Jul 06:57:17 - Socket error on client <unknown>, disconnecting.

As you can see, I don't have much to go on with, and the error is version dependent, so I'm counting on getting some help from you.

Thank you for your time.

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • The engines config in 1 of your package.json files was updated to the new Node.js version

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

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

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 [email protected]
npm info using [email protected]
npm info prestart [email protected]
npm info start [email protected]

> [email protected] 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?

'Input:inject' of type 'Repeat - at a specific time' not working

I think, in order for 'Input:inject' of type 'Repeat - at a specific time' (Time-of-Day) to work, 'cron' needed to be installed inside the docker.
I had to add in the Dockerfile the following line
'RUN apt-get install -y cron'

I'm using the Node-RED container to control many switches at specific times; for eg:- turn on/off FishTank light.

$ docker run -it --rm hypriot/rpi-node:4 bash
root@44b3c8a909c0:/# cron
bash: cron: command not found
root@44b3c8a909c0:/#

Different installation of Node-RED on Raspbian Jessie

Hi everyone,

I'm trying to understand why the Node-RED installation that comes with the Raspbian Jessie OS has differences with the version you ship on Docker.
The first difference I can see is that on Raspbian there are more nodes available, i.e. "Watson IoT", "serial", "play audio", "smooth", but it doesn't have "base64", "msgpack", "sunrise" nodes that are available on the Docker version
For the Raspberry Pi specific nodes, the version on Raspbian has "ledborg" and "sensehat" that are not available on Docker.
Also the network node "ping" is available only on Raspbian.

Is it possible to provide the same user experience that is available on the base Raspbian?

Also the paths are different, the flows file is different and so on.

I would like to have also an interface for XBee, but my requirement maybe works just for me.

Thanks,

Diego

broaken link in README.md

Minor issue, here's a patch:

--- README.md   2017-11-15 15:48:31.900360101 +0000
+++ newREADME.md        2017-11-15 15:55:26.536865287 +0000
@@ -4,7 +4,7 @@

 This project describes some of the many ways Node-RED can be run under Docker.
 Some basic familiarity with Docker and the
-[Docker Command Line](https://docs.docker.com/reference/commandline/cli/)
+[Docker Command Line](https://docs.docker.com/engine/reference/commandline/cli/)
 is assumed.

 This project also provides the build for the `nodered/node-red-docker`

can not pass through /dev/tty* to docker image

using --device=/dev/ttyACM0 on docker commandline....
the "serial in" node cannot connect due to Permisson error - from the log in th edocker:

[error] serial port /dev/ttyACM0 error: Error: Error: Permission denied, cannot open /dev/ttyACM0

It may be due to user node-red not having access to /dev/
I have tried editing the Dockerfile to remove USER node-red (to run Node-Red as root but serial then produces these errors (on LATEST docker - not RPI):

[warn] [serialport] Error: Could not locate the bindings file. Tried:
→ /usr/src/node-red/node_modules/node-red/node_modules/node-red-node-serialport/node_modules/serialport/build/serialport.node
→ /usr/src/node-red/node_modules/node-red/node_modules/node-red-node-serialport/node_modules/serialport/build/Debug/serialport.node
→ /usr/src/node-red/node_modules/node-red/node_modules/node-red-node-serialport/node_modules/serialport/build/Release/serialport.node
→ /usr/src/node-red/node_modules/node-red/node_modules/node-red-node-serialport/node_modules/serialport/out/Debug/serialport.node
→ /usr/src/node-red/node_modules/node-red/node_modules/node-red-node-serialport/node_modules/serialport/Debug/serialport.node
→ /usr/src/node-red/node_modules/node-red/node_modules/node-red-node-serialport/node_modules/serialport/out/Release/serialport.node
→ /usr/src/node-red/node_modules/node-red/node_modules/node-red-node-serialport/node_modules/serialport/Release/serialport.node
→ /usr/src/node-red/node_modules/node-red/node_modules/node-red-node-serialport/node_modules/serialport/build/default/serialport.node
→ /usr/src/node-red/node_modules/node-red/node_modules/node-red-node-serialport/node_modules/serialport/compiled/4.6.0/linux/x64/serialport.node

Any idea how I can get a serial pass through to work on the official Docker image (it works on my unofficial version)

Wrong timezone

Greetings!
I have problem with node-red.
I have tried to change timezone in node red but nothing works.
I am running node red on synology NAS.

Node-RED Admin Tool installation.

Hi,
When trying to install the Admin Tool (npm install -g node-red-admin) root required, but sudo is not working.
Can you tell me please, what Im doing wrong.

issue with following the instructions in the README.md and using the `USER` command in the Dockerfile

Hi.

I wanted to start using node-red with extra custom "contrib" nodes via Docker.
Initially I followed the instructions in the README for the "Host Directory As Volume" mode, but was unable to get this working.
Specifically, node-red loaded correctly but I got a runtime error when clicking "Deploy" because node-red was unable to persist to the flows.json file due to a linux permission issue.

ctuvqqqwiaap2dw

Eventually I was able to get this working correctly and persisting flows.json by using the docker run --user flag (see relevant Docker docs).
I thought I'd open an issue because maybe other users encountered this problem and perhaps this clarification should be a part of the README.

I'm just starting out with Docker, but here's my understanding of the problem & fix:

  • When you use the USER command in the Dockerfile (as the case in this project) it creates a new user with a new userid and performs the remaining instructions as that user
  • If there was no prior USER command, the userid will probably be 1000 but Docker doesn't guarantee what the generated userid would be so it's discouraged to rely on this
  • The /data folder will be owned by the user with that userid
  • If you try to map the container's /data directory to a directory on the host, that external directory and its contents will probably be owned by a user with a different userid than the one used by the container
  • Only if by some chance it's the same userid (which could happen if both users are the first users created on the server and both have userid 1000) then this would work correctly.
  • In other cases where the userid does not match, a permission issue would prevent node-red from successfully persisting flows.json
  • You can fix this by using the --user flag of the docker run command (or the user property if you're using docker-compose) that lets you pass the host's userid so that the USER command will use that userid instead of creating a new one. This will make the userids match and will fix the permission issue.

Would be happy to send a PR but figured I'd first reach out to get feedback, and to have one else verify this is not just a local issue caused by my configuration.

Thanks.

Image architecture for Pi is incorrect

I am having trouble using the rpi Docker image in a Docker Stack deployment. When running as a stack, the service reports that the container is trying to run as amd64. However, when running as a standalone service, it works fine.

I did a bit of digging and found that the results of docker image inspect --format '{{.Architecture}}' nodered/node-red-docker:rpi report amd64 instead of arm as I'd expect. After some research, I think the only way to avoid this and to properly annotate the image as arm is to build the rpi image on an ARM device and push it to Docker Hub.

Is it possible that the rpi image can be pushed via a ARM-based device to properly tag the arch for the image as arm?

Update Node to v6 (or 8 ???) on aarch64

On aarch64, the version provided still pulls in Node 4, instead of Node 6 like all the rest.

It should be a simple one-line fix to the FROM line in the Dockerfile, but there's a small snag in Node version naming at Docker hub. I don't want to pull in some specific point release of Node, just whatever is latest for 6.

See tianon/jenkins-groovy#21 for the naming issue on Docker hub, and when it gets resolved this will be very easy to resolve as well.

Can't see all tags on Synology

I'm not sure if it's a bug with the Synology OS or a quirk with Docker's registry hub but I can only see the 0.14.5 and 0.14.5-slim tags when I try to install Node-RED from Synology, see image:
capture

node-red-admin blocked by proxy

Hi

As per your README I've installed node-red-admin on the host OS using npm with proxy config and it can see the container's nodes fine on localhost:1880

The issue is when I go to search or install, it comes up with:

$ node-red-admin target
Target: http://localhost:1880

$ node-red-admin search node-red-contrib-soap
Error: tunneling socket could not be established, cause=write EPROTO 140418686146624:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:794:```

Use adminAuth; login failed

Hi,

(I am new to docker and node red so forgive me f I ask stupid questions)

I am running nodered/node-red-docker:latest within container station on a Qnap-253

It is running and I can access it via HTTP. But there is no login.

I updated the settings.je file and uncommented the adminAuth part. After reading up I see I need to use a hashed pwd which can be generated with node-red-admin. This is not by default installed so tried to install by running the following within the container (on qnap you can execute a command from the container station GUI):

npm install -g node-red-admin

This gave an error:

npm ERR! Linux 3.19.8                                                                                                                                                               
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "node-red-admin"                                                                                            
npm ERR! node v6.9.4                                                                                                                                                                
npm ERR! npm  v3.10.10                                                                                                                                                              
npm ERR! path /usr/local/lib/node_modules                                                                                                                                           
npm ERR! code EACCES                                                                                                                                                                
npm ERR! errno -13                                                                                                                                                                  
npm ERR! syscall access                                                                                                                                                             
                                                                                                                                                                                    
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'                                                                                                     
npm ERR!     at Error (native)                                                                                                                                                      
npm ERR!  { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'                                                                                                  
npm ERR!     at Error (native)                                                                                                                                                      
npm ERR!   errno: -13,                                                                                                                                                              
npm ERR!   code: 'EACCES',                                                                                                                                                          
npm ERR!   syscall: 'access',                                                                                                                                                       
npm ERR!   path: '/usr/local/lib/node_modules' }                                                                                                                                    
npm ERR!                                                                                                                                                                            
npm ERR! Please try running this command again as root/Administrator.  

I am not sure how to change my credentials within the container so now I am stuck, any hints/tips are welcome. Or maybe another way to update the settings.js file correctly...

Thx!

User data not being stored in mounted /data directory

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;

[email protected] 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)

Noob question about how to install extra modules when start a fresh docker container.

Hi guys, I would like to install some modules when creating a brand new docker container, I try to follow the github readme process but seems like nothing happen when I modify package.json file(in this case just a bigtimer node)

"dependencies": {
        "node-red": "0.18.4",
        "node-red-node-msgpack": "*",
        "node-red-node-base64": "*",
        "node-red-node-suncalc": "*",
        "node-red-node-random": "*",
        "node-red-contrib-bigtimer": "*"
    },

here is the docker command:

docker run --name=nodered --net=host --user=root --restart=always -d -v /opt/nodered:/data -v /opt/nodered/package.json:/usr/src/node-red/package.json -v /opt/nodered/settings.js:/data/settings.js nodered/node-red-docker:rpi 

what have I done something wrong here?
How am I suppose to create the new container and it auto install some modules for me?
Can I run some custom command when a container is created? like this in the beginning?
apt-get install libavahi-compat-libdnssd-dev

So sorry for the noob question, thanks

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

Hi everyone,

I'm experiencing the "JavaScript heap out of memory" on my flow when I try to receive a HTTP post request.

This is the logging:

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

<--- Last few GCs --->

185405 ms: Mark-sweep 486.4 (529.0) -> 485.7 (529.0) MB, 7368.5 / 0.0 ms [allocation failure] [GC in old space requested].
192804 ms: Mark-sweep 485.7 (529.0) -> 485.3 (529.0) MB, 7398.4 / 0.0 ms [allocation failure] [GC in old space requested].
200205 ms: Mark-sweep 485.3 (529.0) -> 495.3 (518.0) MB, 7400.4 / 0.0 ms [last resort gc].
207616 ms: Mark-sweep 495.3 (518.0) -> 505.4 (518.0) MB, 7411.3 / 0.0 ms [last resort gc].

<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x29c7c36d
1: setTimeout(aka setTimeout) [/usr/src/node-red/node_modules/node-red/nodes/core/core/80-function.js:~146] [pc=0x70e333d4] (this=0x29c081d9 )
2: arguments adaptor frame: 2->0
3: /* anonymous / [evalmachine.:~1] [pc=0x3c1c99e4] (this=0x712e4659 ,msg=0x5eeaf835 <an Object with map 0x71cdd7fd>)
4: /
anonymous */ [evalmachine.:28] [p...

Aborted (core dumped)

npm info lifecycle [email protected]~start: Failed to exec start script
npm ERR! Linux 4.9.35-v7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" "--" "--userDir" "/data" "--setting" "/data/settings.js"
npm ERR! node v6.11.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/data" "--setting" "/data/settings.js"
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the [email protected] start script 'node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/data" "--setting" "/data/settings.js"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-red-docker package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/data" "--setting" "/data/settings.js"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-red-docker
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls node-red-docker
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /usr/src/node-red/npm-debug.log

This is the content of npm-debug.log :

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'start',
1 verbose cli '--',
1 verbose cli '--userDir',
1 verbose cli '/data',
1 verbose cli '--setting',
1 verbose cli '/data/settings.js' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]prestart: [email protected]
6 silly lifecycle [email protected]
prestart: no script for prestart, continuing
7 info lifecycle [email protected]start: [email protected]
8 verbose lifecycle [email protected]
start: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/usr/src/node-red/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
10 verbose lifecycle [email protected]
start: CWD: /usr/src/node-red
11 silly lifecycle [email protected]start: Args: [ '-c',
11 silly lifecycle 'node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/data" "--setting" "/data/settings.js"' ]
12 silly lifecycle [email protected]
start: Returned: code: 134 signal: null
13 info lifecycle [email protected]~start: Failed to exec start script
14 verbose stack Error: [email protected] start: node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/data" "--setting" "/data/settings.js"
14 verbose stack Exit status 134
14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:191:7)
14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:191:7)
14 verbose stack at maybeClose (internal/child_process.js:891:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid [email protected]
16 verbose cwd /usr/src/node-red
17 error Linux 4.9.35-v7+
18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" "--" "--userDir" "/data" "--setting" "/data/settings.js"
19 error node v6.11.0
20 error npm v3.10.10
21 error code ELIFECYCLE
22 error [email protected] start: node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/data" "--setting" "/data/settings.js"
22 error Exit status 134
23 error Failed at the [email protected] start script 'node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/data" "--setting" "/data/settings.js"'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the node-red-docker package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/data" "--setting" "/data/settings.js"
23 error You can get information on how to open an issue for this project with:
23 error npm bugs node-red-docker
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls node-red-docker
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

This is how I run my container:

docker run -d -p 1881:1880 --name mynodered --device=/dev/serial0 --user=root -e NODE_OPTIONS="--max_old_space_size=512" --log-opt max-file=2 --log-opt max-size=2k braghettos/node-red-docker:0.17.5-rpi

I've enabled HTTPS in settings.js file .

Many thanks in advance,

Diego

Latest still using node 4.x on docker hub

Hey didn't the node 6.x update in the DockerFiles make it to docker hub? Seemed to have been updated at the same time as node-red update but I'm always getting node 4.x with the slim version.

npm install in network_mode host not working in node-red image with docker-compose

I am running mode-red module of nodejs with docker-compose in following way:

version: "3"
services:
    node-red:
        build: node-red/.
        container_name: mynodered
        network_mode: "host"
        volumes:
         - $PWD/data/node:/data
        ports:
         - "1880:1880"

I have placed the following docker file in folder node-red:

FROM nodered/node-red-docker:v8
RUN npm i -S basic-auth bcryptjs body-parser cheerio clone cookie cookie-parser cors cron express express-session follow-redirects fs-extra fs.notify hash-sum i18next is-utf8 js-yaml json-stringify-safe jsonata media-typer memorystore mqtt multer mustache node-red-contrib-cloudera node-red-contrib-confluent node-red-contrib-ksql node-red-contrib-python-function node-red-contrib-rdkafka node-red-contrib-s3 node-red-node-email node-red-node-feedparser node-red-node-rbe node-red-node-twitter nopt oauth2orize on-headers passport passport-http-bearer passport-oauth2-client-password raw-body semver sentiment uglify-js when ws xml2js && npm i -D chromedriver grunt grunt-chmod grunt-cli grunt-concurrent grunt-contrib-clean grunt-contrib-compress grunt-contrib-concat grunt-contrib-copy grunt-contrib-jshint grunt-contrib-uglify grunt-contrib-watch grunt-jsonlint grunt-mocha-istanbul grunt-nodemon grunt-sass grunt-simple-mocha grunt-webdriver istanbul mocha should sinon supertest wdio-chromedriver-service wdio-mocha-framework wdio-spec-reporter webdriverio && npm i -O bcrypt


When i am building image explicitly from this docker file in following way,its working fine
docker build --network host -t dvnode .

But when i am using docker-compose,it gives following error:

docker-compose up
Building node-red
Step 1/2 : FROM nodered/node-red-docker:v8
 ---> 8d6fdff59c2c
Step 2/2 : RUN npm i -S basic-auth bcryptjs body-parser cheerio clone cookie cookie-parser cors cron express express-session follow-redirects fs-extra fs.notify hash-sum i18next is-utf8 js-yaml json-stringify-safe jsonata media-typer memorystore mqtt multer mustache node-red-contrib-cloudera node-red-contrib-confluent node-red-contrib-ksql node-red-contrib-python-function node-red-contrib-rdkafka node-red-contrib-s3 node-red-node-email node-red-node-feedparser node-red-node-rbe node-red-node-twitter nopt oauth2orize on-headers passport passport-http-bearer passport-oauth2-client-password raw-body semver sentiment uglify-js when ws xml2js && npm i -D chromedriver grunt grunt-chmod grunt-cli grunt-concurrent grunt-contrib-clean grunt-contrib-compress grunt-contrib-concat grunt-contrib-copy grunt-contrib-jshint grunt-contrib-uglify grunt-contrib-watch grunt-jsonlint grunt-mocha-istanbul grunt-nodemon grunt-sass grunt-simple-mocha grunt-webdriver istanbul mocha should sinon supertest wdio-chromedriver-service wdio-mocha-framework wdio-spec-reporter webdriverio && npm i -O bcrypt
 ---> Running in a69e76805cc1
npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EAI_AGAIN: request to https://registry.npmjs.org/basic-auth failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org:443
npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
npm ERR! code EAI_AGAIN
npm ERR! errno EAI_AGAIN
npm ERR! request to https://registry.npmjs.org/node-red-contrib-cloudera failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org:443

npm ERR! A complete log of this run can be found in:
npm ERR!     /usr/src/node-red/.npm/_logs/2018-05-03T08_10_08_489Z-debug.log
ERROR: Service 'node-red' failed to build: The command '/bin/sh -c npm i -S basic-auth bcryptjs body-parser cheerio clone cookie cookie-parser cors cron express express-session follow-redirects fs-extra fs.notify hash-sum i18next is-utf8 js-yaml json-stringify-safe jsonata media-typer memorystore mqtt multer mustache node-red-contrib-cloudera node-red-contrib-confluent node-red-contrib-ksql node-red-contrib-python-function node-red-contrib-rdkafka node-red-contrib-s3 node-red-node-email node-red-node-feedparser node-red-node-rbe node-red-node-twitter nopt oauth2orize on-headers passport passport-http-bearer passport-oauth2-client-password raw-body semver sentiment uglify-js when ws xml2js && npm i -D chromedriver grunt grunt-chmod grunt-cli grunt-concurrent grunt-contrib-clean grunt-contrib-compress grunt-contrib-concat grunt-contrib-copy grunt-contrib-jshint grunt-contrib-uglify grunt-contrib-watch grunt-jsonlint grunt-mocha-istanbul grunt-nodemon grunt-sass grunt-simple-mocha grunt-webdriver istanbul mocha should sinon supertest wdio-chromedriver-service wdio-mocha-framework wdio-spec-reporter webdriverio && npm i -O bcrypt' returned a non-zero code: 1

HTTPS

How do I enable https option as well as secure node-red with username and password from within a node-red docker instance?

Password for the node-red user

Hi, When trying to install the Rpi-GPIO python library within the container, it needs access to be able to a sudo within the container. Can you tell me what the 'root' password is so I can do a sudo from the node-red user. Thanks

S.

Container created from latest image does not start

The problem

Running the command docker run -it -p 1880:1880 --name node-red nodered/node-red-docker does not start the application, but fails with the following error message:

Actual output

Error response from daemon: shim error: json: cannot unmarshal array into Go struct field processState.capabilities of type specs.LinuxCapabilities

Expected output

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

Environment

Docker image ID: 435384cc1753
Node Red version: 0.17.4
Docker version: 17.06.0-ce, build 3dfb8343
Linux kernel version: 4.11.9-1-ARCH
OS: Arch Linux

Use of USER prevents installation of additional tools

The use of the USER directive prevents extending the image to install additional tools.

I would like a Dockerfile that looks like this:

FROM nodered/node-red-docker:0.17.5

RUN apt-get install some-extra-tools

But this fails because the apt command is run as the node-red user which doesn't have permissions to install new software.

I notice also #9 which details other issues with the use of the USER directive. In my experience, unless there's a very good reason, it's more usual to not include a USER directive, instead allowing the system administrator to specify what user they want the container processes to run as using the --user command line switch to docker run.

This can be worked around by adding USER root before the apt-get, but that's a bit nasty and just adds more noise and layers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.